April 08, 2003
Ensureing sequence of XML tags

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:


<?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:element ref="Child1"/>
<xs:element ref="Child2"/>
<xs:element ref="Child3"/>
XML Message:
<?xml version="1.0" encoding="UTF-8"?>
Thanks in advance! (Please post your answer; preferably with supporting URLs; in the comments section below)

Sponsored links
Related Entries

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 PM

Thanks for the quick reply!

Posted by: Anders on April 8, 2003 09:54 PM

Why not just go to the source. They've got lots of great stuff on schemas.

Ack-- no linking, I see...

Here is the source:

Here is a list of w3c resources:

Here is their Schema Primer:

Posted by: johnp on April 11, 2003 08:43 PM
Post a comment

(Will not be displayed if you enter a website below. Otherwise, it will be displayed "spam protected")

(if you have one)

What do you want to say?
(please don't bother posting "spam" (pornography, viagra-sales etc - I will delete such comments anyway))

Remember info?

Referrers to this page
TrackBack URL for this entry:

[an error occurred while processing this directive]

© Anders Jacobsen
[extrospection.com photography]