I\'ve been dealing with an API recently that requires nodes of the XML document to be in a particular order. I was wondering why they feel the need to enforce this when I ca
The answer lies in XML-DTD/Schema. The underlying schema so defined in the API results in the error. Though I suppose I donot wish to teach XML here, still a look at the following will make things clear.
XML has two points to be considered:
Points about DTD: Suggested DTD upon your question:
]>
The above is a suggested DTD upon the structure you provided in the question. Since you are dealing with a particular API, it has such type of structure already defined in it. Alternative to this is the XML schema.
Points about XML Schema:
Currently, XML schema are used instead of DTDs as they are far more superior in defining the data structure for their users and provide an object-oriented approach.