 |
|
|
|
|
What are the new features in XML4J version 2?
|
- Modular architecture
-
XML4J's new architecture means that you only pay for the features that
you use. This will allow you to construct a parser configuration which only includes those features that your application needs, thus reducing the number of class files (or size of the jar file) required.
It also means that we will be able to add new functionality more easily, and that developers will be able to extend the functionality of the parser in new ways.
As examples of this extensibility, XML4J2 offers:
- Pluggable Validator
- This will allow the DTD based validator to be replaced with a validator based on some other method, such as the DCD, SOX, or DDML proposals under consideration in the W3C.
- Pluggable DOM implementation
- This allows a customized DOM implementation to be supplied. The TX compatiblity classes are implemented using this feature.
- Pluggable Catalog Support
- Support for a catalog is modular. In this release, we support provide two catalog modules.
- Performance
-
The performance of XML4J has improved in version 2. This is especially true for SAX.
- Footprint
-
The main memory footprint of XML4J has improved in version 2. This is
especially true for SAX.
- Validating SAX
-
One of the benefits of the new architecture is that we are able to
offer a validating parser that uses the SAX API.
- XCatalog
-
In addition to supporting SGML Open catalogs, XML4J version 2 now supports
version 0.2 of the XCatalog specification.
- Revalidation
-
-
XML4J version 2 will allow you to invoke the validator on a DOM tree after parsing has completed. This allows you to modify the DOM tree programatically and then check to make sure that the resulting tree is valid.
|
What features are not supported in this new
implementation?
|
This release does not provide revalidation on native DOM tree nodes. |
|
Which version of Swing is required by XML4J2?
|
This release uses Swing 1.1 (JFC 1.1) |
|
How can I recompile all the XML4J2 source files?
|
XML4J2 comes bundled with Bourne shell script files which can be used to compile all the sources. These scripts can be found in the build directory. To run these scripts you will need a Unix shell (Bourne Shell (sh), Korn Shell (ksh), Z-Shell (zsh), Bash (bash), etc...). A number of commercial and public domain shells are available. We have tested these scripts using the MKS Toolkit (commercial) and Cygnus Cygwin toolkit (GNU General Public License). More details can be found in the buildReadmePub.txt file in the build directory. Alternatively, you can include all the source files in any Java Integrate Development Environment project file and build the project.
Note: The scripts output the class files in a separate directory. |
|
How can I regenerate the Javadoc API files?
|
The script makeApiDocs.ksh generates the API documentation. This script can be found in the build directory. More details can be found in the buildReadmePub.txt
file. |
|
How can I package my own parser configuration?
|
XML4J version 2 allows you have a number of parser configurations: validating or non-validating SAX, validating or non-validation DOM, validating or non-validating TXDOM. Not all of these configurations require all the files in the XML4J version 2 distribution. To reduce disk footprint or download time, you can package just the files that you need for these configurations.
To aid you in doing this, we've provided some scripts to help with this process. In order to create a custom package, you need to extract the contents of the XML4J version 2 jar file to a new directory.
-
Create a new directory under the distribution directory (
xml4j2_n_n ), say configuration .
- copy the xml4j.jar file into
configuration .
- make
configuration your current directory by 'cd'ing there.
- to extract the contents of the jar, type
jar xf xml4j.jar . (You need to be sure that the jar program from the Sun JDK is in your path.)
After you have extracted the contents of the jar, you can then run one of the configuration scripts. If you are running Windows, the path to the script is ..\build\config.bat , and if you are running UNIX, the path is ../build/config.sh .
The configuration script takes 2 arguments. The first argument specifies which parser configuration you want to build. The available configurations are:
Command Line Argument | Configuration desired |
SAX | (non validating) SAX |
VSAX | Validating SAX |
DOM | (valiadating) DOM |
NVDOM | Non validationg DOM |
TXDOM | (validating) TX compatibility DOM |
NVTXDOM | Non validating TX compatibility DOM |
The second argument specifies which kind of catalog support (if any) you want:
Command Line Argument | Catalog support desired |
| none |
TXCATALOG | TXCatalog (V1.x parser) |
XCATALOG | XCatalog |
So to create a non validating DOM parser that included XCatalog support, you would type:
..\build\config.bat NVDOM XCATALOG (on Windows)
../build/config.sh NVDOM XCATALOG (on UNIX)
The script will create a jar file called custom.jar in the current directory, which is configuration in this example. This jar file contains only the classes that are needed for this parser configuration.
|
|
Is XML4J Version 2 100% pure Java compliant?
|
XML4J has not been formally certified to be 100% pure Java compliant. Running 'JavaPureCheck' results in a few warnings. As required, the explanations for these warning are given below.
###################### JavaPureCheck Report ##########################
#
# Generated on : February 2, 1999 4:04:26 PM PST
# System Model Version : jdk11
# JavaPureCheck Version : 3.15
# Rule Base Version : 1.92
#
# Summary:
#
# PURE: 281 WARNING: 5 ERROR: 0
#
# Final Result : WARNING
#
######################################################################
Class: org.xml.sax.helpers.ParserFactory
Warning: method reference: java.lang.Class.forName(java.lang.String)
Note: May load impure class
Explanation: The ParserFactory class is part of the SAX distribution and
is used to instantiate, by name, classes that implement the
Parser interface.
The XML4J parser, version 2, does not use this class except
in sample test code.
Status: WARNING
Class: com.ibm.xml.internal.msg.Message
Warning: possible hard-coded path: Character reference, "&//{0};", is out of range.
Note: Defines a bad path
Explanation: Any string constant in the class file that contains a possible path separator character is flagged as a possible hard-coded path. This string is not a path.
Warning: possible hard-coded path: Character reference, "&//x{0}", is out of range.
Note: Defines a bad path
Explanation: Any string constant in the class file that contains a possible path separator character is flagged as a possible hard-coded path. This string is not a path.
Warning: possible hard-coded path: Warning: attribute "xml:space" is recommended to be declared as "xml:space (default|preserve) //IMPLIED".
Note: Defines a bad path
Explanation: Any string constant in the class file that contains a possible path separator character is flagged as a possible hard-coded path. This string is not a path.
Warning: possible hard-coded path: Attribute default declaration expected. ("//REQUIRED", "//IMPLIED", or "//FIXED")
Note: Defines a bad path
Explanation: Any string constant in the class file that contains a possible path separator character is flagged as a possible hard-coded path. This string is not a path.
Warning: possible hard-coded path: "PCDATA" expected. "//" must be followed by "PCDATA".
Note: Defines a bad path
Explanation: Any string constant in the class file that contains a possible path separator character is flagged as a possible hard-coded path. This string is not a path.
Warning: possible hard-coded path: Invalid attribute default declaration. "//" must be followed by "REQUIRED", "IMPLIED", or "FIXED".
Note: Defines a bad path
Explanation: Any string constant in the class file that contains a possible path separator character is flagged as a possible hard-coded path. This string is not a path.
Status: WARNING
Class: com.ibm.xml.internal.DefaultEntityHandler
Warning: possible hard-coded path: /
Note: Defines a bad path
Explanation: Any string constant in the class file that contains a possible path separator character is flagged as a possible
hard-coded path. This string is not a path.
Status: WARNING
Class: com.ibm.xml.parsers.NonValidatingTXDOMParser
Warning: method reference: java.lang.Class.forName(java.lang.String)
Note: May load impure class
Explanation: The only call to Class.forName is used to instantiate the
class com.ibm.xml.parser.TXDocument which is shown by the
JavaPureCheck program to be pure.
Status: WARNING
Class: com.ibm.xml.parsers.NonValidatingDOMParser
Warning: method reference: java.lang.Class.forName(java.lang.String)
Note: May load impure class
Explanation: The only call to Class.forName is used to instantiate the class com.ibm.domimpl.DocumentImpl which is shown by the JavaPureCheck program to be pure.
Status: WARNING
Final Result : WARNING
|
|
|