[Home] [By Thread] [By Date] [Recent Entries]
What version of XML Schema do you use? AFAIK, XSD 1.1 offers some support in this direction, but I've stuck with 1.0 at the moment and don't know if they will meet your requirements. However, Schematron should do the trick for you (http://www.schematron.com/). It's am XML-based language for making assertions about patterns in documents such as the one you've described. Schematron rules are compiled into XSLT stylesheets. They can be define in a standalone document as well as included into an XSD schema (requires a validating parser that supports this). Of course, you can generate an run the stylesheets independently from an XSD validation. There are even ways of customizing the validation reports generated by Schematron. This gives you a lot of flexibility. Regards, Michael Am 18.08.2014 14:59, schrieb Trevor Nicholls trevor@xxxxxxxxxxxxxxxxxx: An XML element has numerous potential attributes, most of them optional. In a couple of cases, an attribute needs to be mandatory if another attribute has a particular value. Is there a way of defining this in the document schema?
Michael Schdfer C302 IT-Kompetenzzentrum Datenerhebung und Aufbereitung Telefon +49 (0)611.753652 michael.schaefer@xxxxxxxxxxx www.destatis.de DESTATIS wissen.nutzen. | Statistisches Bundesamt
|

Cart



