[See: from the distribution package, 19980612 version: http://www.alphaworks.ibm.com/formula/xml]
alpha-6 [12-Jun-1998]
XML for Java is an Extensible Markup Language (XML) processor written in Java. XML for Java provides two main functions:
xml4j-1998xxxx.exe
.
You will see the following files in the installed directory
such as C:\xml4j
FAQ.html FAQ README.html this file api/ directory for API documents docs/ directory for documents license.html license information personal.dtd sample DTD file personal.xml sample XML document src/ directory for source code xml4j.jar class files
C:\xml4j>type personal.xml C:\xml4J>jre -cp xml4j.jar trlx -d personal.xml
unzip
command.
xml4j-1998xxxx.zip
into
a directory.
C:\>unzip some_directory\xml4j-1998xxxx.zip C:\>cd xml4j C:\xml4j>
You will see the following files in the xml4j
directory:
FAQ.html FAQ README.html this file api/ directory for API documents docs/ directory for documents license.html license information personal.dtd sample DTD file personal.xml sample XML document src/ directory for source code xml4j.jar class files
C:\xml4j>type personal.xml C:\xml4J>jre -cp xml4j.jar trlx -d personal.xml
.tar.gz
format.
(If you have installed the unzip
command for UNIX, ZIP format is also Ok.)
# cd /usr/local # gzip -dc some_directory/xml4j-1998xxxx.tar.gz | tar xvf - # cd xml4j
You will see the following files in the xml4j
directory:
FAQ.html FAQ README.html this file api/ directory for API documents docs/ directory for documents license.html license information personal.dtd sample DTD file personal.xml sample XML document src/ directory for source code xml4j.jar class files
# cat personal.xml # jre -cp xml4j.jar trlx -d personal.xml
Some sample applications are provided:
trlx is an XML syntax checker. To check an XML document, type:
jre -cp xml4j.jar trlx <xml-filename>
SiteOutliner is a Java application that scans a Web site and reports its profile in CDF format. The profile contains a list of links to the pages, showing the structure of the site. The user can limit the files to be scanned by using some conditions, such as file types (extensions) and modified dates. The program can be used in both command prompt and window environments.
CDF Editor is a Java application to edit CDF files. The user loads a CDF file and edits the channels and items.
CDF Viewer is an applet that parses CDF files and visualizes their structures by using a tree.
This sample generates a valid element tree according to the specified DTD.
jre -cp xml4j.jar com.ibm.xml.sample.GeneratingSample personal.dtd
A sample application using com.ibm.xml.parser.util.TreeFactory
.
You need to install JFC 1.1 (Swing-1.0)
to run this program.
jre -cp "xml4j.jar;C:/swing-1.0.2/swingall.jar" com.ibm.xml.sample.TreeView personal.xml
A sample application using com.ibm.xml.xpointer
package.
You need to install JFC 1.1 (Swing-1.0)
to run this program.
jre -cp "xml4j.jar;C:/swing-1.0.2/swingall.jar" com.ibm.xml.sample.XPointerDemo personal.xml
This program has 2 function:
All the classes required to run these sample applications are in xml4j.jar.
This distribution archive includes a file named xml4j.jar
.
Add this file to your CLASSPATH
environment variable, writing a command such as
(assuming that you have installed XML for Java in C:\xml4j.)set CLASSPATH=C:\xml4j\xml4j.jar;.
(for Windows)
setenv CLASSPATH /usr/local/xml4j/xml4j.jar:.
(for UNIX, csh/tcsh)
export CLASSPATH="/usr/local/xml4j/xml4j.jar:."
(for UNIX, ksh/bash/zsh)
The following resources are provided for application development:
<?xml encoding="...."
'
Attribute, AttributeDefinition, AttributeList, CDATASection,
Comment, Document, Element, Node, NodeIterator, Notation, PI,
Text
(there are limitations in some methods)
DocumentContext, DocumentFragment, DocumentType, DOM,
ElementDefinition, ElementToken, EntityDeclaration,
EntityReference, ModelGroup, PCDATAToken, TreeIterator,
XMLNode
W3C DOM interfaces belong to a package named
`org.w3c.dom
'.
com.ibm.xml.parser.SAXDriver
provides the SAX interface.
com.ibm.xml.xpointer
package provides
parsing XPointer expression,
generating an XPointer
instance from a node in a document tree,
searching for nodes pointed by an XPointer
instance.
EntityValue
and Entity
into Entity
;
Removed EntityValue
.
java.io.Serializable
interface to object model classes.
XPointer makeXPointer()
of Child
class and Pointed point(TXDocument)
of XPointer
class.
com.ibm.xml.sample.XPointerDemo
Here is more description in HTML comment.
NodeIterator
s aren't LIVE.
Technical questions and comments to alphaWorks communityXchange or TAMURA, Kent (A Notes address for IBM employees is <Kento Tamura/Japan/IBM@IBMJP>)
Non-technical questions to MARUYAMA, Hiroshi (A Notes address is <Hiroshi Maruyama/Japan/IBM@IBMJP>)