[relaxng-user] xsd2rng

Bruce D'Arcus bdarcus at fastmail.fm
Wed Dec 10 13:47:45 ICT 2003

OK, going back to my MODS schema example, which I've converted to RNG 
with the Sun conversion tool.  Unfortunately, it strips the 
documentation and results in some odd (though workable) code in places.

Here's is how the extension element -- designed to allow foreign 
namespaced content -- is defined in the xsd file:

	<xsd:complexType name="extensionType" mixed="true">
			<xsd:documentation>use for local extensions or for extensions from 
other XML schemas</xsd:documentation>
			<xsd:any processContents="skip" maxOccurs="unbounded"/>

Full schema at:


And following is how it was transformed to RNG.  I've cleaned this up a 
bit, and posted it here:


Is there not a better way to represent the above in RNG?

    | element extension {
           mixed { element0+ }
    | recordInfo)+


"element0" defined as so:


element0 =
   element * {
     mixed {
        | attribute * { text })*
element1 =
   element * {
     mixed {
       (attribute * { text }
        | element1)*

More information about the relaxng-user mailing list