Re: XML Validation against XSD



Ayan wrote:

With my XSD I need to check that there's at least one address which is
of type "P". If there is no address of type "P" the XML is invalid.

Is it possible using XSD?

Not really, if you want to express such constraints then look into Schematron: <http://www.schematron.com/>


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
.



Relevant Pages

  • Re: XSD help
    ... You can embed Schematron rules in an XSD schema to specify co-occurrence ... constraints and layer over XSD validation. ...
    (microsoft.public.dotnet.xml)
  • Re: Creating Ruby Classes from XSD?
    ... } Those kinds of constraints can be done in code, ... I'd store the fields in a hash and override ... XSD and Ruby. ... def method_missing ...
    (comp.lang.ruby)
  • Re: XML W3C Schema, check excistence of attribute depending on other attributes
    ... The existance of an attribute depnds on a the VALUE of another ... thing in the way of schematron like assertions. ... interested last call for the current draft of XSD 1.1 ends this Friday ... functionality is in your tools is anyones guess! ...
    (comp.text.xml)
  • Invalid Key node inside constraint error
    ... I have an XML document that I'm reading into a dataset. ... created dataadapters and constraints for all the tables and relationships and ... running the code to create the constraints all the time, ... WriteXMLSchema to write out an .xsd for me that has everything already ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: dynamically generate xml from xsd
    ... Sameer Gupta wrote: ... Could we instantiate a sample xml directly from XSD? ... Martin Honnen --- MVP XML ...
    (microsoft.public.dotnet.xml)

Quantcast