← Prev in month
← Prev in thread
[xml-dev] Using Oxygen with Schemetron
Decided to try using oxygen to embed schemtron into my existing XML schema. Im having problems however, and im finding the help documentation limited =( How can i embed Schemtron into my XML schema (.xsd) file, and validate the file.... and likewise validate any .xml file using the schema. i tried this, but having problems: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sc="http://www.ascc.net/xml/schematron" elementFormDefault="qualified"> <xs:annotation> <xs:appinfo> <sc:title>Schematron validation</sc:title> <sc:ns prefix="tron"/> </xs:appinfo> </xs:annotation> .... <xs:element name="Entry" type="Entry_CT"/> <xs:complexType name="Entry_CT"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="column" type="xs:int"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:element name="Table2D" type="Table2D_CT"> <xs:annotation> <xs:appinfo> <sc:pattern name="CheckRows"> <sc:rule context="tron:Table2D"> <sc:assert test="count(tron:Entry) = tron:@num_rows">Incorrect Number of Rows</sc:assert> </sc:rule> </sc:pattern> </xs:appinfo> </xs:annotation> </xs:element> <xs:complexType name="Table2D_CT"> <xs:sequence maxOccurs="unbounded"> <xs:element ref="Entry"/> </xs:sequence> <xs:attribute name="num_rows" type="xs:int"/> </xs:complexType> oxygen seems not to do any sort of validation on the schematron tags (e.g. i can use a <sc:invalidtag> tag and it will validate it even though schematron doesnt have that tag/element) and it doesnt work with my .xml file, i.e. i deliberatly have less or more Entry elements then what num_rows is set to. any sort of help would be greatly appreciated. thanks! Paul Popiel Software Engineer Advanced Engine Components Limited 14 Energy St, Malaga WA 6090 Fax: +61 8 9209 6999 Mob: 0412 657 051 mailto: http://www.advancedengine.com ********************************************************************** This email is confidential. If you are not the intended recipient, you must not copy, distribute, disclose or otherwise use the information contained in it. If you have received this email in error, please tell us immediately by return email or by contacting us on (+61 8) 9209 6900 and delete the document. Email may be susceptible to data corruption, interception and unauthorised amendment. Advanced Engine Components Ltd is not responsible for any changes made to a document other than those made by Advanced Engine Components Ltd, or for the effect of the changes on the document's meaning. You must scan this email and any attachments for viruses. Advanced Engine Components Ltd accepts no liability for any loss, damage or consequence, whether caused by our own negligence or not, resulting directly or indirectly from your receipt of this email or the use of any attachments. **********************************************************************
← Prev in month
← Prev in thread