Valid XML and Well-Formed XML


Valid XML and Well- Formed XML

XML that names an external model and is compliant with that model is said to be valid. The term is very specific; it describes the highest of three states that an XML file can attain.

  • A valid XML entity is a well-formed XML entity that references a published data descriptor and complies with the rules it expresses.

  • A well-formed XML entity complies with all XML syntax rules.

  • A malformed XML entity does not have proper XML syntax. (It is not really XML.)

There are several competing formats for expressing XML data structure. The official format is the Document Type Definition ( DTD ). It is officially accepted but not unchallenged. Weaknesses in DTD expressivity have led to the rise of competing technologies. The most viable of these seems to be Microsoft's Schema. Schema is still a work in progress, growing in both technical maturity and political acceptance. But in spite of their strengths, other proprietary formats are not as broadly accepted as DTD, which will be our focus here.

It should be noted that not every parser is a validating parser. The Flash parser, for example, is not. It cannot distinguish well-formed from valid files. It will not open the DTD file and will not use the tools supplied.

We could ask why we need to stuff our aching heads with the DTD syntax if it will be ignored by Flash. The reason is sound. Every file we read had to be written at some point. As it is being written, particularly when it is written by a human, there is the potential for errors. The use of a DTD (or Schema, or other data definition) will test the XML ”not for its compliance with the XML standard but for its adherence to the higher standard asserted by the application. A standardized DTD makes an excellent way to publish (to outside content providers, for example) the format in which you will accept data. Content publishers and their customers not only can express these formats but easily test them. Each can get confidence from a validation procedure that is as simple as opening the XML file in Internet Explorer.



Flash and XML[c] A Developer[ap]s Guide
Flash and XML[c] A Developer[ap]s Guide
ISBN: 201729202
EAN: N/A
Year: 2005
Pages: 160

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net