Chapter 10. Where to Now

   

XML As a File Format

As you know, XML is an extensible syntax. It does not define elements or attributes ”it's up to you, the developer, to define them. One of the main issues for XML users is deciding on the vocabulary they need for their applications. In some cases, they can turn to standard vocabularies, such as RSS; in other cases, they will need to create their own.

I strongly believe that the best approach when deciding on a vocabulary for a given project is the following two-step process:

  1. Survey the market for existing vocabularies that match your needs. ( xml.org is an invaluable resource in that respect.)

  2. Failing this, model your own vocabulary after existing file formats.

Unfortunately, XML is still young. After all, it was introduced only in 1998. Popular SGML DTDs, such as DocBook and HTML, have been ported to XML. XSLFO is also available, so if you are developing a publishing application, you will find good and stable vocabularies.

However, for other applications, chances are that no standard format exists yet. A lot of work is in progress to define XML vocabularies for applications as diverse as multimedia (SMIL and SVG), e-commerce (RosettaNet and ebXML), and content synchronization (SynchML), but the market has not decided on the winning formats yet.

Therefore, for the time being, you might be stuck with developing your own vocabulary. As you go through this process, I urge you to review existing file formats or legacy formats. Basing your new format on something already in existence is more efficient than starting from scratch. Legacy formats have accumulated tremendous experience and only a fool would want to ignore them.

However, you must walk a fine line between inspiration (not copying outright ) and plagiarism. As you review legacy formats, use them for inspiration but don't feel bound by their limitations. Often, legacy formats have technical limitations that are no longer relevant with XML.

For example, in Chapters 5, "Export to Any Format," and 6, "Import from Any Format," I introduced an XML order that is inspired by a legacy order (EDIFACT). The XML order follows the same data model as the EDIFACT order with buyer, seller, and product lines. However, the similarities end there ”the XML document takes advantage of XML, for example, by making the relationship between lines and products more explicit than in EDIFACT.

As you can see, I used EDIFACT for inspiration, but I didn't feel limited by EDIFACT's technical constraints.

To help you succeed, I urge you to use a modeling language, such as UML. In most cases, it is safer than trying to create a DTD from scratch ”particularly if you are not yet experienced with XML.

The following are two serious advantages to going through a data model:

  1. UML is well accepted and widely understood . This enables you to share your design with other programmers who might not be familiar with XML. Therefore, you can benefit from their experience.

  2. The UML model is more abstract than the underlying XML vocabulary. The effort required to model at a higher level of abstraction guarantees that you will tend toward inspiration rather than plagiarism.

   


Applied XML Solutions
Applied XML Solutions
ISBN: 0672320541
EAN: 2147483647
Year: 1999
Pages: 142

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