Validation of attributes in combination of other attributes?
-
Hi! Perhaps someone can give me a push in the right direction? I've got an XML file I want to validate using an XMLSchema. One of the elements has an attribute that can be optional if another attribute has a certain value and that is required in other cases. Is there a way to include such conditions into an XSD or do I have to validate this condition manually?
Regards, mav -- Black holes are the places where God divided by 0...
-
Hi! Perhaps someone can give me a push in the right direction? I've got an XML file I want to validate using an XMLSchema. One of the elements has an attribute that can be optional if another attribute has a certain value and that is required in other cases. Is there a way to include such conditions into an XSD or do I have to validate this condition manually?
Regards, mav -- Black holes are the places where God divided by 0...
Interesting question. You are asking about something called a co-occurrence constraint. XML Schema does not directly support co-occurrence constraints, but it is an area some people are researching. A researcher, Fabio Vitali, has done some work in this area and has come up with a solution that pre-processes a special file that results in a new XML schema. The new XML schema is then used to validate instance documents. Here's the link http://tesi.fabio.web.cs.unibo.it/Tesi/SchemaPath[^] - click the link "SchemaPathImplementations" for the stylesheets and other files you'll need. A much simpler approach is to validate this manually, but Fabio Vitali offers a way using XSL and XML Schema - which is pretty cool!
Erik Westermann - wWorkflow.net - BizTalk Consulting Services
SOA * ESB * BPI * SaaS ... forget the alphabet soup - get the main course with our consulting services!
wWorkflow.net or +1 416-809-1453 -
Interesting question. You are asking about something called a co-occurrence constraint. XML Schema does not directly support co-occurrence constraints, but it is an area some people are researching. A researcher, Fabio Vitali, has done some work in this area and has come up with a solution that pre-processes a special file that results in a new XML schema. The new XML schema is then used to validate instance documents. Here's the link http://tesi.fabio.web.cs.unibo.it/Tesi/SchemaPath[^] - click the link "SchemaPathImplementations" for the stylesheets and other files you'll need. A much simpler approach is to validate this manually, but Fabio Vitali offers a way using XSL and XML Schema - which is pretty cool!
Erik Westermann - wWorkflow.net - BizTalk Consulting Services
SOA * ESB * BPI * SaaS ... forget the alphabet soup - get the main course with our consulting services!
wWorkflow.net or +1 416-809-1453Great, thanks for the reply! I'll take a look at the link.
Regards, mav -- Black holes are the places where God divided by 0...