w3-ravenala Posted October 24, 2007 Share Posted October 24, 2007 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 More sharing options...
boen_robot Posted October 24, 2007 Share Posted October 24, 2007 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 More sharing options...
w3-ravenala Posted October 25, 2007 Author Share Posted October 25, 2007 I'm afraid not.That's the answer I was expecting :-(I'll try working out your sollution.Thks ! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.