Sunday 15 May 2011

xml - Simplify XSD Schema using XQuery -



xml - Simplify XSD Schema using XQuery -

we're building xquery tool create documentation xsd schemas (specifically ubl 2.1 schemas).

in order that, need simplify schemas built extensive utilize of element references , complex types, inline definitions.

so element this:

<xsd:element name="order" type="ordertype"/> <xsd:complextype name="ordertype"> <xsd:sequence> ... <xsd:element ref="cbc:ublversionid" minoccurs="0" maxoccurs="1"/> ... </xsd:sequence> </xsd:complextype> ... (in file) <xsd:element name="ublversionid" type="ublversionidtype"/> <xsd:complextype name="ublversionidtype"> <xsd:simplecontent> <xsd:extension base="xsd:string"/> </xsd:simplecontent> </xsd:complextype>

should converted to:

<xsd:element name="order"> <xsd:complextype> <xsd:sequence> ... <xsd:element ref="cbc:ublversionid" minoccurs="0" maxoccurs="1"> <xsd:complextype name="ublversionidtype"> <xsd:simplecontent> <xsd:extension base="xsd:string"/> </xsd:simplecontent> </xsd:complextype> ... </xsd:sequence> </xsd:complextype> </xsd:element>

taking in business relationship elements , types defined in imported schemas.

is there known method xquery?

thanks.

you might find useful process schemas saxon's scm format, xml representation of xsd schema components in normalized form. can generate form using

java com.saxonica.validate -xsd:schema.xsd -scmout:schema.scm

the documentation scm format schema component documentation in w3c spec.

the format opposite of asking for: components "out of line", accessed next references. it's highly uniform, , avoids complexities of managing includes, imports, namespaces, , qnames.

xml xsd xquery

No comments:

Post a Comment