InfoCenter Home >
3: Migration overview >
3.3: Migrating APIs and specifications >
3.3.4: Migrating to supported XML API
3.3.4: Migrating to supported XML API
If your XML applications use XML for Java API Version 2.0.x or earlier,
you must migrate them to API Version 3.1 or the equivalent open-source version.
Although there are inherent performance improvements in later versions of
the XML for Java API, you can gain additional performance
by explicitly using nonvalidating parsers
in application environments where the data can be trusted.
Issues for migrating from XML for Java API Version 1.1.x
The most significant change is that the TX-compatible APIs are no longer available.
The Document API retains the XML manipulation APIs that were in TXDocument,
but the following functionality must be rewritten:
- Creating and loading an XML parser:
We suggest the use of
a Java API for XML Processing (JAXP)
factory class.
- Writing out the DOM tree:
A serializer must now be used.
One drawback to the DOM Level 2 implementation in this level of the XML for Java API
is that the grammar (DTD or schema) is no longer a node in the DOM tree,
so it cannot be written out.
As a result,
we recommend that only external grammars be used.
You can query the system ID of the root element
and use it to retrieve the name that is specified in the
<!DOCTYPE> statement.
After the tree has been written out to an XML file,
you can read the file as text and
insert a <!DOCTYPE> statement.
|
|