Time to selfishly summoning the LazyWeb (hoping this is appropriate)...: a colleague has asked me the following question, and I can't find an explicit, definitive answer. Can anyone help?
Do you know if an XML Schema defines the order of child elements (XML tags) in an XML message.E.g. does the schema below define that the order of the child elements always will appear in the order shown in the sample XML message below:
Schema:
XML Message:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Child1" type="xs:string"/>
<xs:element name="Child2" type="xs:string"/>
<xs:element name="Child3" type="xs:string"/>
<xs:element name="Parent">
<xs:complexType>
<xs:sequence>
<xs:element ref="Child1"/>
<xs:element ref="Child2"/>
<xs:element ref="Child3"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<Parent>
<Child1>A</Child1>
<Child2>B</Child2>
<Child3>C</Child3>
</Parent>
Thanks in advance! (Please post your answer; preferably with supporting URLs; in the comments section below)
yes it does.
if you want some good reading, i recommend the book Definitive XML Schema (ISBN: 0130655678). its by the folks who wrote the XML Schema specification. definetly worth the money.
Posted by: sungo on April 8, 2003 08:53 PMThanks for the quick reply!
Posted by: Anders on April 8, 2003 09:54 PMWhy not just go to the source. They've got lots of great stuff on schemas.
Ack-- no linking, I see...
Here is the source:
http://www.w3.org/
Here is a list of w3c resources:
http://www.w3.org/XML/Schema
Here is their Schema Primer:
http://www.w3.org/TR/xmlschema-0/
©
Anders Jacobsen [extrospection.com photography] |