Java Reference
In-Depth Information
Table 7.2 XML translation technology is simple and effective. Often, translation is eschewed in
favor of expensive application development or manual effort, without regard to performance
XML warning signs
Potential problems
XML documents are used as shipped.
The document may not be in the optimal format
for use as shipped.
Elements, types, and attributes contain formats
and data proprietary to other organizations.
Additional data is expensive to parse and store.
These can all be translated in a single step and
save the application developers significant time.
Applications parse XML data into a model and
immediately restructure it.
XSLT translations are usually easier to code and
maintain than application translations.
Different documents that contain the same data
are created independently.
New applications or manual effort to create a
new format for existing data is much more
expensive than the alternative. Instead, XSLT
translations should be used to repurpose data.
Applications use proprietary parsing technology
to render XML.
When manual parsers are written for XML data,
it may be a sign that someone is reinventing the
wheel. Instead, XML programming extensions
like DOM or SAX should be used, or even the
XSLT scripting alternative.
Fortunately, with XML you can quickly translate documents between different
formats. You can combine XSLT with cascading style sheets ( CSS ) to create a
simple and effective presentation. You can also make adjustments to a docu-
ment over a major interface. It doesn't matter if the target format is XML or
not; XSLT can easily translate to non- XML targets as well.
Mini-antipatterns: Rigid XML
XML gives you a degree of freedom, compatibility, and flexibility that isn't
possible with other languages. You can extend languages and vocabularies that
describe proprietary data. XML lets you forge e-businesses by describing a
transaction rather than dictating the implementation. However, if you box
yourself in by designing rigid, inflexible XML , many of the advantages are lost.
An excellent resource is a collection of best practices moderated by Roger
L. Costello at http: // / BestPracticesHomepage.html. The
mini-antipatterns in this section are based on the content on that site.
When you build an interface across a major organizational boundary, you'll
probably make a significant investment negotiating the XML schema of the
Search WWH ::

Custom Search