Jump to content

Possible in XSD ?


w3-ravenala

Recommended Posts

Hi everyone,I've a very simple question about XSD schemas... here is the thing :In my XML file I have an Element containing an string attribute :<myElement myAttribute="aString">...</myElement>I want my schema to check that :- if "aString" contains '?' or '*', it has to match the regular expression A- else it must match the regular expression BDo you think it is possible with XSD ?Many thanks, R.

Link to comment
Share on other sites

I'm afraid not. You could make a string match two regular expressions, but not to match either one and especially not on conditions.You may try to make this into a single regular expression though, like:

(A1)\?(A2)|(B1)\*(B2)

Replacing A* and B* with the respective regular expressions in a fashion that will allow them to be matched regardless of the posiion of either characers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...