mercredi 27 janvier 2016

Xml Schema Pattern At The Beginning Of A String

I am new to XML Schema and to RegEx.

I want to define a pattern that matches the following structure:

<fantastic>:item.attribute</fantastic>

as well as:

<fantastic>:item.attribute,:item.attribute,:item.attribute</fantastic>

I would like to have pairs of items and attributes. If there is more than one pair, the pairs should be seperated by a comma. So I would like to tell the parser the following:

'If the pattern starts at the beginning of a string no comma is put before it. Else a comma needs to be put before the (repeated) string.'

The pattern for the item and the attribute is much more complicated. But it works with the exception of the comma seperation between the pairs.

I have done some research and found out that ^ is used to tell the parser that the previous character has to be at the beginning of a string.

But I could not use it in XML Schema Pattern. Does even exist in XML?

How would you write this?

Kind regards

Aucun commentaire:

Enregistrer un commentaire