Jump to content
w3-ravenala

Possible in XSD ?

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...