You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general-cvs@xml.apache.org by ne...@apache.org on 2002/02/05 22:16:59 UTC
cvs commit: xml-site/sources/xerces2-j/style/stylesheets any2header.xsl any2project.xsl book2group.xsl book2project.xsl changes2document.xsl context2footer.xsl context2label.xsl design2document.xsl design2html.xsl directory2project.xsl document2html.xsl faqs2document.xsl group2document.xsl releases2document.xsl settings2document.xsl
neilg 02/02/05 13:16:59
Added: sources/xerces2-j api.xml docs-book.xml dom3.xml
faq-build.xml faq-common.xml faq-general.xml
faq-pcfp.xml faq-performance.xml faq-write.xml
faq-xni.xml features.xml install.xml
limitations-schema.xml limitations.xml
properties.xml readme.xml releases.xml
samples-dom.xml samples-sax.xml samples-socket.xml
samples-ui.xml samples-xni.xml samples.xml
xni-components-dependence.gif
xni-components-overview.gif xni-config.xml
xni-core.xml xni-design.xml xni-entity-manager.gif
xni-parser-configuration.gif xni-pipeline-basic.gif
xni-pipeline-detailed.gif xni-xerces2.xml xni.xml
sources/xerces2-j/dtd blocks.ent book.dtd characters.ent
design.dtd document.dtd entities.ent faqs.dtd
links.ent markup.ent releases.dtd settings.dtd
sources/xerces2-j/style/graphics button-a.gif button-b.gif
sources/xerces2-j/style loader.xml
sources/xerces2-j/style/resources bottom.gif
button-asf-hi.gif button-asf-lo.gif
button-w3c-hi.gif button-w3c-lo.gif
button-xml-hi.gif button-xml-lo.gif changes-add.jpg
changes-fix.jpg changes-remove.jpg
changes-update.jpg close.gif dot.gif join.gif
line.gif logo.gif note.gif right.gif script.js
separator.gif void.gif
sources/xerces2-j/style/stylesheets any2header.xsl
any2project.xsl book2group.xsl book2project.xsl
changes2document.xsl context2footer.xsl
context2label.xsl design2document.xsl
design2html.xsl directory2project.xsl
document2html.xsl faqs2document.xsl
group2document.xsl releases2document.xsl
settings2document.xsl
Log:
source for Xerces-J 2 site
Revision Changes Path
1.1 xml-site/sources/xerces2-j/api.xml
Index: api.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='API JavaDoc'>
<s2 title='Standard API Documentation'>
<p>
Always try to use only the standard XML APIs when writing
XML applications. This will keep your application shielded
from changes in the underlying implementation of those
standard APIs and also gives you more flexibility to change
the implementation of the standard pieces without modifying
your application code.
</p>
<ul>
<li><jump href='javadocs/api/index.html'>Standard API</jump></li>
<ul>
<li>Java API for XML Processing (JAXP)</li>
<ul>
<li>
<jump href='javadocs/api/javax/xml/parsers/package-summary.html'>XML
Parser Factories</jump>
</li>
</ul>
<li>Document Object Model (DOM)</li>
<ul>
<li>
<jump href='javadocs/api/org/w3c/dom/package-summary.html'>Core</jump>
</li>
<li>
<jump href='javadocs/api/org/w3c/dom/events/package-summary.html'>Events</jump>
</li>
<li>
<jump href='javadocs/api/org/w3c/dom/html/package-summary.html'>HTML</jump>
</li>
<li>
<jump href='javadocs/api/org/w3c/dom/ranges/package-summary.html'>Ranges</jump>
</li>
<li>
<jump href='javadocs/api/org/w3c/dom/traversal/package-summary.html'>Traversal</jump>
</li>
</ul>
<li>Simple API for XML (SAX)</li>
<ul>
<li>
<jump href='javadocs/api/org/xml/sax/package-summary.html'>Core</jump>
</li>
<li>
<jump href='javadocs/api/org/xml/sax/helpers/package-summary.html'>Helper Classes</jump>
</li>
<li>
<jump href='javadocs/api/org/xml/sax/ext/package-summary.html'>Extensions</jump>
</li>
</ul>
</ul>
</ul>
</s2>
<s2 title='Xerces Native Interface Documentation'>
<p>
If you need functionality that is not available in the
standard APIs like DOM and SAX, then perhaps using the Xerces
Native Interface (XNI) will provide the information to build
the appropriate parsing tools for your application. For more
detailed information regarding XNI, refer to the
<link idref='xni'>XNI Manual</link>.
</p>
<ul>
<li>
<jump href='javadocs/xni/index.html'>Xerces Native Interface</jump>
</li>
<ul>
<li>
<jump href='javadocs/xni/org/apache/xerces/xni/package-summary.html'>Core</jump>
</li>
<li>
<jump href='javadocs/xni/org/apache/xerces/xni/parser/package-summary.html'>Parser
Configuration</jump>
</li>
<li>
<jump href='javadocs/xni/org/apache/xerces/xni/psvi/package-summary.html'>PSVI interfaces</jump>
</li>
</ul>
</ul>
</s2>
<s2 title='DOM Level 3 API'>
<p>Includes DOM Level 3 Working Draft APIs:</p>
<ul>
<li><jump href="http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025/">Abstract Schema and Load and Save</jump>
</li>
<li><jump href="http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010913/">DOM Level 3 Core</jump>
</li>
</ul>
<p>
These APIs are unstable and may change:
<jump href='javadocs/dom3-api/index.html'>org.apache.xerces.dom3</jump>
</p>
</s2>
<s2 title='Xerces2 Implementation Documentation'>
<p>
For maintainers and developers of the Xerces2 reference
implementation, it's important to know the internal APIs
used.
</p>
<ul>
<li>
<jump href='javadocs/xerces2/index.html'>Xerces2 Implementation</jump>
</li>
</ul>
</s2>
<s2 title='Other Classes Documentation'>
<p>
The Xerces2 package also contains other implementation classes.
You can jump to the API for these classes via the following links:
</p>
<ul>
<li><jump href='javadocs/other/index.html'>Other Classes</jump></li>
</ul>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/docs-book.xml
Index: docs-book.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE book SYSTEM 'dtd/book.dtd'>
<book title='&ParserName; Documentation'
copyright='1999-2001 The Apache Software Foundation'>
<external label='Home' href='http://xml.apache.org/'/>
<separator/>
<document label='Readme' title='&ParserNameLong; Readme'
id='index' source='readme.xml'/>
<document label='Installation' title='Installation Instructions'
id='install' source='install.xml'/>
<external label='Download' href='http://xml.apache.org/dist/xerces-j/'/>
<external label='CVS Repository'
href='http://xml.apache.org/websrc/cvsweb.cgi/xml-xerces/java/'/>
<separator/>
<document label='Samples' title='Sample Programs'
id='samples' source='samples.xml'/>
<hidden title='DOM Samples' id='samples-dom' source='samples-dom.xml'/>
<hidden title='SAX Samples' id='samples-sax' source='samples-sax.xml'/>
<hidden title='Socket Samples' id='samples-socket' source='samples-socket.xml'/>
<hidden title='User Interface Samples'
id='samples-ui' source='samples-ui.xml'/>
<hidden title='XNI Samples' id='samples-xni' source='samples-xni.xml'/>
<document label='API JavaDoc' title='API JavaDoc'
id='api' source='api.xml'/>
<!--
<external label='API JavaDoc' href='apiDocs/index.html'/>
-->
<document label='XNI Manual' title='Xerces Native Interface'
id='xni' source='xni.xml'/>
<hidden title='XNI Design Details'
id='xni-design' source='xni-design.xml'/>
<hidden title='XNI Core Interfaces'
id='xni-core' source='xni-core.xml'/>
<hidden title='XNI Parser Configuration'
id='xni-config' source='xni-config.xml'/>
<hidden title='Xerces2 Components' id='xni-xerces2' source='xni-xerces2.xml'/>
<faqs label='FAQs' title='Frequently Asked Questions' id='faqs'>
<faq title='Common FAQs' id='faq-common' source='faq-common.xml'/>
<faq title='General FAQs' id='faq-general' source='faq-general.xml'/>
<faq title='Parser Configuration, Features and Properties FAQs' id='faq-pcfp' source='faq-pcfp.xml'/>
<faq title='Xerces Native Interface FAQs' id='faq-xni' source='faq-xni.xml'/>
<faq title='Building and Running FAQs'
id='faq-build' source='faq-build.xml'/>
<faq title='Writing Applications FAQs'
id='faq-write' source='faq-write.xml'/>
<faq title='Performance FAQs'
id='faq-performance' source='faq-performance.xml'/>
</faqs>
<separator/>
<settings title='Parser Features' label='Features'
id='features' source='features.xml'/>
<settings title='Parser Properties' label='Properties'
id='properties' source='properties.xml'/>
<separator/>
<releases label='Release Info' title='Release Information'
id='releases' source='releases.xml'/>
<document label='Limitations' title='Parser Limitations'
id='limitations' source='limitations.xml'/>
<hidden title='XML Schema Limitations' id='limitations-schema' source='limitations-schema.xml'/>
<hidden title='DOM Level 3 Implementation' id='dom3' source='dom3.xml'/>
<external label='Report a Bug'
href='http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Xerces2-J'/>
</book>
1.1 xml-site/sources/xerces2-j/dom3.xml
Index: dom3.xml
===================================================================
<?xml version="1.0" standalone="no"?>
<!DOCTYPE s1 SYSTEM "./dtd/document.dtd">
<s1 title="Document Object Model Level 3 Implementation">
<s2 title="Disclaimer">
<p>
The &ParserNameLong; &ParserVersion; contains a partial implementation of the W3C Document Object Model
Level 3. This implementation is experimental. The DOM Level 3 specification is
still in working draft stage: you should not consider this implementation complete or correct.
The limitations of this implementation are detailed below.
Please, read this document before using <code>org.apache.xerces.dom3</code> package.
</p>
</s2>
<s2 title="Introduction">
<p>
The &ParserNameLong; &ParserVersion; contains an implementation of a subset of the W3C DOM Level 3 as
specified in <jump
href="http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010913/">Core</jump>, <jump
href="http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025/abstract-schemas.html">Abstract
Schemas</jump> and <jump
href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025/load-save.html'>Load
and Save</jump>.
</p>
<note>DOM Level 3 interfaces are located in org.apache.xerces.dom3 package</note>
</s2>
<s2 title='Implementation of DOM Level 3 Core'>
<note>
To be able to use DOM Level 3 Core functionality, you will need to cast to Xerces implementation (e.i. DocumentImpl, NodeImpl).
</note>
<ul>
<li>
<code>DOMImplementationRegistry</code> (see <code>DOMImplementationSource</code>)
</li>
<li>
<code>Document</code>: set/getEncoding, set/getVersion, set/getStandalone, adoptNode.
</li>
<li>
<code>Node</code>: isSameNode
</li>
<li>
<code>Node</code>: getInterface
</li>
<li>
<code>Node</code>: set/getUserData
</li>
<li>
<code>Node</code>: isEqualNode()
</li>
<li>
<code>DOMErrorHandler</code>, <code>DOMError</code>, <code>DOMLocator</code>
</li>
<li>
<code>Entity</code>: set/getEncoding, set/getVersion
</li>
</ul>
</s2>
<s2 title='Implementation of DOM Level 3 Load and Save'>
<ul>
<li>
<code>DOMBuilder</code>: does not provide implementation of parseWithContext() and <code>DOMBuilderFilter</code>.
</li>
<li>
<code>DOMWriter</code>: supports all required features and setting <code>format-pretty-print</code> feature to true.
<code>DOMWriter</code> fixes namespaces during serialization.
</li>
<li>
<code>DOMInputSource</code>
</li>
<li>
<code>DocumentLS</code>
</li>
<li>
<code>DOMImplementationLS</code>
</li>
</ul>
</s2> <s2 title='Implementation of DOM Level 3 Abstract Schemas'>
<note>Xerces does not provide implementation for editing schemas (AS-EDIT) nor we provide implementation
for "Document-editing"</note>
<ul>
<li>
<code>DOMImplementationAS</code>
</li>
<li>
<code>DOMASBuilder</code> supports parsing of XML Schemas and setting the <code>ASModel</code> on the parser.
</li>
</ul>
<note>
<code>DOMASBuilder</code> does not support parsing of DTDs.
The parser provides only partial implementation for <code>ASModel</code>.
For more information on how to parse schemas and set those on the parser instance, see <code>dom.ASBuilder</code> sample.
</note>
</s2></s1>
1.1 xml-site/sources/xerces2-j/faq-build.xml
Index: faq-build.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Building and Running FAQs'>
<faq title='Swing version?'>
<q>Which version of Swing is required?</q>
<a>
<p>
This release uses Swing 1.1 (JFC 1.1). Swing is only used by
the sample programs and is not required by the parser itself.
</p>
</a>
</faq>
<faq title='Recompling source files?'>
<q>How do I recompile the source files?</q>
<a>
<p>
To build &ParserName; you need the Java Development
Kit (JDK) version 1.2 (or higher) installed on your machine.
The actual build is performed by the Ant program which is
written in Java and is a subproject of the Apache
<jump href='http://jakarta.apache.org/'>Jakarta</jump>
project. The build also requires a few other tools but
all of the tools you need (including Ant) are contained
in the <ref>&ParserName;-tools.&parserversion;.zip</ref>
file, packaged separately. Go to the &ParserName;
<jump href='http://xml.apache.org/dist/xerces-j/'>download</jump>
page to download the tools package and then extract it in the
same location as the source package.
</p>
<p>
Once you have extracted both the source and tools packages
in the same directory, you can invoke a build by either
using the "build.bat" file for Windows platforms or the
"build.sh" file for UNIX platforms. Before invoking either
one of these scripts, though, be sure to set the JAVA_HOME
environment variable to the installed location of your JDK.
</p>
<p>
The script will invoke the Ant build program for you which
displays the list of allowed build targets. To only compile
the source files, type "build compile" (on Windows platforms)
at the command line in the directory where you extracted
&ParserName;; to build the Jar files, type "build jars"; and
to build everything, including documentation, type "build
all".
</p>
</a>
</faq>
<faq title='Regenerating API documention?'>
<q>How do I regenerate the api documentation?</q>
<a>
<p>
To regenerate the api documentation, you need to set up
your environment to build &ParserName;. Instead of typing
"build all", you type "build javadocs".
</p>
</a>
</faq>
<faq title="How do I use Visual Age?">
<q>How do I import &ParserName; into Visual Age for Java</q>
<a>
<ul>
<li>
Why does VisualAge for Java 2.0 report problems when I import
the &ParserName; parser?
<br/>
The current version of the &ParserName; parser uses Swing
1.1, while VisualAge for Java 2.0 comes with Swing 1.0.2. The
free update for the Professional version of VisualAge for Java
2.0 installs Swing 1.0.3. The most important difference between
Swing 1.0.2 - 1.0.3 and 1.1 is the Java package was changed
from com.sun.java.swing.* to javax.swing.*.
<br/>
To fix the errors, you must download the Java Foundation Classes
1.1 with Swing 1.1 from Sun's Java home page and import the
"swingall.jar" file into VisualAge for Java 2.0. The
Swing 1.1 package can be found at the following URL:
<br/>
<jump href="http://java.sun.com/products/jfc/index.html">http://java.sun.com/products/jfc/index.html</jump>
<br/>
Refer to the VisualAge for Java 2.0 documentation for information
about how to import a JAR file into the repository and add that
code to your workspace.
</li>
<li>
Are there any other tips for importing the &ParserName;
parser into VisualAge for Java 2.0?
<br/>
The most useful tip applies to <em>any</em> updated code that you
import into the VisualAge for Java 2.0 product. Before updating
code, do the following:
<br/>
1. version the old code
<br/>
2. delete it from your workspace
<br/>
3. import the new code
<br/>
Deleting code from your workspace does not actually delete
the code permanently - the versioned code is moved to the
repository where it can be retrieved later. Be aware, though,
that removing code from your workspace will cause problems with
all of the other classes that use that code. VisualAge for Java
2.0 will flag them as errors but this situation is temporary.
When you import the new code, the errors found when deleting the
old code will be fixed.
<br/>
If you are unsure as to how to perform any of these steps, refer
to the VisualAge for Java 2.0 documentation.
</li>
</ul>
</a>
</faq>
<!--
- REVISIT: This needs to be re-run and re-verified before we
- put this FAQ item back in.
<faq title='100% Pure Java compliant?'>
<q>Is this &ParserName; version 100% pure Java compliant?</q>
<a>
<p>
Running JavaPureCheck on the &ParserName; parser code indicated 339
pure Java classes, 9 warnings, and 0 errors. The nine warnings are
enumerated below with explanations. To see the entire report, click
<link idref="jpc">here</link>.
</p>
<p>
There are many common cases where JavaPureCheck issues warnings
even though the code is pure Java. These are the most common
reasons:
</p>
<ol>
<li>
Warning: method reference:
<code>java.lang.Class.forName(java.lang.String)</code>
<br/>
This warning is issued in the following two cases:
</li>
<ol>
<li>
Program code calls the <code>Class.forName(String)</code>
method to dynamically load a class file. In this situation,
the specified class may contain impure Java code. In the
cases where this method is called directly in the parser
code, an explanation is provided detailing why this warning
can be ignored.
</li>
<li>
Program code makes direct reference to an object's
class. For example: <code>Class stringClass = String.class;</code>.
In this situation the Java compiler converts
<code>String.class</code> to the method call
<code>Class.forName("java.lang.String")</code>.
As long as the object whose class is being referenced is
pure Java, the code making the reference remains pure.
</li>
</ol>
<li>
Warning: possible hard-coded path: ...
<br/>
When a String literal contains a common path separator character
(e.g. '/' or '\'), JavaPureCheck assumes that
it is a hard-coded path and that the class may not contain
portable code. While a human tester can verify that the string is
not a path, JavaPureCheck must be conservative and issue a
warning.
</li>
</ol>
<p>Explanations:</p>
<ul>
<li>Class: org.xml.sax.helpers.ParserFactory</li>
<ul>
<li>
Warning: method reference:
java.lang.Class.forName(java.lang.String)
</li>
</ul>
<ul>
<li>
Explanation: The ParserFactory class is part of the standard
SAX 1.0 distribution. The warning given that this class "may
load impure class" is correct - the ParserFactory class may
load impure Java class files. However, the purpose of this
utility class is to load parser classes by name and therefore
cannot dynamically check the pureness of parser classes loaded
in this fashion. Since the &ParserName; parser does not use this
method directly, it is not a problem that concerns the &ParserName;
parser.
</li>
</ul>
<li>Class: org.apache.xml.serialize.SerializerFactory</li>
<ul>
<li>
Warning: method reference:
java.lang.Class.forName(java.lang.String)
</li>
</ul>
<ul>
<li>
Explanation: The SerializerFactory supports querying a system
property to dynamically instantiate a serializer by class name.
However, all of the serializer classes provided in this
distribution are pure. The only way to load an impure
serializer is if the user provided an impure serializer
implementation.
</li>
</ul>
<li>Class: org.apache.xml.serialize.OutputFormat</li>
<ul>
<li>Warning: possible hard-coded path: text/xml</li>
</ul>
<ul>
<li>Warning: possible hard-coded path: text/plain</li>
</ul>
<ul>
<li>Warning: possible hard-coded path: application/pdf</li>
</ul>
<ul>
<li>Warning: possible hard-coded path: text/html</li>
</ul>
<ul>
<li>
Warning: possible hard-coded path:
-//W3C//DTD XHTML 1.0 Strict//EN
</li>
</ul>
<ul>
<li>Explanation: These strings are not filenames.</li>
</ul>
<li>Class: org.apache.xml.serialize.HTMLdtd</li>
<ul>
<li>
Warning: method reference:
java.lang.Class.forName(java.lang.String)
</li>
</ul>
<ul>
<li>Explanation: Referencing class object that is pure Java.</li>
</ul>
<li>Class: org.apache.html.dom.HTMLDocumentImpl</li>
<ul>
<li>
Warning: method reference:
java.lang.Class.forName(java.lang.String)
</li>
</ul>
<ul>
<li>Explanation: Referencing class object that is pure Java.</li>
</ul>
<li>Class: org.apache.xerces.readers.StringReader</li>
<ul>
<li>
Warning: method reference:
java.lang.Class.forName(java.lang.String)
</li>
</ul>
<ul>
<li>Explanation: Referencing class object that is pure Java.</li>
</ul>
<li>Class: org.apache.xerces.parsers.DOMParser</li>
<ul>
<li>
Warning: method reference:
java.lang.Class.forName(java.lang.String)
</li>
</ul>
<ul>
<li>
Explanation: The DOMParser class allows the user to set the
DOM implemenation to use, by name. However, the default DOM
implementation is pure Java.
</li>
</ul>
<ul>
<li>Explanation: Referencing class object that is pure Java.</li>
</ul>
<li>Class: org.apache.xerces.utils.CharDataChunk</li>
<ul>
<li>
Warning: method reference:
java.lang.Class.forName(java.lang.String)
</li>
</ul>
<ul>
<li>Explanation: Referencing class object that is pure Java.</li>
</ul>
<li>Class: org.apache.xerces.utils.UTF8DataChunk</li>
<ul>
<li>
Warning: method reference:
java.lang.Class.forName(java.lang.String)
</li>
</ul>
<ul>
<li>Explanation: Referencing class object that is pure Java.</li>
</ul>
</ul>
<p>
The results file of the JavaPureCheck can be viewed by clicking
<link idref="jpc">here</link>.
</p>
<note>
The samples were not checked with JavaPureCheck and are not
guaranteed to be pure Java. We reserve the right to write samples
in the future that are platform specific and therefore may not
pass as pure Java. The parser, however, will remain pure Java.
</note>
</a>
</faq>
-->
<faq title='Running on the Mac?'>
<q>How do I get &ParserName; to run on the Mac under MRJ?</q>
<a>
<p>
<em>Prerequisites</em> (available from
<jump href="http://developer.apple.com/java/">http://developer.apple.com/java/</jump>):
</p>
<ul>
<li>MRJ 2.1 (this is the most recent version of the JVM)</li>
<li>
MRJ SDK 2.1 (this is the most recent version of the Java
developer tools)
</li>
</ul>
<p>
<em>Instructions </em>(other variations would work also):
</p>
<ol>
<li>Download the .tar.gz file containing &ParserName;.</li>
<li>
Use Stuffit Expander(tm), Suntar, or some other Macintosh tool
that supports the .tar.gz format to expand the downloaded file.
</li>
<li>
JBindery, part of MRJ SDK 2.1, is used to create a double-clickable
Java application with the necessary configuration information built
in. It is analogous to writing a .bat or .sh script.
</li>
<li><em>To run the dom.DOMWriter example:</em></li>
<ol>
<li>Double click on JBindery to start it up.</li>
<li>Click on the Classpath panel.</li>
<li>
Click on the "Add .zip File" button and add both the
"xerces.jar" and "xercesSamples.jar" files.
</li>
<li>Click on the Command panel.</li>
<li>
Enter "dom.Writer" as the Class name. Enter
"data/personal.xml" in the Optional parameters box.
</li>
<li>
Click on Save Settings button, pick a name such as "Run
<code>dom.Writer</code>" for the file, and <em>be
sure</em> that "Save as Application" is selected
(this is the default) and save the file.
</li>
<li>Quit JBindery.</li>
<li>
You can now double click on the file you created in step (f) to
run the XJParse example.
</li>
</ol>
</ol>
</a>
</faq>
<faq title='Visual Cafe exception error?'>
<q>
Why do I get ArrayIndexOutOfBoundsException in the Symantec Visual
Cafe debugger?
</q>
<a>
<p>
The Visual Cafe debugger is set to trap
<code>ArrayIndexOutOfBoundsException</code> exceptions by
default. &ParserName; sometimes uses
<code>ArrayIndexOutOfBoundsException</code> internally to
signal exceptional, but not erroneous conditions. In order to
run &ParserName; inside Visual Cafe's debugger, you need to
turn off the trapping of these exceptions.
</p>
<p><em>To do this:</em></p>
<ol>
<li>Select the "Options" item in the "Project" menu.</li>
<li>
Select the "Debugger" tab in the dialog which appears.
</li>
<li>Select "Exceptions" from the popup menu.</li>
<li>
Remove the check from the checkbox for
<code>java.lang.ArrayIndexOutOfBoundsException</code>.
</li>
</ol>
</a>
</faq>
</faqs>
1.1 xml-site/sources/xerces2-j/faq-common.xml
Index: faq-common.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Common Problems FAQs'>
<faq title='Parsing HTML Generated an Error.'>
<q>
I tried to use &ParserName; to parse an HTML file and it
generated an error. What did I do wrong?
</q>
<a>
<p>
Unfortunately, HTML does not, in general, follow the XML
grammar rules. Most HTML files do not meet the XML style
quidelines. Therefore, the XML parser generates XML
well-formedness errors.
</p>
<p>Typical errors include:</p>
<ul>
<li>
Missing end tags, e.g. <P> with no </P> (end
tags are not required in HTML)
</li>
<li>
Missing closing slash on <IMG HREF="foo" <em>/</em>>
(not required in HTML)
</li>
<li>
Missing quotes on attribute values, e.g. <IMG width="600">
(not generally required in HTML)
</li>
</ul>
<p>
HTML must match the XHTML standard for well-formedness before it
can be parsed by &ParserName; or any other XML parser. You can
find the
<jump href="http://www.w3c.org/TR/1999/PR-xhtml1-19991210">XHTML
standard</jump> on the
<jump href="http://www.w3c.org">W3C web site</jump>.
</p>
</a>
</faq>
<faq title='UTF-8 Character Error'>
<q>I get an "invalid UTF-8 character" error.</q>
<a>
<p>
There are many Unicode characters that are not allowed in an
XML document, according to the XML spec. Typical disallowed
characters are control characters, even if you escape them
using the Character Reference form: &#xxxx; . See the XML
spec, sections
<jump href="http://www.w3.org/TR/REC-xml#charsets">2.2</jump>
and
<jump href="http://www.w3.org/TR/REC-xml#sec-references">4.1</jump>
for details. If the parser is generating this error, it is very
likely that there is a character in the file that you can not see.
You can generally use a UNIX command like "od -hc" to
find it.
</p>
</a>
</faq>
<faq title='Error Accessing EBCDIC XML Files'>
<q>
I get an error when I access EBCDIC XML files, what is happening?
</q>
<a>
<p>
If an XML document/file is not UTF-8, then you MUST specify the
encoding. When transcoding a UTF8 document to EBCDIC, remember
to change this:
</p>
<ul>
<li>
<?xml version="1.0" encoding="UTF-8"?>
<br/>
to something like this:
<br/>
<?xml version="1.0" encoding="ebcdic-cp-us"?>
</li>
</ul>
</a>
</faq>
<faq title='EOF Character Error'>
<q>
I get an error on the EOF character (0x1A) -- what is happening?
</q>
<a>
<p>
You are probably using the <em>LPEX</em> editor, which
automatically inserts an End-of-file character (0x1A) at the end
of your XML document (other editors might do this as well).
Unfortunately, the EOF character (0x1A) is an illegal character
according to the XML specification, and &ParserName;
correctly generates an error.
</p>
</a>
</faq>
</faqs>
1.1 xml-site/sources/xerces2-j/faq-general.xml
Index: faq-general.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='General FAQs'>
<faq title="Jar file changes">
<q>What happened to xerces.jar</q>
<a>
<p>In order to take advantage of the fact that this parser is
very often used in conjunction with other XML technologies,
such as XSLT processors, which also rely on standard
API's like DOM and SAX, xerces.jar was split into two
jarfiles:
</p>
<ul>
<li><code>xmlParserAPIs.jar</code> contains the DOM level 2,
SAX 2.0 and JAXP 1.1 API's;</li>
<li><code>xercesImpl.jar</code> contains the implementation of
these API's as well as the XNI API.
</li>
</ul>
<p>For backwards compatibility, we have retained the ability
to generate xerces.jar. For instructions, see <link
idref="install">the installation documentation</link>.
</p>
</a>
</faq>
<faq title='Validation against DTD'>
<q>How do I turn on DTD validation?</q>
<a>
<p>
You can turn validation on and off via methods available
on the SAX2 <code>XMLReader</code> interface. While only the
<code>SAXParser</code> implements the <code>XMLReader</code>
interface, the methods required for turning on validation
are available to both parser classes, DOM and SAX.
<br/>
The code snippet below shows how to turn validation on -- assume
that <ref>parser</ref> is an instance of either
<code>org.apache.xerces.parsers.SAXParser</code> or
<code>org.apache.xerces.parsers.DOMParser</code>.
<br/><br/>
<code>parser.setFeature("http://xml.org/sax/features/validation", true);</code>
</p>
</a>
</faq>
<faq title='IDs and XML Schemas'>
<q>Why does getElementById() not always work for documents validated against XML Schemas?</q>
<a>
<p>According to the XML Schema specification, an instance document might have
more than one <jump href="http://www.w3.org/TR/xmlschema-1/#key-vr">validation root</jump> and
<jump href="http://www.w3.org/TR/xmlschema-1/#cvc-id">ID/IDREFS</jump> must be
unique only within the context of a particular validation root, meaning that a
document may potentially contain multiple identical ids. In this case, the output
of getElementById() is unspecified. On the other hand, if the document root is
a validation root of the document, getElementById() should work as expected.
</p>
</a>
</faq>
<faq title='PSVI'>
<q>How do I get access to the PSVI?</q>
<a>
<p>Xerces provides a sample component PSVIWriter that intercepts document
handler events and collects PSVI information. For more information read <link
idref="samples-xni">samples documentation</link> on how to use xni.parser.PSVIParser
and xni.parser.PSVIConfiguration.
</p>
<note>Xerces only produces light-weight PSVI.</note>
</a>
</faq>
<faq title='International Encodings'>
<q>What international encodings are supported by &ParserName;?</q>
<a>
<ul>
<li>UTF-8</li>
<li>UTF-16 Big Endian, UTF-16 Little Endian</li>
<li>IBM-1208</li>
<li>ISO Latin-1 (ISO-8859-1)</li>
<li>
ISO Latin-2 (ISO-8859-2) [Bosnian, Croatian, Czech,
Hungarian, Polish, Romanian, Serbian (in Latin transcription),
Serbocroatian, Slovak, Slovenian, Upper and Lower Sorbian]
</li>
<li>ISO Latin-3 (ISO-8859-3) [Maltese, Esperanto]</li>
<li>ISO Latin-4 (ISO-8859-4)</li>
<li>ISO Latin Cyrillic (ISO-8859-5)</li>
<li>ISO Latin Arabic (ISO-8859-6)</li>
<li>ISO Latin Greek (ISO-8859-7)</li>
<li>ISO Latin Hebrew (ISO-8859-8)</li>
<li>ISO Latin-5 (ISO-8859-9) [Turkish]</li>
<li>Extended Unix Code, packed for Japanese (euc-jp, eucjis)</li>
<li>Japanese Shift JIS (shift-jis)</li>
<li>Chinese (big5)</li>
<li>Chinese for PRC (mixed 1/2 byte) (gb2312)</li>
<li>Japanese ISO-2022-JP (iso-2022-jp)</li>
<li>Cyrillic (koi8-r)</li>
<li>Extended Unix Code, packed for Korean (euc-kr)</li>
<li>Russian Unix, Cyrillic (koi8-r)</li>
<li>Windows Thai (cp874)</li>
<li>Latin 1 Windows (cp1252) (and all other cp125? encodings recognized by IANA)</li>
<li>cp858</li>
<li>EBCDIC encodings:</li>
<ul>
<li>EBCDIC US (ebcdic-cp-us)</li>
<li>EBCDIC Canada (ebcdic-cp-ca)</li>
<li>EBCDIC Netherland (ebcdic-cp-nl)</li>
<li>EBCDIC Denmark (ebcdic-cp-dk)</li>
<li>EBCDIC Norway (ebcdic-cp-no)</li>
<li>EBCDIC Finland (ebcdic-cp-fi)</li>
<li>EBCDIC Sweden (ebcdic-cp-se)</li>
<li>EBCDIC Italy (ebcdic-cp-it)</li>
<li>EBCDIC Spain, Latin America (ebcdic-cp-es)</li>
<li>EBCDIC Great Britain (ebcdic-cp-gb)</li>
<li>EBCDIC France (ebcdic-cp-fr)</li>
<li>EBCDIC Hebrew (ebcdic-cp-he)</li>
<li>EBCDIC Switzerland (ebcdic-cp-ch)</li>
<li>EBCDIC Roece (ebcdic-cp-roece)</li>
<li>EBCDIC Yugoslavia (ebcdic-cp-yu)</li>
<li>EBCDIC Iceland (ebcdic-cp-is)</li>
<li>EBCDIC Urdu (ebcdic-cp-ar2)</li>
<li>Latin 0 EBCDIC</li>
<li>EBCDIC Arabic (ebcdic-cp-ar1)</li>
</ul>
</ul>
<note>UCS-4 is not yet supported, but it is hoped that support will be available soon.</note>
</a>
</faq>
</faqs>
1.1 xml-site/sources/xerces2-j/faq-pcfp.xml
Index: faq-pcfp.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Parser Configuration and Validation'>
<faq title='Validation and infoset augmentation'>
<q>What's the result of having a DTD validator or XML Schema validator in the pipeline?</q>
<a>
<p>
If a validator is included in the pipeline, the assessment is
done, whether the validation feature is set to true or false.
The validation feature only enables the validation constraint error reporting and it does not control the infoset augmentation: if a validator is included in the pipeline the parser will augment the infoset according to the grammar specified for the instance document.
</p>
</a>
</faq>
<faq title='Default Parser Configuration'>
<q>What validation behavior do I expect from the default parser configuration?</q>
<a>
<p>
The default configuration (StandardParserConfiguration) includes the DTD validator
and the Namespace binder. Thus, the <link idref='features' anchor="validation">
validation feature</link> will enable validation against a DTD only.
To allow validation against XML Schemas you must turn on the <link
idref='features' anchor="validation">validation feature</link> and the
<link idref='features' anchor="validation.schema">schema feature</link>, and
XML Schema Validator will be inserted in the pipeline.
If you've created your own configuration which does not extend StandardParserConfiguration,
you must make sure that your configuration inserts all needed validators in the pipeline.
</p>
</a>
</faq>
<faq title='Validation Features'>
<q>What happens if I set both validation and schema validation features on?</q>
<a>
<p>
If both validators are present in the pipeline (this is the default behavior), then
</p>
<ul>
<li>if the instance document has only a DTD grammar
(DOCTYPE before the root element), then only DTD
validation errors are reported;</li>
<li>if the instance document has only XML Schema grammars,
then only XML Schema validation errors are reported</li>
<li>if the instance document has both DTD and XML Schema
grammars, validation errors for both DTD and XML
Schema are reported;</li>
<li>if no grammar can be found for the instance document,
the last validator in the pipeline will report validation errors.
</li>
</ul>
<p>
An application may choose to create a configuration that does not have a DTD
validator but has an XML Schema validator. This will turn Xerces into a
non-compliant processor according to XML 1.0 and XML Schema specifications,
thus the validation/augmentation outcome is undefined.
</p>
</a>
</faq>
<faq title='Validation against a specific schema language'>
<q>How can I tell the parser to validate against XML Schema and not to report DTD validation errors?</q>
<a>
<p>
Currently this is impossible. We hope that JAXP 1.2 will provide this capability
via its schema language property. Otherwise, we might introduce a Xerces
language property that will allow specifying the language against which validation will occur.
</p>
</a>
</faq>
</faqs>
1.1 xml-site/sources/xerces2-j/faq-performance.xml
Index: faq-performance.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Performance FAQs'>
<faq title='General Performance'>
<q>General Performance</q>
<a>
<p>
Don't use XML where it doesn't make sense. XML is not a panacea.
You will not get good performance by transferring and parsing a
lot of XML files.
</p>
<p>Using XML is memory, CPU, and network intensive.</p>
</a>
</faq>
<faq title='Parser Performance'>
<q>Parser Performance</q>
<a>
<p>
Avoid creating a new parser each time you parse; reuse parser
instances. A pool of reusable parser instances might be a good idea
if you have multiple threads parsing at the same time.
</p>
<p>
The parser configuration will affect the performance of the parser.
If you are interested in evaluating the parser performance with DTDs use the StandardParserConfiguration (Note: this is the default parser configuration).
For testing the performance for XML Schema evaluation turn on the schema validation feature (this will insert the XML Schema Validator in the pipeline).
</p>
</a>
</faq>
<faq title='Parsing Documents Performance'>
<q>Parsing Documents Performance</q>
<a>
<p>
There are a variety of things that you can do to improve the
performance when parsing documents:
</p>
<ul>
<li>
Convert the document to US ASCII ("US-ASCII") or Unicode
("UTF-8" or "UTF-16") before parsing. Documents written using
ASCII are the fastest to parse because each character is
guaranteed to be a single byte and map directly to their
equivalent Unicode value. For documents that contain Unicode
characters beyond the ASCII range, multiple byte sequences
must be read and converted for each character. There is a
performance penalty for this conversion. The UTF-16 encoding
alleviates some of this penalty because each character is
specified using two bytes, assuming no surrogate characters.
However, using UTF-16 can roughly double the size of the
original document which takes longer to parse.
</li>
<li>
Explicitly specify "US-ASCII" encoding if your document is in
ASCII format. If no encoding is specified, the XML specification
requires the parser to assume UTF-8 which is slower to process.
</li>
<li>
Avoid external entities and external DTDs. The extra file
opens and transcoding setup is expensive.
</li>
<li>
Reduce character count; smaller documents are parsed quicker.
Replace elements with attributes where it makes sense. Avoid
gratuitous use of whitespace because the parser must scan past it.
</li>
<li>
Avoid using too many default attributes. Defaulting attribute
values slows down processing.
</li>
</ul>
</a>
</faq>
<faq title='XML Application Performance'>
<q>XML Application Performance</q>
<a>
<ul>
<li>If you don't need validation (and infoset augmentation) of XML documents, don't include validators (DTD or XML Schema) in the pipeline. Including the validator components in the pipeline will result in a performance hit for your application: if a validator component is present in the pipeline, Xerces will try to augment the infoset even if the validation feature is set to false.
If you are only interested in validating against DTDs don't include XML Schema validator in the pipeline.
</li>
<li> If you don't need validation, avoid using a DOCTYPE line in your XML document.
The current version of the parser will always read the DTD if the DOCTYPE line
is specified even when validation feature is set to false.
</li>
<li>
By default, the DOM feature defer-node-expansion is true, causing DOM nodes to
be expanded as the tree is traversed.
This allows the parser to return
a document faster than if the tree is fully expanded during parsing and
improves memory usage when the whole tree is not traversed.
If memory usage using DOM is still a concern, SAX should be considered;
the SAX parser uses very little memory and notifies the
application as parts of the document are parsed.
</li>
</ul>
</a>
</faq>
</faqs>
1.1 xml-site/sources/xerces2-j/faq-write.xml
Index: faq-write.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Writing Application FAQs'>
<faq title='Creating a DOM Parser'>
<q>How do I create a DOM parser?</q>
<a>
<p>
You can create a DOM parser by using the Java APIs for
XML Processing (JAXP). The following source code shows
how:
</p>
<source>import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
...
String xmlFile = "file:///&parserdir;/data/personal.xml";
try {
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(xmlFile);
}
catch (FactoryConfigurationError e) {
// unable to get a document builder factory
}
catch (ParserConfigurationException e) {
// parser was unable to be configured
catch (SAXException e) {
// parsing error
}
catch (IOException e) {
// i/o error
}</source>
</a>
</faq>
<faq title="Creating a SAX Parser">
<q>How do I create a SAX parser?</q>
<a>
<p>
You can create a SAX parser by using the Java APIs for
XML Processing (JAXP). The following source code shows
how:
</p>
<source>
import java.io.IOException;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
...
String xmlFile = "file:///&parserdir;/data/personal.xml";
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
DefaultHandler handler = /* custom handler class */;
parser.parse(xmlFile, handler);
}
catch (FactoryConfigurationError e) {
// unable to get a document builder factory
}
catch (ParserConfigurationException e) {
// parser was unable to be configured
catch (SAXException e) {
// parsing error
}
catch (IOException e) {
// i/o error
}</source>
</a>
</faq>
<!--
- REVISIT: make sure that JAXP implementation can handle
- passing features and properties through to the
- parser implementation. Then complete this section.
<faq title='Controlling parser options'>
<q>How do I control the various parser options?</q>
<a>TBD</a>
</faq>
-->
<faq title='Handling Errors'>
<q>How do handle errors?</q>
<a>
<p>
You should register an error handler with the parser by supplying
a class which implements the <code>org.xml.sax.ErrorHandler</code>
interface. This is true regardless of whether your parser is a
DOM based or SAX based parser.
</p>
<p>
You can register an error handler on a <code>DocumentBuilder</code>
created using JAXP like this:
</p>
<source>import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
ErrorHandler handler = new ErrorHandler() {
public void warning(SAXParseException e) throws SAXException {
System.err.println("[warning] "+e.getMessage());
}
public void error(SAXParseException e) throws SAXException {
System.err.println("[error] "+e.getMessage());
}
public void fatalError(SAXParseException e) throws SAXException {
System.err.println("[fatal error] "+e.getMessage());
throw e;
}
};
DocumentBuilder builder = /* builder instance */;
builder.setErrorHandler(handler);</source>
<p>
You can also register an error handler on a SAXParser using JAXP
like this:
</p>
<source>import javax.xml.parsers.SAXParser;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
ErrorHandler handler = new ErrorHandler() {
public void warning(SAXParseException e) throws SAXException {
System.err.println("[warning] "+e.getMessage());
}
public void error(SAXParseException e) throws SAXException {
System.err.println("[error] "+e.getMessage());
}
public void fatalError(SAXParseException e) throws SAXException {
System.err.println("[fatal error] "+e.getMessage());
throw e;
}
};
SAXParser parser = /* parser instance */;
parser.getXMLReader().setErrorHandler(handler);</source>
</a>
</faq>
<faq title='Controlling Entity Representation'>
<q>
How can I control the way that entities are represented in the DOM?
</q>
<a>
<p>
The DOM Level 3 feature <code>create-entity-ref-nodes</code> (or corresponding Xerces <code>http://apache.org/xml/features/dom/create-entity-ref-nodes</code> feature)
control how entities appear in the DOM tree. When one of those features
is set to true (the default), an occurance of an entity reference
in the XML document will be represented by a subtree with an
EntityReference node at the root whose children represent the
entity expansion.
</p>
<p>
If the feature is false, an entity reference in the XML document
is represented by only the nodes that represent the entity
expansion.
</p>
<p>
In either case, the entity expansion will be a DOM tree
representing the structure of the entity expansion, not a text
node containing the entity expansion as text.
</p>
</a>
</faq>
<faq title='What does "non-validating" mean?'>
<q>
Why does "non-validating" not mean "well-formedness
checking only"?
</q>
<a>
<p>
Using a "non-validating" parser does not mean that
only well-formedness checking is done! There are still many
things that the XML specification requires of the parser,
including entity substitution, defaulting of attribute values,
and attribute normalization.
</p>
<p>
This table describes what "non-validating" really
means for &ParserName; parsers. In this table, "no DTD"
means no internal or external DTD subset is present.
</p>
<table>
<tr>
<tn/>
<th colspan="2">non-validating parsers</th>
<th colspan="2">validating parsers</th>
</tr>
<tr>
<tn/>
<th>DTD present</th>
<th>no DTD</th>
<th>DTD present</th>
<th>no DTD</th>
</tr>
<tr>
<th>DTD is read</th>
<td>Yes</td>
<td>No</td>
<td>Yes</td>
<td>Error</td>
</tr>
<tr>
<th>entity substitution</th>
<td>Yes</td>
<td>No</td>
<td>Yes</td>
<td>Error</td>
</tr>
<tr>
<th>defaulting of attributes</th>
<td>Yes</td>
<td>No</td>
<td>Yes</td>
<td>Error</td>
</tr>
<tr>
<th>attribute normalization</th>
<td>Yes</td>
<td>No</td>
<td>Yes</td>
<td>Error</td>
</tr>
<tr>
<th>checking against model</th>
<td>No</td>
<td>No</td>
<td>Yes</td>
<td>Error</td>
</tr>
</table>
</a>
</faq>
<faq title='Associating Data with a Node'>
<q>How do I associate my own data with a node in the DOM tree?</q>
<a>
<p>
The class <code>org.apache.xerces.dom.NodeImpl</code> provides a
<code>void setUserData(Object o)</code> and an <code>Object
getUserData()</code> method that you can use to attach any object
to a node in the DOM tree.
</p>
<p>
Beware that you should try and remove references to your data on
nodes you no longer use (by calling <code>setUserData(null)</code>,
or these nodes will not be garbage collected until the entire
document is garbage collected.
</p>
</a>
</faq>
<faq title='Parsing Several Documents'>
<q>
How do I more efficiently parse several documents sharing a
common DTD?
</q>
<a>
<p>
DTDs are not currently cached by the parser. The common DTD,
since it is specified in each XML document, will be re-parsed
once for each document.
</p>
<p>
However, there are things that you can do now, to make the
process of reading DTD's more efficient:
</p>
<ul>
<li>keep your DTD and DTD references local</li>
<li>use internal DTD subsets, if possible</li>
<li>load files from server to local client before parsing</li>
<li>
Cache document files into a local client cache. You should do an
HTTP header request to check whether the document has changed,
before accessing it over the network.
</li>
<li>
Do not reference an external DTD or internal DTD subset at all.
In this case, no DTD will be read.
</li>
<li>
Use a custom <code>EntityResolver</code> and keep common
DTDs in a memory buffer.
</li>
</ul>
</a>
</faq>
<!--
- REVISIT: Rewrite this section with better information.
<faq title='How do I read data from a stream as it arrives?'>
<q>How do I read data from a stream as it arrives?</q>
<a>
<p>There are 2 problems you have to deal with:</p>
<ol>
<li>
The Apache parsers terminate when they reach end-of-file; with
a data stream, unless the sender drops the socket, you have no
end-of-file, so you need to terminate in some other way
</li>
<li>
The Apache parsers close the input stream on termination, and
this closes the socket; you normally don't want this, because
you'll want to send an ack to the data stream source, and you
may want to have further exchanges on the socket anyway.
</li>
</ol>
<p>Terminating the parse</p>
<p>
One way that works forSAX is to throw an exception when you
detect the logical end-of-document.
</p>
<p>
For instance, in your class extending DefaultHandler, you can
have:
</p>
<source>public class DocProcessor extends DefaultHandler {
private int level;
.
.
public void startElement(String uri,
String localName,
String raw,
Attributes attrs) throws SAXException
{
++level;
}
public void endElement (String namespaceURI,
String localName,
String qName) throws SAXException
{
level = level - 1;
if (level == 0) {
throw new SAXException ("Finished");
}
}</source>
<p>Preventing the parser from closing the socket</p>
<p>
One way is to subclass BufferedReader to provide an empty close
method. So, invoke the parser as follows:
</p>
<source>Socket socket;
// code to set the socket
parser.parse(new InputSource(new MyBufferedReader(new InputStreamReader(socket.getInputStream()))));
.
.
class MyBufferedReader extends BufferedReader
{
public MyBufferedReader(InputStreamReader i) {
super(i);
}
public void close() {
}
}</source>
</a>
</faq>
-->
</faqs>
1.1 xml-site/sources/xerces2-j/faq-xni.xml
Index: faq-xni.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Xerces Native Interface FAQs'>
<faq title="Augmentations">
<q>What are all these strange "Augmentations" parameters I see in so many methods?</q>
<a>
<p> They're intended to provide a way to augment the
basic XML infoset available from the non-Augmentation
parameters in the callbacks. They can be used by a component to add arbitrary
information to the streaming infoseet, which can then
be interpreted by some later component.</p>
<p> For instance, a component can be written to transmit the
post schema validation infoset through Augmentations
callbacks. This can then be translated into an XML
representation. This is exactly what is done in the PSVI
Writer and PSVI Configuration samples--see <link
idref="samples-xni">XNI sample documentation</link> for
details.</p>
</a>
</faq>
<faq title='Overriding Default Parser Configuration'>
<q>How do I change the default parser configuration?</q>
<a>
<p>
It is possible to override the default parser configuration used
by the Xerces2 parsers without writing any code or changing the
existing parser classes. Moreover, the DOM and SAX parsers created
using the JAXP interfaces will use the specified parser configuration
transparently and without need to call additional methods to set the
parser configuration.
</p>
<p>
The DOM and SAX parsers decide which parser configuration to use in
the following order:
</p>
<ol>
<li>
First, the <code>org.apache.xerces.xni.parser.XMLParserConfiguration</code>
file is requested from the <code>META-INF/services/</code> directory.
This file contains the class name of the parser configuration.
</li>
<li>
Next, the <code>org.apache.xerces.xni.parser.XMLParserConfiguration</code>
system property is queried for the class name of the parser configuration.
</li>
<li>
Finally, the <code>org.apache.xerces.parsers.StandardParserConfiguration</code>
is used as the default parser configuration.
</li>
</ol>
<note>
In all cases, the parser configuration class must have a public,
no argument constructor so that it can be instantiated dynamically.
</note>
<p>
When using Java 2, it is not necessary to rebuild the Xerces jar files
in order to override the default parser configuration using the first
method. As long as a JAR file containing the appropriate file exists
in the <code>META-INF/services/</code> directory appears <em>before</em>
the Xerces JAR files, the parser will use the new parser configuration.
</p>
<p>
The second method can always be used on the command line for the JVM
by using the <code>-D</code> option. For example, to override the
default parser configuration using a custom configuration named
<code>MyConfig</code>, use the following command line:
</p>
<source>java -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=MyConfig application_class</source>
</a>
</faq>
</faqs>
1.1 xml-site/sources/xerces2-j/features.xml
Index: features.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE features SYSTEM 'dtd/settings.dtd'>
<features>
<desc name='Setting Features'>
<p>
If you have created a DOM document builder or a SAX parser using
the JAXP interfaces, you may have difficulty setting features and
properties directly using those interfaces. The following
instructions tell you how to set features on document builders
and SAX parsers created from the JAXP interfaces.
</p>
<p>
The DocumentBuilderFactory interface contains a
<code>setAttribute(String,Object)</code> method which <em>may</em>
provide a means to set features and properties on the underyling
parser. However, it cannot be relied upon. Therefore, you must
use the Xerces DOMParser object directly. For example:
</p>
<source>import org.apache.xerces.parsers.DOMParser;
import org.xml.sax.SAXException;
DOMParser parser = new DOMParser();
try {
parser.setFeature("http://xml.org/sax/features/allow-java-encodings",
true);
}
catch (SAXException e) {
System.err.println("could not set parser feature");
}</source>
<p>
Using the SAXParser interface in JAXP is better because you can
query the underlying XMLReader implementation directly and that
interface contains methods to set and query features and
properties. For example:
</p>
<source>import javax.xml.parsers.SAXParser;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
SAXParser parser = /* created from SAXParserFactory */;
XMLReader reader = parser.getXMLReader();
try {
reader.setFeature("http://xml.org/sax/features/allow-java-encodings",
true);
}
catch (SAXException e) {
System.err.println("could not set parser feature");
}</source>
</desc>
<fcategory name='General Features'>
<feature name='http://xml.org/sax/features/namespaces'
id='namespaces'>
<true>
Perform namespace processing: prefixes will be stripped off
element and attribute names and replaced with the corresponding
namespace URIs. By default, the two will simply be concatenated,
but the namespace-sep core property allows the application to
specify a delimiter string for separating the URI part and the
local part.
</true>
<false>Do not perform namespace processing.</false>
<default value='true'/>
<access parsing='read-only' not-parsing='read-write'/>
<note>
If the validation feature is set to true, then the document
must contain a grammar that supports the use of namespaces.
</note>
<see idref='namespace-prefixes'/>
<see idref='validation'/>
</feature>
<feature name='http://xml.org/sax/features/validation'
id='validation'>
<true>Validate the document and report validity errors.</true>
<false>Do not report validity errors.</false>
<default value='false'/>
<access parsing='read-only' not-parsing='read-write'/>
<note>
If this feature is set to true, the document must specify
a grammar. By default, validation will occur against DTD. For more information, please, refer to the <link idref='faq-pcfp'>FAQ</link>.
If this feature is set to false, and document specifies a grammar
that grammar might be parsed but no validation of the document contents
will be performed.
</note>
<see idref='validation.dynamic'/>
<see idref='namespaces'/>
<see idref='nonvalidating.load-external-dtd'/>
</feature>
<feature name='http://apache.org/xml/features/validation/dynamic'
id='validation.dynamic'>
<true>
The parser will validate the document only if a grammar is
specified.
</true>
<false>
Validation is determined by the state of the <ref>validation</ref>
feature.
</false>
<default value='false'/>
<see idref='validation'/>
</feature>
<feature name='http://apache.org/xml/features/validation/schema'
id='validation.schema'>
<true>Turn on XML Schema validation by inserting XML Schema validator in the pipeline.
</true>
<false>Do not report validation errors against XML Schema.</false>
<default value='false'/>
<access parsing='read-only' not-parsing='read-write'/>
<note> Validation errors will only be reported if <link anchor="validation">validation feature</link> is set to true. For more information, please, refer to the <link idref='faq-pcfp'>FAQ</link>
</note>
<see idref='validation'/>
<see idref='validation.dynamic'/>
<see idref='namespaces'/>
</feature>
<feature name='http://apache.org/xml/features/validation/schema-full-checking'
id='validation.schema-full-checking'>
<true>
Enable full schema grammar constraint checking, including checking
which may be time-consuming or memory intensive. Currently, particle
unique attribution constraint checking and particle derivation
resriction checking are controlled by this option.
</true>
<false>Disable full constraint checking.</false>
<default value='false'/>
<note>
This feature checks the Schema grammar itself for additional
errors that are time-consuming or memory intensive. It does
<strong>not</strong> affect the level of checking performed on
document instances that use Schema grammars.
</note>
</feature>
<feature name='http://apache.org/xml/features/validation/schema/normalized-value'
id='validation.schema.normalized-value'>
<true>Expose via SAX and DOM XML Schema normalized values for attributes and elements.
</true>
<false>Expose the infoset values</false>
<default value='true'/>
<access parsing='read-only' not-parsing='read-write'/>
<note> XML Schema normalized values will be exposed only if
both <link anchor="validation.schema">schema validation</link> and
<link anchor="validation">validation</link> features are set to true.
</note>
<see idref='validation'/>
<see idref='validation.schema'/>
<see idref='validation.schema.element-default'/>
</feature>
<feature name='http://apache.org/xml/features/validation/schema/element-default'
id='validation.schema.element-default'>
<true>Send XML Schema element default values via characters().
</true>
<false>Do not send XML Schema default values in XNI</false>
<default value='true'/>
<access parsing='read-only' not-parsing='read-write'/>
<note> XML Schema default values will be send via characters() if both <link anchor="validation.schema">schema validation</link> and
<link anchor="validation">validation</link> features are set to true.
</note>
<see idref='validation'/>
<see idref='validation.schema'/>
<see idref='validation.schema.normalized-value'/>
</feature>
<feature name='http://xml.org/sax/features/external-general-entities'
id='external-general-entities'>
<true>Include external general entities.</true>
<false>Do not include external general entities.</false>
<default value='true'/>
<access parsing='read-only' not-parsing='read-write'/>
<see idref='external-parameter-entities'/>
</feature>
<feature name='http://xml.org/sax/features/external-parameter-entities'
id='external-parameter-entities'>
<true>
Include external parameter entities and the external DTD subset.
</true>
<false>
Do not include external parameter entities or the external DTD subset.
</false>
<default value='true'/>
<access parsing='read-only' not-parsing='read-write'/>
<see idref='external-general-entities'/>
</feature>
<feature name='http://apache.org/xml/features/validation/warn-on-duplicate-attdef'
id='validation.warn-on-duplicate-attdef'>
<true>Report a warning when a duplicate attribute is re-declared.</true>
<false>
Do not report a warning when a duplicate attribute is re-declared.
</false>
<default value='false'/>
</feature>
<feature name='http://apache.org/xml/features/validation/warn-on-undeclared-elemdef'
id='validation.warn-on-undeclared-elemdef'>
<true>
Report a warning if an element referenced in a content model is
not declared.
</true>
<false>
Do not report a warning if an element referenced in a content model
is not declared.
</false>
<default value='false'/>
</feature>
<feature name='http://apache.org/xml/features/allow-java-encodings'
id='allow-java-encodings'>
<true>Allow Java encoding names in XMLDecl and TextDecl line.</true>
<false>
Do not allow Java encoding names in XMLDecl and TextDecl line.
</false>
<default value='false'/>
<note>
A true value for this feature allows the encoding of the file to
be specified as a Java encoding name as well as the standard ISO
encoding name. Be aware that other parsers may not be able to use
Java encoding names. If this feature is set to false, an error
will be generated if Java encoding names are used.
</note>
</feature>
<feature name='http://apache.org/xml/features/continue-after-fatal-error'
id='continue-after-fatal-error'>
<true>Attempt to continue parsing after a fatal error.</true>
<false>Stops parse on first fatal error.</false>
<default value='false'/>
<note>
The behavior of the parser when this feature is set to
<code>true</code> is <strong>undetermined</strong>! Therefore use
this feature with extreme caution because the parser may get stuck
in an infinite loop or worse.
</note>
</feature>
<feature name='http://apache.org/xml/features/nonvalidating/load-dtd-grammar'
id='nonvalidating.load-dtd-grammar'>
<true>
Load the DTD and use it to add default attributes and set attribute
types when parsing.
</true>
<false>
Build the grammar but do not use the default attributes and attribute
types information it contains.
</false>
<default value='true'/>
<note>This feature is always on when validation is on.</note>
<see idref='validation'/>
<see idref='nonvalidating.load-external-dtd'/>
</feature>
<feature name='http://apache.org/xml/features/nonvalidating/load-external-dtd'
id='nonvalidating.load-external-dtd'>
<true>Load the external DTD.</true>
<false>Ignore the external DTD completely.</false>
<default value='true'/>
<note>This feature is always on when validation is on.</note>
<see idref='validation'/>
<see idref='nonvalidating.load-dtd-grammar'/>
</feature>
</fcategory>
<fcategory name='DOM Features'>
<feature name='http://apache.org/xml/features/dom/defer-node-expansion'
id="dom.defer-node-expansion">
<true>
Lazily expand the DOM nodes.
</true>
<false>
Fully expand the DOM nodes.
</false>
<default value='true'/>
<note>
<!--
This feature only applies when the <link idref="properties"
anchor="document-class-name">http://apache.org/xml/properties/dom/document-class-name</link>
property is set to a value other than the name of the default document
factory.
-->
When this feature is set to true, the DOM nodes in the returned document
are expanded as the tree is traversed. This allows the parser to return a
document faster than if the tree is fully expanded during parsing and
improves memory usage when the whole tree is not traversed.
</note>
</feature>
<feature name='http://apache.org/xml/features/dom/create-entity-ref-nodes'
id='dom.create-entity-ref-nodes'>
<true>
Create <code>EntityReference</code> nodes in the DOM tree. The
<code>EntityReference</code> nodes and their child nodes will be
read-only.
</true>
<false>
Do not create <code>EntityReference</code> nodes in the DOM tree.
No <code>EntityReference</code> nodes will be created, only the
nodes corresponding to their fully expanded sustitution text will
be created.
</false>
<default value='true'/>
<note>
This feature only affects the appearance of <code>EntityReference</code>
nodes in the DOM tree. The document will always contain the entity
reference child nodes.
</note>
</feature>
<feature name='http://apache.org/xml/features/dom/include-ignorable-whitespace'
id='dom.include-ignorable-whitespace'>
<true>
Include text nodes that can be considered "ignorable whitespace" in
the DOM tree.
</true>
<false>Do not include ignorable whitespace in the DOM tree.</false>
<default value='true'/>
<note>
The only way that the parser can determine if text is ignorable
is by reading the associated grammar and having a content model for
the document. When ignorable whitespace text nodes are included in
the DOM tree, they will be flagged as ignorable. The ignorable flag
can be queried by calling the
<code>TextImpl#isIgnorableWhitespace():boolean</code> method.
</note>
</feature>
</fcategory>
<fcategory name='SAX Features'>
<feature name='http://xml.org/sax/features/namespace-prefixes'
id='namespace-prefixes'>
<true>
Report the original prefixed names and attributes used for namespace
declarations.
</true>
<false>
Do not report attributes used for Namespace declarations, and
optionally do not report original prefixed names.
</false>
<default value='false'/>
<access parsing='read-only' not-parsing='read-write'/>
</feature>
<feature name='http://xml.org/sax/features/string-interning'
id='string-interning'>
<true>
All element names, prefixes, attribute names, namespace URIs, and
local names are internalized using the
<code>java.lang.String#intern(String):String</code> method.
</true>
<false>Names are not necessarily internalized.</false>
<default value='true'/>
<access parsing='read-only' not-parsing='read-write'/>
<note>
&ParserName; always internalizes all strings mentioned above
using the <code>String#intern()</code> method. This feature
can only be set to true.
</note>
</feature>
</fcategory>
</features>
1.1 xml-site/sources/xerces2-j/install.xml
Index: install.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='Installation'>
<s2 title='Unpacking the Files'>
<p>
&ParserName; is packaged as a ZIP file for all platforms
and operating systems. The parser release is also packaged
as Tar GZip files as a convenience for UNIX users. You can
extract the ZIP files using the Java <ref>jar</ref> command
to unpack the distribution.
</p>
<source>jar xf &ParserName;-bin.&parserversion;.zip
jar xf &ParserName;-src.&parserversion;.zip
jar xf &ParserName;-tools.&parserversion;.zip</source>
<p>
All of these commands create a sub-directory called
"&parserdir;" in the current directory, except for the command to unpack
the "tools" distribution, since you may install this anywhere you like.
</p>
</s2>
<s2 title='Files in the Binary Package'>
<table>
<tr>
<td>LICENSE</td>
<td>License for &ParserName;</td>
</tr>
<tr>
<td>Readme.html</td>
<td>Web page redirect to docs/html/index.html</td>
</tr>
<tr>
<td>xercesImpl.jar</td>
<td>Jar file containing all the parser class files that implement
one of the standard API's supported by the parser</td>
</tr>
<tr>
<td>xmlParserAPIs.jar</td>
<td>Jar file containing all the standard API's implemented by
the parser. Currently, &ParserName; supports DOM level 2, SAX
2.0 R2 PR1, and the <code>javax.xml.parsers</code> part of JAXP
1.1. </td>
</tr>
<tr>
<td>xercesSamples.jar</td>
<td>Jar file containing all sample class files</td>
</tr>
<tr>
<td>data/</td>
<td>Directory containing sample XML data files</td>
</tr>
<tr>
<td>docs/</td>
<td>Directory containing documentation</td>
</tr>
<tr>
<td>docs/javadocs/</td>
<td>Directory containing Javadoc API for parser framework</td>
</tr>
<tr>
<td>samples/</td>
<td>Directory containing the source code for the samples</td>
</tr>
</table>
<note>
To use &ParserName; you do not need the source files.
However, if you want to recompile the sources you need to
download the source package and have the contents of the tools
package (or equivalent) available.
</note>
<note>
xerces.jar is no longer available in the main distribution. You can still download this jar from deprecated distribution. xerces.jar is a Jar file that contains all the parser class files.
</note>
</s2>
<s2 title='Files in the Source Package'>
<table>
<tr>
<td>LICENSE</td>
<td>License for &ParserName;</td>
</tr>
<tr>
<td>build.bat</td>
<td>Batch file for invoking Ant build for Windows users</td>
</tr>
<tr>
<td>build.sh</td>
<td>Shell script for invoking Ant build for UNIX users</td>
</tr>
<tr>
<td>build.xml</td>
<td>Ant build file -- read README file before building</td>
</tr>
<tr>
<td>README</td>
<td>Build instructions</td>
</tr>
<tr>
<td>Readme.html</td>
<td>Web page redirect required for building documentation</td>
</tr>
<tr>
<td>STATUS</td>
<td>Current source code status information</td>
</tr>
<tr>
<td>TODO</td>
<td>Current list of "todo" items</td>
</tr>
<tr>
<td>ISSUES</td>
<td>Current open issues that need to be resolved</td>
</tr>
<tr>
<td>data/</td>
<td>Directory containing sample XML data files</td>
</tr>
<tr>
<td>docs/</td>
<td>Directory containing documentation, in XML form</td>
</tr>
<tr>
<td>samples/</td>
<td>Directory containing source code for samples</td>
</tr>
<tr>
<td>src/</td>
<td>
Directory containing source code for parser and supplemental
APIs
</td>
</tr>
</table>
<note>
In order to compile the source code using Ant or to build the
release distributions yourself, you must have the contents of
<code>&ParserName;-tools.&parserversion;.zip</code>
on your classpath; i.e., you will need access to a version of ant,
xalan, StyleBook and an XML parser such as xerces.
For ease of use, we recommend extracting
<code>&ParserName;-tools.&parserversion;.zip</code>
in your xerces root directory; the build.sh and build.bat scripts
are written for this case.
</note>
</s2>
<s2 title='Changes in Xerces jar files'>
<p>In order to accomodate the very common case in which xerces is
used with an XSL processor such as xalan, between Xerces 2.0.0 beta 3
and beta 4 a change in the default organization of xerces's jar
files was introduced. As well as the <code>xercesSamples.jar</code>
file, which we still produce, xerces formerly came with a file called
<code>xerces.jar</code>. This file contained all of the
parser's functionality. Two files are now included:
<code>xercesImpl.jar</code>, our implementation of various API's,
and <code>xmlParserAPIs.jar</code>, the API's themselves. This
was done so that, if your XSLT processor ships with API's at the
same level as those supported by &ParserName;, you can avoid putting
<code>xmlParserAPIs.jar</code> on your classpath.</p>
<p>Should you wish to use the <code>xerces.jar</code> instead, we have
included several ant targets for backward compatibility. An
"ant target" is an argument given to ant, our build tool,
that tells it which portions of the <code>build.xml</code> file to
apply.
</p>
<p>
If you are on a Windows system and you wish to get only the
xerces.jar file, you would execute <code>build.bat
deprecatedjars</code>.
</p>
<p>
If you want to regenerate new versions of the xerces
binary, source and tools distributions with the old-style jarfiles,
you would execute <code>build.bat deprecatedall</code>.
The situation is
analogous for Unix users, except that <code>build.sh</code> would be
used instead of <code>build.bat</code>.
</p>
<p>
For further information and
more options, please look inside build.xml itself; all possibilities
are documented there.
</p>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/limitations-schema.xml
Index: limitations-schema.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title="XML Schema Limitations">
<s2 title="Introduction">
<p>This package contains an implementation of the W3C XML
Schema Language, a recommendation of the Worldwide Web Consortium
available in three parts:
<jump href="http://www.w3.org/TR/XMLSchema-0">XML Schema: Primer</jump> and
<jump href="http://www.w3.org/TR/XMLSchema-1">XML Schema: Structures</jump> and
<jump href="http://www.w3.org/TR/XMLSchema-2">XML Schema: Datatypes</jump>.
We consider this implementation to be complete except for the
limitations cited below. The implementation has been
extensively tested and known problem areas are set out below.
In this document we also discuss our interpretation of the
specifications where it seems to us particularly likely that
others might arrive at a different interpretation.
Please read this document before using this package.
</p>
</s2>
<s2 title="Limitations">
<ul>
<li> Length, minLength, and maxLength facets are limited to the value
2147483647. Items larger than this limit will not be validated
correctly.</li>
<li> Year and seconds values in date/time datatypes are limited to the
value 2147483647. Items larger than this limit will not be validated
correctly. </li>
</ul>
</s2>
<s2 title='Problem Areas/Known Bugs'>
<ul>
<li> Due to changes in the specification for Decimals in
JDK1.3, not all decimals that should be invalid according
to the Schema specs may be found by the parser;</li>
</ul>
</s2>
<s2 title='Interpretation of Areas that are Unclear or
Implementation-Dependent'>
<ul>
<li> QName: the specification does not define the unit of length. We
chose to implement the length facet as being in units of XML characters
in the value space ( # of chars in namespace URI + ":" +
local part );</li>
<li> We have interpreted the specs as requiring
<keyref> Identity Constraints to refer to
<key> or <unique> identity constraints within
the scope of the elements to which the <keyref> is
attached. This interpretation is at variance with the
Schema Primer, which contains an example with a
<keyref> declared on an element used inside the
element of its corresponding <key>;</li>
</ul>
</s2>
<s2 title="Other Notes">
<p> The parsers contained in this package are able to read and
validate XML documents with the grammar specified in either
DTD or XML Schema format.
The schema is specified by the xsi:schemaLocation or
xsi:noNamespaceSchemaLocation attribute on the root
element of the document. The xsi prefix must be bound to the
Schema document instance namespace, as specified by the
Recommendation. See the sample provided in the
Usage section.</p>
</s2>
<s2 title="Usage">
<p>In this release, schema validation has been integrated with the
regular SAXParser and DOMParser classes. No special classes are
required to parse documents that use a schema.</p>
<p>Each document that uses XML Schema grammars must specify the location of the
grammars it uses by using an xsi:schemaLocation attribute if they use
namespaces, and an xsi:noNamespaceSchemaLocation attribute
otherwise. These are usually placed on the root / top-level element
in the document, though they may occur on any element; for more details see XML
Schema Part 1 section 4.3.2.
Here is an example with no target namespace: </p>
<source><document
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='document.xsd'>
...
</document></source>
<p>Here is an example with a target namespace. Note that it is an
error to specify a different namespace than the target namespace
defined in the Schema.</p>
<source><document
xmlns='http://my.com'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://my.com document.xsd'>
...
</document></source>
<p>Review the sample file, 'data/personal.xsd' for an example of an XML
Schema grammar.</p>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/limitations.xml
Index: limitations.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='Limitations'>
<s2 title='Known Limitations'>
<p>
This is a list of the limitations in this release of &ParserName;.
There is also a list of <link idref='limitations-schema'>
XML Schema Limitations</link>.
</p>
<ul>
<li>
Due to a transcoding bug in the Sun JDK's (1.1.6, 1.1.7, 1.1.8, 1.2)
handling of EBCDIC data (specifically, end of line characters), you
must use IBM's JDK 1.1.6, if you want to use EBCDIC support. The IBM
JDK has the bug fixed. We don't know when the bug fix will get into
the Sun JDKs.
</li>
</ul>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/properties.xml
Index: properties.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE properties SYSTEM 'dtd/settings.dtd'>
<properties>
<desc name='Setting Properties'>
<p>
If you have created a DOM document builder or a SAX parser using
the JAXP interfaces, you may have difficulty setting features and
properties directly using those interfaces. The following
instructions tell you how to set properties on document builders
and SAX parsers created from the JAXP interfaces.
</p>
<p>
The DocumentBuilderFactory interface contains a
<code>setAttribute(String,Object)</code> method which <em>may</em>
provide a means to set features and properties on the underyling
parser. However, it cannot be relied upon. Therefore, you must
use the Xerces DOMParser object directly. For example:
</p>
<source>import org.apache.xerces.parsers.DOMParser;
import org.xml.sax.SAXException;
DOMParser parser = new DOMParser();
String id = "http://apache.org/xml/properties/dom/document-class-name";
Object value = "org.apache.xerces.dom.DocumentImpl";
try {
parser.setProperty(id, value);
}
catch (SAXException e) {
System.err.println("could not set parser feature");
}</source>
<p>
Using the SAXParser interface in JAXP is better because you can
query the underlying XMLReader implementation directly and that
interface contains methods to set and query features and
properties. For example:
</p>
<source>import javax.xml.parsers.SAXParser;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
SAXParser parser = /* created from SAXParserFactory */;
XMLReader reader = parser.getXMLReader();
String id = "http://apache.org/xml/properties/dom/document-class-name";
Object value = "org.apache.xerces.dom.DocumentImpl";
try {
reader.setProperty(id, value);
}
catch (SAXException e) {
System.err.println("could not set parser feature");
}</source>
</desc>
<pcategory name='General Properties'>
<property name='http://xml.org/sax/properties/xml-string'
id='xml-string'>
<desc>
Get the string of characters associated with the current event.
If the parser recognizes and supports this property but is not
currently parsing text, it should return null.
</desc>
<type>java.lang.String</type>
<access general='read-only'/>
<note>
This property is currently not supported because the contents of
the XML string returned by this property is not well defined.
</note>
</property>
<property name='http://apache.org/xml/properties/schema/external-schemaLocation'
id='schema.external-schemaLocation'>
<desc>
The XML Schema Recommendation explicitly states that the inclusion
of schemaLocation/noNamespaceSchemaLocation attributes is only a
hint; it does not mandate that these attributes must be used to
locate schemas. Similar situation happens to <import> element in
schema documents. This property allows the user to specify a list of
schemas to use. If the targetNamespace of a schema (specified
using this property) matches the targetNamespace of a schema
occurring in the instance document in schemaLocation attribute, or
if the targetNamespace matches the namespace attribute of <import>
element, the schema specified by the user using this property will
be used (i.e., the schemaLocation attribute in the instance document
or on the <import> element will be effectively ignored).
</desc>
<type>java.lang.String</type>
<access general='read-write'/>
<note>
The syntax is the same as for schemaLocation attributes in
instance documents: e.g, "http://www.example.com file_name.xsd".
The user can specify more than one XML Schema in the list.
</note>
</property>
<property name='http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation'
id='schema.external-noNamespaceSchemaLocation'>
<desc>
This property allows the user to specify an XML Schema with no
namespace.
</desc>
<type>java.lang.String</type>
<access general='read-write'/>
<note>
The syntax is a same as for the noNamespaceSchemaLocation attribute
that may occur in an instance document: e.g."file_name.xsd". The
user may specify only one XML Schema. For more information see the
documentation for the
http://apache.org/xml/properties/schema/external-schemaLocation
property.
</note>
</property>
</pcategory>
<pcategory name='DOM Properties'>
<property name='http://apache.org/xml/properties/dom/current-element-node'
id='dom.current-element-node'>
<desc>The current DOM element node while parsing.</desc>
<type>org.w3c.dom.Element</type>
<access general='read-only'/>
<note>
This property is useful for determining the location with a DOM
document when an error occurs.
</note>
</property>
<property name='http://apache.org/xml/properties/dom/document-class-name'
id='dom.document-class-name'>
<desc>
The fully qualified class name of the DOM implementation. The
implementation used must have a zero argument constructor.
</desc>
<type>java.lang.String</type>
<default value='"org.apache.xerces.dom.DocumentImpl"'/>
<access general='read-write'/>
<note>
When the document class name is set to a value other than the
name of the default document factory, the deferred node expansion
feature does not work.
</note>
</property>
</pcategory>
<pcategory name='SAX Properties'>
<property name='http://xml.org/sax/properties/declaration-handler'
id='declaration-handler'>
<desc>Set the handler for DTD declarations.</desc>
<type>org.xml.sax.ext.DeclHandler</type>
<access general='read-write'/>
</property>
<property name='http://xml.org/sax/properties/lexical-handler'
id='lexical-handler'>
<desc>Set the handler for lexical parsing events.</desc>
<type>org.xml.sax.ext.LexicalHandler</type>
<access general='read-write'/>
</property>
<property name='http://xml.org/sax/properties/dom-node'
id='dom-node'>
<desc>
The DOM node currently being visited, if SAX is being used as
a DOM iterator. If the parser recognizes and supports this
property but is not currently visiting a DOM node, it should
return null.
</desc>
<type>org.w3c.dom.Node</type>
<access parsing='read-only' not-parsing='read-write'/>
<note>
This property is only for SAX parser implementations used as
DOM tree walkers. Currently, Xerces does not have this
functionality.
</note>
</property>
</pcategory>
</properties>
1.1 xml-site/sources/xerces2-j/readme.xml
Index: readme.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='&ParserNameLong; Readme'>
<s2 title='&ParserNameLong; &ParserVersion; Release'>
<p>
Welcome to the future! Xerces2 is the next generation of
high performance, fully compliant XML parsers in the Apache
Xerces family. This new version of Xerces introduces the
Xerces Native Interface (XNI), a complete framework for
building parser components and configurations that is
extremely modular and easy to program.
</p>
<p>
The Apache Xerces2 parser is the reference implementation
of XNI but other parser components, configurations, and parsers
can be written using the Xerces Native Interface. For complete
design and implementation documents, refer to the
<link idref='xni'>XNI Manual</link>.
</p>
<p>
Xerces 2 is a <jump href='http://www.w3.org/TR/xmlschema-1/#key-fullyConforming'>fully conforming</jump> XML Schema processor.
For more information, refer to the <link idref='limitations-schema'>XML Schema Limitations</link> page.
</p>
<p>
Xerces 2 also provides a partial implementation of Document Object Model Level 3
<jump href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010913/'>Core</jump>,
<jump href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025/abstract-schemas.html'>Abstract Schemas</jump> and
<jump href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025/load-save.html'>Load and Save</jump> Working Drafts. For more information, refer to the
<link idref='dom3'>DOM Level 3 Implementation</link> page.
</p>
<p>
Please use
<jump href='http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Xerces2-J'>BugZilla</jump>
to report any bugs that you find.
</p>
<p>You can find the latest Xerces 2 jars
<jump href='http://gump.covalent.net/jars/latest/xml-xerces2/'>here</jump>.
</p>
</s2>
<s2 title='Features of This Release'>
<p>
The &ParserNameLong; &ParserVersion; supports the
following standards and APIs:
</p>
<ul>
<li>
<jump href='http://www.w3.org/XML/'>eXtensible Markup Language</jump>
(XML) 1.0
<jump href='http://www.w3.org/TR/2000/REC-xml-20001006'>Second
Edition</jump> Recommendation
</li>
<li>
<jump href='http://www.w3.org/TR/REC-xml-names/'>Namespaces
in XML</jump> Recommendation
</li>
<li>
<jump href='http://www.w3.org/DOM/'>Document Object Model</jump>
(DOM) Level 2
<jump href='http://www.w3.org/TR/DOM-Level-2-Core/'>Core</jump>,
<jump href='http://www.w3.org/TR/DOM-Level-2-Events'>Events</jump>,
and
<jump href='http://www.w3.org/TR/DOM-Level-2-Traversal-Range'>Traversal
and Range</jump> Recommendations
</li>
<li>
<jump href='http://sax.sourceforge.net/'>Simple API for XML</jump>
(SAX) 2.0
<jump href='http://prdownloads.sourceforge.net/sax/sax2-r2pre2.jar'>Core</jump>,
and
<jump href='http://prdownloads.sourceforge.net/sax/sax2-ext-1.0.zip'>Extension</jump>
</li>
<li>
<jump href='http://java.sun.com/xml/xml_jaxp.html'>Java APIs for
XML Processing</jump> (JAXP) 1.1
</li>
<li>
<jump href='http://www.w3.org/XML/Schema'>XML Schema</jump> 1.0
<jump href='http://www.w3.org/TR/xmlschema-1/'>Structures</jump>
and
<jump href='http://www.w3.org/TR/xmlschema-2/'>Datatypes</jump>
Recommendations
</li>
</ul>
</s2>
<s2 title='Changes from Previous Release'>
<p>
The &ParserNameLong; &ParserVersion; introduced some changes to the Xerces Native
Interface. The following list enumerates the important changes:
</p>
<ul>
<li>Added an interface, <code>XMLResourceIdentifier</code>, for describing the physical location of XML resources to the core XNI interfaces.
This interface is used in grammar caching and entity resolution.
</li>
<li>
Updated <code>XMLEntityResolver</code>, <code>XMLLocator</code>, <code>XMLDocumentHandler</code>, <code>XMLDocumentFragmentHandler</code>, and <code>XMLDTDHandler</code> to use <code>XMLResourceIdentifier</code> interface.
</li>
<li>
Added <code>Augmentations</code> to <code>XMLDTDHandler</code>, <code>XMLDocumentFragmentHandler</code>, and the <code>XMLDTDContentModelHandler</code> interfaces
</li>
</ul>
<p>
For a more complete list of changes, refer to the
<link idref='releases'>Release Information</link> page.
</p>
</s2>
<s2 title='Changes from Xerces 1.x'>
<p>
Xerces2 is a nearly complete rewrite of the Xerces 1.x codebase
in order to make the code cleaner, more modular, and easier to
maintain. It includes a completely redesigned and rewritten XML Schema validation engine.
Applications using only the standard interfaces such as
JAXP, DOM, and SAX should not see any differences.
</p>
</s2>
<s2 title='License Information'>
<p>
The &ParserName; &ParserVersion; release is available
in source code and precompiled binary (JAR files) form.
Both &ParserName; packages are made available under the
<jump href='http://xml.apache.org/LICENSE'>Apache Software
License</jump>.
</p>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/releases.xml
Index: releases.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!-- $Id: releases.xml,v 1.1 2002/02/05 21:16:57 neilg Exp $ -->
<!DOCTYPE releases SYSTEM 'dtd/releases.dtd'>
<releases>
<release version='Xerces 2.0.0'>
<desc>
This is the first production-quality release of the Xerces2 Java
XML parser. We are confident that it also marks the stabilization
of the XNI API, although changes in XNI are still possible. As
well as these XNI improvements and extensions, a host of bugs
and limitations that existed in Xerces 2.0.0beta4 have been fixed in
this release.
</desc>
<changes>
<add>
<note>Implemented support for UCS-4 and UCS-2 encodings.</note>
<submitter name='Neil Graham'/>
</add>
<add>
<note>
Added ability to override default parser configuration.
</note>
<submitter name='Andy Clark'/>
</add>
<add>
<note>Implemented DOM Level 3 isEqualNode() method
</note>
<submitter name='Arnaud Le Hors'/>
</add>
<add>
<note>Implemented namespace fixup during serialization of DOM tree.</note>
<submitter name='Elena Litani'/>
</add>
<add>
<note>Added implementation for new Xerces features validation/schema/normalized-value and
validation/schema/element-default</note>
<submitter name='Elena Litani'/>
</add>
<add>
<note>Implemented current-element-node property</note>
<submitter name='Ted Leung'/>
</add>
<add>
<note>Added internal subset string to DOM.</note>
<submitter name='Andy Clark'/>
</add>
<add>
<note>Added support for warn-on-duplicate-attdef xerces feature
validation/warn-on-duplicate-attdef
</note>
<submitter name='Neeraj Bajaj'/>
</add>
<update>
<note> Added an interface, XMLResourceIdentifier, for
describing the physical location of XML resources (external
entities, schemas etc.) for use in grammar caching and entity
resolution. Updated XMLEntityResolver, XMLLocator,
XMLDocumentHandler, XMLDocumentFragmentHandler, and
XMLDTDHandler to use this new interface consistently instead of unwieldy
lists of Strings in various callbacks.
</note>
<submitter name="Neil Graham"/>
</update>
<update>
<note>
Updated Xerces Native Interface to add augmentations to
document fragment handler, DTD handler, and the DTD content
model handler interfaces. Additional methods were also
renamed and/or modified.
</note>
<submitter name='Andy Clark'/>
</update>
<update>
<note>
Updated Xerces Native Interface to add methods to Augmentations, XMLAttributes, and
modify PSVI interfaces.
</note>
<submitter name='Elena Litani'/>
</update>
<update>
<note>
Cleaned up separation between DOMParser and DeferredDOM by
moving part of the code from createDeferredElement back into the parser,
this has several benefits including to only have to walk the list of
attributes once
</note>
<submitter name='Arnaud Le Hors'/>
</update>
<update>
<note>Provided support for fundamental facets in DV implementation </note>
<submitter name='Neeraj Bajaj, Sandy Gao'/>
</update>
<fix>
<note> Moved schema simple type error messages to the property file to enable localization.
</note>
<submitter name="Sandy Gao"/>
</fix>
<fix>
<note> Fixed various bugs related to the dependency between schema documents.
</note>
<submitter name="Sandy Gao"/>
</fix>
<fix>
<note> Modified URI resolution strategy so that Windows network paths are recognized.
</note>
<submitter name="Sandy Gao"/>
</fix>
<fix>
<note> Fixed various bugs related to schema components traversal and validation.
</note>
<submitter name="Sandy Gao"/>
</fix>
<fix>
<note> Fixed a bug in the ui.DOMParserSaveEncoding sample.
</note>
<submitter name="Joerg Vogel, Neil Graham"/>
</fix>
<fix>
<note>
Modified XMLDTDScanner to synchronize start/end entity calls.
Fixed XMLDocumentScannerImpl so it always checks settings for load-external-dtd feature.
Modified implementation of setDocumentHandler(): now user can change document handler
during the parse.
</note>
<submitter name="Elena Litani"/>
</fix>
<fix>
<note>
Fixed DOM L2 bugs: synchronization for entity reference nodes,
cloning of attribute node, report of event phases.
</note>
<submitter name="Arnaud Le Hors, Elena Litani"/>
</fix>
<fix>
<note>
Fixed a bug in XMLDocumentFragmentScannerImpl occuring when a ] is encountered at the end of an entity.
</note>
<submitter name="Arnaud Le Hors"/>
</fix>
<fix>
<note>Fixed misc. SAX bugs.
</note>
<submitter name="Lisa Martin"/>
</fix>
<fix>
<note>Fixed JAXP implementation of schemaLanguage property.
</note>
<submitter name="Edwin Goei"/>
</fix>
<fix>
<note>Massive Javadoc fixes.
</note>
<submitter name="Ted Leung, Neeraj Bajaj, Rahul Srivastava"/>
</fix>
<fix>
<note>Fixed external-schemaLocation and external-noNamespaceSchemalocation
properties related bug (# 5768)
</note>
<submitter name="Gopal Sharma"/>
</fix>
<fix>
<note>Fixed namespaces and namespace-prefixes related SAX bug.
</note>
<submitter name="Rahul Srivastava"/>
</fix>
<fix>
<note>Corrected features documentation for string-interning feature.
</note>
<submitter name="Rahul Srivastava"/>
</fix>
<fix>
<note>Fixed the bug in which duplicate attribute definitions were not ignored
and error was reported for ID datatype and Notation.
</note>
<submitter name="Neeraj Bajaj"/>
</fix>
<fix>
<note>Fixed the bug where 'locale' value was not set for StandardParserConfiguration.
</note>
<submitter name="Takuki Kamiya, Neeraj Bajaj"/>
</fix>
</changes>
</release>
<release version='Xerces 2.0.0 (beta4)'>
<desc>
This release fixes a number of bugs, introduces more changes to the Xerces
Native Interface, provides partial experimental DOM Level 3 implementation,
and includes full XML Schema support.
</desc>
<changes>
<add>
<note>
Implemented schema particle derivation restriction checking
</note>
<submitter name="Lisa Martin"/>
</add>
<add>
<note>
Added checking for schema constraint cos-element-consistent
</note>
<submitter name="Lisa Martin"/>
</add>
<fix>
<note>
resolved misc. SAX2 bugs
</note>
<submitter name="Lisa Martin"/>
</fix>
<add>
<note>
Added implementation of DOMInputSource, DOMError, DOMLocator and wrappers
for entity resolver and error handler (DOM Level 3).
</note>
<submitter name='Gopal Sharma, Elena Litani'/>
</add>
<add>
<note>
Added implementation of DOMWriter, DocumentLS, DOMImplementationLS and new
features support for save and load: create-cdata-nodes,
split-cdata-sections (DOM Level 3).
</note>
<submitter name='Rahul Srivastava, Elena Litani'/>
</add>
<add>
<note>
Added implementation of DOMBuilder, DOMASBuilder and partial
implementation of ASModel. Add support for a new feature
"include-comments" (DOM Level 3).
</note>
<submitter name='Pavani Mukthipudi, Neil Graham, Elena Litani'/>
</add>
<add>
<note>
Added Augmentations interface to core XNI interfaces and PSVI interfaces
as an extension to XNI (unstable). Added DOM Level 3 interfaces to
xerces.dom3 package. Modified samples accordingly.
</note>
<submitter name='Elena Litani'/>
</add>
<add>
<note>
Implemented split of xerces.jar file into an API-only jar file
(xmlParserAPIs.jar) and a jarfile containing only the API
implementation (xercesImpl.jar).
</note>
<submitter name="Neil Graham"/>
</add>
<update>
<note>
Modified XNI document handler interface to include Augmentations as an
extra parameter on each parser event. Modified XMLAttributes interface to
include getter methods for augmentations.
</note>
<submitter name='Elena Litani'/>
</update>
<add>
<note>
Implemented PSVI support in Xerces and added PSVIWriter, PSVIParser and
PSVIConfiguration sample files.
</note>
<submitter name='Arun Yadav, Elena Litani, Sandy Gao'/>
</add>
<add>
<note>
Added "external-schemaLocation" and "external-noNamespaceSchemaLocation"
properties.
</note>
<submitter name='Sandy Gao'/>
</add>
<add>
<note>
New schema simple type interface and implementation. It fixes various bugs
in the old implementation, and provides enough information for PSVI
support.
</note>
<submitter name='Sandy Gao, Neeraj Bajaj'/>
</add>
<update>
<note>
Internalize all symbols in SymbolTable using
java.lang.String#intern(). Now applications can compare the symbols by
reference.
</note>
<submitter name='Sandy Gao'/>
</update>
<add>
<note>
Added "schema-full-checking" feature, and implemented "Unique Particle
Attribution" constraint.
</note>
<submitter name='Sandy Gao'/>
</add>
<fix>
<note>
Changed the default configuration to standard parser configuration (that
does not include XML Schema validator), modified how and when the pipeline
is constructed.
</note>
<submitter name='Elena Litani'/>
</fix>
<fix>
<note>
Changed XML Schema validation behavior back to validate only if the
http://xml.org/sax/features/validation feature is true. Note: XML Schema
validation is off by default.
</note>
<submitter name='Andy Clark'/>
</fix>
<fix>
<note>
Added constructor to new DTDXSParserConfiguration so it can
share settings from a parent configuration.
</note>
<submitter name='Andy Clark'/>
</fix>
<fix>
<note>
The parser no longer wraps RuntimeException with XNIException
in the parse method.
</note>
<submitter name='Andy Clark'/>
</fix>
<fix>
<note>
Fixed cloneNode() for Entity, EntityReference and DocumentType. Fixed
importNode() of EntityReference nodes which mistakenly carried the old
value. Fixed handling EntityReference node subtrees that left the node
empty in non deferred DOM.
</note>
<submitter name='Arnaud Le Hors'/>
</fix>
<fix>
<note>
Added missing default attribute values in the DOM and fixed
double entity value bug in deferred DOM.
</note>
<submitter name='Andy Clark'/>
</fix>
<fix>
<note>
Fixed getElementById() in the DOMParser. Bound namespace attributes to
http://www.w3.org/2000/xmlns/ (DOM only).
</note>
<submitter name='Elena Litani'/>
</fix>
<fix>
<note>Various documentation fixes.</note>
<submitter name='Andy Clark, Elena Litani'/>
</fix>
<add>
<note>
Added more DOM Level 3 interfaces to xerces.dom3 package. Implemented
DOMImplementationRegistry (DOMImplementationSource really),
Node.set/getTextContent(), Node.isSameNode(), Node.getInterface(),
Node.set/getUserData(). Extended dom.mem.Test to test these additions.
</note>
<submitter name='Arnaud Le Hors'/>
</add>
<add>
<note>
Added ASBuilder sample to the DOM samples package to show how
to use the new DOM level 3 ASBuilder interface to implement a
form of grammar caching.
</note>
<submitter name='Sandy Gao'/>
</add>
<fix>
<note>
Enabled the parser to process documents encoded in EBCDIC and
UTF-16.
</note>
<submitter name='Neil Graham'/>
</fix>
</changes>
</release>
<release version='Xerces 2.0.0 (beta3)'>
<desc>
This release fixes a number of bugs, introduces some changes to
the Xerces Native Interface, and is the first Xerces2 release to
include XML Schema validation support. Please note that the XML
Schema validation code was completely rewritten for Xerces2 and
should be considered alpha at this time.
</desc>
<changes>
<add>
<note>
Redesigned and rewrote XML Schema validation code. Also updated
standard parser configuration to include the XML Schema validator
in the document pipeline by default.
</note>
<submitter name='Sandy Gao, Lisa Martin, Neil Graham, Elena Litani, Rahul Srivastava, Gopal Sharma, Pavani Mukthipudi, Neeraj Bajaj'/>
</add>
<add>
<note>
Added new default parser configuration that includes DTD and XML Schema
validators (DTDXSParserConfiguration). Implemented dynamic validation for
both validators.
</note>
<submitter name='Sandy Gao, Elena Litani'/>
</add>
<fix>
<note>
Synced up javax.xml.parsers package with latest code from xml-commons
module and various bug fixes.
</note>
<submitter name='Edwin Goei'/>
</fix>
<fix>
<note>
DOM/ DOMParser bug fixes.
</note>
<submitter name='Ted Leung, Andy Clark, Elena Litani, Arun Yadav'/>
</fix>
<fix>
<note>
Fixed newline normalization bug. Previously, the sequence #x0A #x0D
was being converted to #x0A instead of #x0A #x0A per section 2.11 of
the XML 1.0 specification. Thanks to Aleksander Slominski for the
bug report.
</note>
<submitter name='Andy Clark'/>
</fix>
<update>
<note>
Added getter methods to XMLParserConfiguration interface and added
filter interfaces for components that consume and produce document
and DTD information.
</note>
<submitter name='Andy Clark'/>
</update>
<fix>
<note>
Fixed DTD scanner from reporting entity boundaries appearing
inside of markup declarations. Entity boundaries appearing
in the content model of an element declaration is still
reported, though.
</note>
<submitter name='Andy Clark'/>
</fix>
<update>
<note>
Simplified XMLAttributes interface by removing the methods
related to entities appearing in attribute values.
</note>
<submitter name='Andy Clark'/>
</update>
<update>
<note>
Changed the XMLDTDHandler defined in XNI to add a non-normalized
value parameter to the internal element declaration callback. Also
implemented the non-normalized value for attribute values.
</note>
<submitter name='Andy Clark'/>
</update>
<fix>
<note>
Fixed bug in entity manager that would never resolve IANA encoding
names to Java encoding names properly. (Bug #3449)
</note>
<submitter name='Pavani Mukthipudi' mailto='Pavani.Mukthipudi@sun.com'/>
</fix>
<fix>
<note>
Fixed bug in SAX parser that was not forwarding external entity
declarations in the DTD. (Bug #3392)
</note>
<submitter name='Neeraj Bajaj' mailto='Neeraj.Bajaj@sun.com'/>
</fix>
<add>
<note>
Separated the XMLDocumentScannerImpl class so that it derives
from XMLDocumentFragmentScannerImpl which enables an
application to parse document fragments.
</note>
<submitter name='Andy Clark'/>
</add>
<add>
<note>
Ported the deferred DOM implementation from the Xerces 1.x
codebase.
</note>
<submitter name='Arnaud Le Hors'/>
</add>
</changes>
</release>
<release version='&ParserName; 2.0.0 (beta2)'>
<desc>
This is primarily a bug fix release. However, a new XNI
interface and additional documentation have been added.
</desc>
<changes>
<fix>
<note>
Fixed bug for when namespace bindings were added as default
attributes from the DTD.
</note>
<submitter name='Andy Clark'/>
</fix>
<fix>
<note>
Fixed Xerces2 standard components to properly recognize and use
the features and properties that they are documented to accept.
</note>
<submitter name='Andy Clark'/>
</fix>
<add>
<note>
Added documentation to the XNI Manual for re-using the Xerces2
parser components.
</note>
<submitter name='Andy Clark'/>
</add>
<update>
<note>
Moved Xerces 1.x to "xerces_j_1" branch and moved Xerces2 to the main
trunk of the "xml-xerces" module.
</note>
<submitter name='Arnaud Le Hors'/>
</update>
<fix>
<note>
Improved ability of document and DTD scanners to perform pull parsing.
</note>
<submitter name='Andy Clark'/>
</fix>
<fix>
<note>
Fixed bug where namespace binder would turn an emptyElement callback into
startElement and endElement callbacks.
</note>
<submitter name='Andy Clark'/>
</fix>
<update>
<note>
Updated standard parser configuration to separate DTD validation
and namespace binding in the parsing pipeline.
</note>
<submitter name='Andy Clark'/>
</update>
<remove>
<note>
Removed old XML Schema code that was not being used. This code
is intended to be replaced by either a port of the Xerces 1.x
XML Schema implementation or by a re-designed, re-implemented
XML Schema implementation.
</note>
<submitter name='Andy Clark'/>
</remove>
<fix>
<note>
Fixed bug in scanner that allowed the built-in entity references
to be sent via XNI. The default value for this feature should have
been false.
</note>
<submitter name='Andy Clark'/>
</fix>
<fix>
<note>Fixed several SAX bugs.</note>
<submitter name='Andy Clark'/>
</fix>
<update>
<note>
Synchronized DOM implementation code from Xerces 1.x codebase.
</note>
<submitter name='Andy Clark'/>
</update>
</changes>
</release>
<release version='&ParserName; 2.0.0 (beta)'>
<desc>
First beta release of the Xerces2 code. Besides numerous bug
fixes, this release has changes and additions to XNI. The new
XNI parser configuration framework has been added in this release.
Refer to the <link idref='xni'>XNI Manual</link> for complete
information.
</desc>
<changes>
<add>
<note>
Added document and DTD scanner interfaces to XNI to allow
parser configuration pipelines to be constructed generically.
</note>
<submitter name='Andy Clark'/>
</add>
<fix>
<note>
Fixed bug in DTD grammar for mixed content models that was
building the wrong validation content model.
</note>
<submitter name='Sandy Gao'/>
</fix>
<update>
<note>
Removed SAX dependency from XNI framework. Now the only
dependence on external API such as SAX is in the implementation
of the AbstractSAXParser and DOMParser so that legacy code
doesn't break.
</note>
<submitter name='Andy Clark'/>
</update>
<update>
<note>
Rewrote existing documentation, added XNI information, cleaned
up stylesheets, and converted some docs to use custom DTDs.
</note>
<submitter name='Andy Clark'/>
</update>
<fix>
<note>DTD method ordering problem for INCLUDE/IGNORE sections.</note>
<submitter name='Petr Kuzel'/>
</fix>
<update>
<note>Improved DFA build-time performance.</note>
<submitter name='ATOZAWA@jp.ibm.com' mailto='ATOZAWA@jp.ibm.com'/>
</update>
<update>
<note>Synchronized with Xerces 1.3.0</note>
<submitter name='Arnaud Le Hors'/>
</update>
</changes>
</release>
<release version='&ParserName; 2.0.0 (alpha)'>
<desc>Initial alpha release of Xerces2 code.</desc>
</release>
</releases>
1.1 xml-site/sources/xerces2-j/samples-dom.xml
Index: samples-dom.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='DOM Samples'>
<s2 title='Overview'>
<p>
This page documents the various Document Object Model (DOM)
samples included with Xerces. Besides being useful programs,
they can be used as DOM programming examples to learn how to
program using the DOM API.
</p>
<p>Basic DOM samples:</p>
<ul>
<li><link anchor='Counter'>dom.Counter</link></li>
<li><link anchor='DOMAddLines'>dom.DOMAddLines</link></li>
<!--
- Should the following samples be removed? rewritten? revamped?
<li><link anchor='DOMGenerate'>dom.DOMGenerate</link></li>
-->
<li><link anchor='GetElementsByTagName'>dom.GetElementsByTagName</link></li>
<li><link anchor='Writer'>dom.Writer</link></li>
<li><link anchor='ASBuilder'>dom.ASBuilder</link></li>
</ul>
<!--
- These samples should be redone.
<p>DOM Traversal samples:</p>
<ul>
<li><link anchor='IteratorView'>dom.traversal.IteratorView</link></li>
<li><link anchor='NameNodeFilter'>dom.traversal.NameNodeFilter</link></li>
<li><link anchor='TreeWalkerView'>dom.traversal.TreeWalkerView</link></li>
</ul>
-->
<p>
Most of the DOM parser samples have a command line option that
allows the user to specify a different DOM parser to use. In
order to supply another DOM parser besides the default Xerces
<code>DOMParser</code>, a DOM parser wrapper class must be written.
This class must implement the <code>dom.ParserWrapper</code>
interface.
</p>
<note>
JAXP could be used instead of the special DOM parser wrapper
class. However, that feature is not implemented at this time.
Using JAXP would require the user to specify the
<code>-Djavax.xml.parsers.DocumentBuilderFactory=...</code>
option to the virtual machine in order to use a different
document builder factory.
</note>
</s2>
<anchor name='Counter'/>
<s2 title='Sample dom.Counter'>
<p>
A sample DOM counter. This sample program illustrates how to
traverse a DOM tree in order to get information about the document.
The output of this program shows the time and count of elements,
attributes, ignorable whitespaces, and characters appearing in
the document. Three times are shown: the parse time, the first
traversal of the document, and the second traversal of the tree.
</p>
<p>
This class is useful as a "poor-man's" performance tester to
compare the speed and accuracy of various DOM parsers. However,
it is important to note that the first parse time of a parser
will include both VM class load time and parser initialization
that would not be present in subsequent parses with the same
file.
</p>
<note>
The results produced by this program should never be accepted as
true performance measurements.
</note>
<s3 title='usage'>
<source>java dom.Counter (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-p name</td><td>Select parser wrapper by name.</td></tr>
<tr><td>-x number</td><td>Select number of repetitions.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr>
<td>-np | -NP</td>
<td>
Turn on/off namespace prefixes.<br/>
<strong>NOTE:</strong> Requires use of -n.
</td>
</tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parsers.
</td>
</tr>
<tr>
<td>-f | -F</td>
<td>
Turn on/off Schema full checking.<br/>
<strong>NOTE:</strong> Requires use of -s and not supported by all parsers.
</td>
</tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
</s2>
<anchor name='DOMAddLines'/>
<s2 title='Sample dom.DOMAddLines'>
<p>
A sample of Adding lines to the DOM Node. This sample program illustrates:
</p>
<ul>
<li>How to override methods from DocumentHandler ( XMLDocumentHandler)</li>
<li>How to turn off ignorable white spaces by overriding ignorableWhiteSpace</li>
<li>How to use the SAX Locator to return row position (line number of DOM element)</li>
<li>How to attach user defined Objects to Nodes using method setUserData</li>
</ul>
<s3 title='usage'>
<source>java dom.DOMAddLines (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
<tr><td>-i</td><td>Don't print ignorable white spaces.</td></tr>
</table>
</s3>
</s2>
<!--
- Should the following samples be removed? rewritten? revamped?
<anchor name='DOMGenerate'/>
<s2 title='Sample dom.DOMGenerate'>
<p>TODO</p>
</s2>
-->
<anchor name='GetElementsByTagName'/>
<s2 title='Sample dom.GetElementsByTagName'>
<p>
A sample DOM filter. This sample program illustrates how to
use the <code>Document#getElementsByTagName()</code> method
to quickly and easily locate elements by name.
</p>
<s3 title='usage'>
<source>java dom.GetElementsByTagName (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-p name</td><td>Select parser wrapper by name.</td></tr>
<tr><td>-e name</td><td>Specify element name for search.</td></tr>
<tr><td>-a name</td><td>Specify attribute name for specified elements.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parsers.
</td>
</tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
</s2>
<anchor name='Writer'/>
<s2 title='Sample dom.Writer'>
<p>
A sample DOM writer. This sample program illustrates how to
traverse a DOM tree in order to print a document that is parsed.
</p>
<s3 title='usage'>
<source>java dom.Writer (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><td>-p name</td><td>Select parser wrapper by name.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parsers.
</td>
</tr>
<tr>
<td>-c | -C</td>
<td>
Turn on/off Canonical XML output.<br/>
<strong>NOTE:</strong> This is not W3C canonical output.
</td>
</tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
</s2>
<anchor name='ASBuilder'/>
<s2 title='Sample dom.ASBuilder'>
<p>
This sample program illustrates how to preparse xml schema
documents and how to validate instance documents against
preparsed schema grammars.
</p>
<s3 title='usage'>
<source>java dom.ASBuilder [-f|-F] -a uri ... [-i uri ...]</source>
</s3>
<s3 title='options'>
<table>
<tr><td>-f | -F</td><td>Turn on/off schema full checking.</td></tr>
<tr><td>-a uri ...</td><td>Provide a list of schema documents.</td></tr>
<tr><td>-i uri ...</td><td>Provide a list of instance documents to validate.</td></tr>
</table>
</s3>
</s2>
<!--
- These samples should be redone.
<anchor name='IteratorView'/>
<s2 title='Sample dom.traversal.IteratorView'>
<p>TODO</p>
</s2>
<anchor name='NameNodeFilter'/>
<s2 title='Sample dom.traversal.NameNodeFilter'>
<p>TODO</p>
</s2>
<anchor name='TreeWalkerView'/>
<s2 title='Sample dom.traversal.TreeWalkerView'>
<p>TODO</p>
</s2>
-->
</s1>
1.1 xml-site/sources/xerces2-j/samples-sax.xml
Index: samples-sax.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='SAX Samples'>
<s2 title='Overview'>
<p>
This page documents the various Simple API for XML (SAX)
samples included with Xerces. Besides being useful programs,
they can be used as SAX programming examples to learn how to
program using the SAX API.
</p>
<p>SAX samples:</p>
<ul>
<li><link anchor='Counter'>sax.Counter</link></li>
<li><link anchor='DocumentTracer'>sax.DocumentTracer</link></li>
<li><link anchor='Writer'>dom.Writer</link></li>
</ul>
<p>
Most of the SAX parser samples have a command line option that
allows the user to specify a different parser to use. In
order to supply another SAX parser besides the default Xerces
<code>SAXParser</code>, the parser must implement either the
<code>org.xml.sax.Parser</code> or <code>org.xml.sax.XMLReader</code>
interfaces. You may specify xni.parser.PSVIParser if you want Xerces to output PSVI.
</p>
<note>
JAXP could be used instead but this feature is not implemented
at this time. Using JAXP would require the user to specify the
<code>-Djavax.xml.parsers.SAXParserFactory=...</code>
option to the virtual machine in order to use a different
SAX parser factory.
</note>
</s2>
<anchor name='Counter'/>
<s2 title='Sample sax.Counter'>
<p>
A sample SAX2 counter. This sample program illustrates how to
register a SAX2 ContentHandler and receive the callbacks in
order to print information about the document. The output of
this program shows the time and count of elements, attributes,
ignorable whitespaces, and characters appearing in the document.
</p>
<p>
This class is useful as a "poor-man's" performance tester to
compare the speed and accuracy of various SAX parsers. However,
it is important to note that the first parse time of a parser
will include both VM class load time and parser initialization
that would not be present in subsequent parses with the same
file.
</p>
<note>
The results produced by this program should never be accepted
as true performance measurements.
</note>
<s3 title='usage'>
<source>java sax.Counter (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-p name</td><td>Select parser by name.</td></tr>
<tr><td>-x number</td><td>Select number of repetitions.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr>
<td>-np | -NP</td>
<td>
Turn on/off namespace prefixes.<br/>
<strong>NOTE:</strong> Requires use of -n.
</td>
</tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parsers.
</td>
</tr>
<tr>
<td>-f | -F</td>
<td>
Turn on/off Schema full checking.<br/>
<strong>NOTE:</strong> Requires use of -s and not supported by all parsers.
</td>
</tr>
<tr><td>-m | -M</td><td>Turn on/off memory usage report.</td></tr>
<tr><td>-t | -T</td><td>Turn on/off \"tagginess\" report.</td></tr>
<tr>
<td>--rem text</td>
<td>Output user defined comment before next parse.</td>
</tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
<s3 title='notes'>
<p>
The speed and memory results from this program should NOT be
used as the basis of parser performance comparison! Real
analytical methods should be used. For better results, perform
multiple document parses within the same virtual machine to
remove class loading from parse time and memory usage.
</p>
<p>
The "tagginess" measurement gives a rough estimate of the
percentage of markup versus content in the XML document. The
percent tagginess of a document is equal to the minimum amount
of tag characters required for elements, attributes, and
processing instructions divided by the total amount of
characters (characters, ignorable whitespace, and tag characters)
in the document.
</p>
<p>
Not all features are supported by different parsers.
</p>
</s3>
</s2>
<anchor name='DocumentTracer'/>
<s2 title='Sample sax.DocumentTracer'>
<p>
Provides a complete trace of SAX2 events for files parsed. This is
useful for making sure that a SAX parser implementation faithfully
communicates all information in the document to the SAX handlers.
</p>
<s3 title='usage'>
<source>java sax.DocumentTracer (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-p name</td><td>Select parser by name.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parsers.
</td>
</tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
</s2>
<anchor name='Writer'/>
<s2 title='Sample sax.Writer'>
<p>
A sample SAX2 writer. This sample program illustrates how to
register a SAX2 ContentHandler and receive the callbacks in
order to print a document that is parsed.
</p>
<s3 title='usage'>
<source>java sax.Writer (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-p name</td><td>Select parser by name.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parsers.
</td>
</tr>
<tr>
<td>-c | -C</td>
<td>
Turn on/off Canonical XML output.<br/>
<strong>NOTE:</strong> This is not W3C canonical output.
</td>
</tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/samples-socket.xml
Index: samples-socket.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='Socket Samples'>
<s2 title='Overview'>
<p>
Very often, applications need to transmit XML documents over
the network using a socket stream. However, XML is not designed
to make this possible because XML documents do not contain an
explicit end-of-document terminal. Therefore, the stream must
end (i.e. the socket must close) in order for the parser to
finish parsing the complete XML document.
</p>
<p>
Since creating socket streams is expensive the application needs
to re-use the same stream but XML doesn't define an end-of-document.
Therefore, another solution must be found. The socket samples
included with Xerces can be used to learn how to overcome this
common problem in a general way.
</p>
<p>Socket samples:</p>
<ul>
<li><link anchor='DelayedInput'>socket.DelayedInput</link></li>
<li><link anchor='KeepSocketOpen'>socket.KeepSocketOpen</link></li>
</ul>
</s2>
<anchor name='DelayedInput'/>
<s2 title='Sample socket.DelayedInput'>
<p>
This sample delays the input to the SAX parser to simulate reading data
from a socket where data is not always immediately available. An XML
parser should be able to parse the input and perform the necessary
callbacks as data becomes available. So this is a good way to test
any parser that implements the SAX2 <code>XMLReader</code> interface
to see if it can parse data as it arrives.
</p>
<p>
<strong>Note:</strong> This sample uses NSGMLS-like output of elements
and attributes interspersed with information about how many bytes are
being read at a time.
</p>
<s3 title='usage'>
<source>java socket.DelayedInput (options) filename ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-p name</td><td>Select SAX2 parser by name.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parsers.");
</td>
</tr>
<tr>
<td>-f | -F</td>
<td>
Turn on/off Schema full checking.<br/>
<strong>NOTE:</strong> Requires use of -s and not supported by all parsers.
</td>
</tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
</s2>
<anchor name='KeepSocketOpen'/>
<s2 title='Sample socket.KeepSocketOpen'>
<p>
This sample provides a solution to the problem of 1) sending multiple
XML documents over a single socket connection or 2) sending other types
of data after the XML document without closing the socket connection.
</p>
<p>
The first situation is a problem because the XML specification does
not allow a document to contain multiple root elements. Therefore a
document stream must end (or at least appear to end) for the XML
parser to accept it as the end of the document.
</p>
<p>
The second situation is a problem because the XML parser buffers the
input stream in specified block sizes for performance reasons. This
could cause the parser to accidentally read additional bytes of data
beyond the end of the document. This actually relates to the first
problem if the documents are encoding in two different international
encodings.
</p>
<p>
The solution that this sample introduces wraps both the input and
output stream on both ends of the socket. The stream wrappers
introduce a protocol that allows arbitrary length data to be sent
as separate, localized input streams. While the socket stream
remains open, a separate input stream is created to "wrap" an
incoming document and make it appear as if it were a standalone
input stream.
</p>
<p>
To use this sample, enter any number of filenames of XML documents
as parameters to the program. For example:
</p>
<source>java socket.KeepSocketOpen doc1.xml doc2.xml doc3.xml</source>
<p>
This program will create a server and client thread that communicate
on a specified port number on the "localhost" address. When the client
connects to the server, the server sends each XML document specified
on the command line to the client in sequence, wrapping each document
in a <code>WrappedOutputStream</code>. The client uses a
<code>WrappedInputStream</code> to read the data and pass it to the
parser.
</p>
<note>
Do not send any XML documents with associated grammars to the client.
In other words, don't send any documents that contain a DOCTYPE line
that references an external DTD because the client will not be able
to resolve the location of the DTD and an error will be issued by
the client.
</note>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/samples-ui.xml
Index: samples-ui.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='UI Samples'>
<!--
- REVISIT: The UI samples should be completely rewritten.
-
<anchor name='DOMTree'/>
<s2 title='Sample ui.DOMTree'>
<p><strong>TODO</strong></p>
</s2>
<anchor name='DOMTreeFull'/>
<s2 title='Sample ui.DOMTreeFull'>
<p><strong>TODO</strong></p>
</s2>
<p><strong>TODO</strong></p>
<s2 title='Sample ui.TreeView'>
</s2>
<anchor name='TreeViewer'/>
<s2 title='Sample ui.TreeViewer'>
<p><strong>TODO</strong></p>
</s2>
-->
<p><strong>TODO</strong></p>
</s1>
1.1 xml-site/sources/xerces2-j/samples-xni.xml
Index: samples-xni.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='XNI Samples'>
<s2 title='Overview'>
<p>
The Xerces Native Interface (XNI) is an internal API that is
independent of other XML APIs and is used to implement the
Xerces family of parsers. XNI allows a wide variety of parsers
to be written in an easy and modular fashion. The XNI samples
included with Xerces are simple examples of how to program
using the XNI API. However, for information on how to take full
advantage of this powerful framework, refer to the
<link idref='xni'>XNI Manual</link>.
</p>
<p>Basic XNI samples:</p>
<ul>
<li><link anchor='Counter'>xni.Counter</link></li>
<li><link anchor='DocumentTracer'>xni.DocumentTracer</link></li>
<li><link anchor='Writer'>xni.Writer</link></li>
<li><link anchor='PSVIWriter'>xni.PSVIWriter</link></li>
</ul>
<ul>
<li><link anchor='PassThroughFilter'>xni.PassThroughFilter</link></li>
<li><link anchor='UpperCaseFilter'>xni.UpperCaseFilter</link></li>
</ul>
<p>Parser configuration samples:</p>
<ul>
<li><link anchor='NonValidatingParserConfiguration'>xni.parser.NonValidatingParserConfiguration</link></li>
<li><link anchor='AbstractConfiguration'>xni.parser.AbstractConfiguration</link></li>
<!--
- REVISIT: Add in this sample once the proper interfaces have been
- designed and implemented in the parser. *And* after the
- sample code has been written.
-
<li><link anchor='DynamicParserConfiguration'>xni.parser.DynamicParserConfiguration</link></li>
-->
</ul>
<ul>
<li><link anchor='CSVConfiguration'>xni.parser.CSVConfiguration</link></li>
<li><link anchor='CSVParser'>xni.parser.CSVParser</link></li>
<li><link anchor='PSVIConfiguration'>xni.parser.PSVIConfiguration</link></li>
<li><link anchor='PSVIParser'>xni.parser.PSVIParser</link></li>
</ul>
<p>
Most of the XNI samples have a command line option that allows the
user to specify a different XNI parser configuration to use. In
order to supply another parser configuration besides the default
Xerces <code>StandardParserConfiguration</code>, the configuration
must implement the
<code>org.apache.xerces.xni.parser.XMLParserConfiguration</code>
interface.
</p>
</s2>
<anchor name='Counter'/>
<s2 title='Sample xni.Counter'>
<p>
A sample XNI counter. The output of this program shows the time
and count of elements, attributes, ignorable whitespaces, and
characters appearing in the document.
</p>
<p>
This class is useful as a "poor-man's" performance tester to
compare the speed and accuracy of various parser configurations.
However, it is important to note that the first parse time of a
parser will include both VM class load time and parser
initialization that would not be present in subsequent parses
with the same file.
</p>
<note>
The results produced by this program should never be accepted as
true performance measurements.
</note>
<s3 title='usage'>
<source>java xni.Counter (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-p name</td><td>Select parser configuration by name.</td></tr>
<tr><td>-x number</td><td>Select number of repetitions.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr>
<td>-np | -NP</td>
<td>
Turn on/off namespace prefixes.<br/>
<strong>NOTE:</strong> Requires use of -n.
</td>
</tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parser configurations.
</td>
</tr>
<tr>
<td>-f | -F</td>
<td>
Turn on/off Schema full checking.<br/>
<strong>NOTE:</strong> Requires use of -s and not supported by all parsers.
</td>
</tr>
<tr><td>-m | -M</td><td>Turn on/off memory usage report.</td></tr>
<tr><td>-t | -T</td><td>Turn on/off \"tagginess\" report.</td></tr>
<tr>
<td>--rem text</td>
<td>Output user defined comment before next parse.</td>
</tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
<s3 title='notes'>
<p>
The speed and memory results from this program should NOT be used
as the basis of parser performance comparison! Real analytical
methods should be used. For better results, perform multiple
document parses within the same virtual machine to remove class
loading from parse time and memory usage.
</p>
<p>
The "tagginess" measurement gives a rough estimate of the percentage
of markup versus content in the XML document. The percent tagginess
of a document is equal to the minimum amount of tag characters
required for elements, attributes, and processing instructions
divided by the total amount of characters (characters, ignorable
whitespace, and tag characters) in the document.
</p>
<p>
Not all features are supported by different parser configurations.
</p>
</s3>
</s2>
<anchor name='DocumentTracer'/>
<s2 title='Sample xni.DocumentTracer'>
<p>
Provides a complete trace of XNI document and DTD events for
files parsed.
</p>
<s3 title='usage'>
<source>java xni.DocumentTracer (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-p name</td><td>Specify parser configuration by name.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parser configurations.
</td>
</tr>
<tr><td>-c | -C</td><td>Turn on/off character notifications");</td></tr>
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
</s2>
<anchor name='Writer'/>
<s2 title='Sample xni.Writer'>
<p>
A sample XNI writer. This sample program illustrates how to
take receive XMLDocumentHandler callbacks in order to print
a document that is parsed.
</p>
<s3 title='usage'>
<source>java xni.Writer (options) uri ...</source>
</s3>
<s3 title='options'>
<table>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>-p name</td><td>Select parser configuration by name.</td></tr>
<tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
<tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
<tr>
<td>-s | -S</td>
<td>
Turn on/off Schema validation support.<br/>
<strong>NOTE:</strong> Not supported by all parser configurations.
</td>
</tr>
<!--
<tr>
<td>-c | -C</td>
<td>
Turn on/off Canonical XML output.<br/>
<strong>NOTE:</strong> This is not W3C canonical output.
</td>
</tr>
-->
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
</s2>
<anchor name='PSVIWriter'/>
<s2 title='Sample xni.PSVIWriter'>
<p>
This is an example of a component that intercepts document handler events and gathers PSVI information. The PSVI output is written as XML.
</p>
<p>
This class can <strong>NOT</strong> be run as a standalone
program. It is only an example of how to write a component. See <link anchor='PSVIParser'>xni.parser.PSVIParser</link>.
</p>
</s2>
<anchor name='PassThroughFilter'/>
<s2 title='Sample xni.PassThroughFilter'>
<p>
This sample demonstrates how to implement a simple pass-through
filter for the document "streaming" information set using XNI.
This filter could be used in a pipeline of XNI parser components
that communicate document events.
</p>
<p>
This class can <strong>NOT</strong> be run as a standalone
program. It is only an example of how to write a document
handler.
</p>
</s2>
<anchor name='UpperCaseFilter'/>
<s2 title='Sample xni.UpperCaseFilter'>
<p>
This sample demonstrates how to create a filter for the document
"streaming" information set that turns element names into upper
case.
</p>
<p>
This class can <strong>NOT</strong> be run as a standalone
program. It is only an example of how to write a document
handler.
</p>
</s2>
<anchor name='NonValidatingParserConfiguration'/>
<s2 title='Sample xni.parser.NonValidatingParserConfiguration'>
<p>Non-validating parser configuration.</p>
<p>
This class can <strong>NOT</strong> be run as a standalone
program. It is only an example of how to write a parser
configuration using XNI. You can use this parser configuration
by specifying the fully qualified class name to all of the XNI
samples that accept a parser configuration using the
<code>-p</code> option. For example:
</p>
<source>java xni.Counter -p xni.parser.NonValidatingParserConfiguration document.xml</source>
</s2>
<anchor name='AbstractConfiguration'/>
<s2 title='Sample xni.parser.AbstractConfiguration'>
<p>
This abstract parser configuration simply helps manage components,
features and properties, and other tasks common to all parser
configurations. In order to subclass this configuration and use
it effectively, the subclass is required to do the following:
</p>
<ul>
<li>
Add all configurable components using the <code>addComponent</code>
method,</li>
<li>Implement the <code>parse</code> method, and</li>
<li>Call the <code>resetComponents</code> before parsing.</li>
</ul>
<p>
This class can <strong>NOT</strong> be run as a standalone
program. It is only an example of how to write a parser
configuration using XNI.
</p>
</s2>
<!--
- REVISIT: Add in this sample once the proper interfaces have been
- designed and implemented in the parser. *And* after the
- sample code has been written.
-
<anchor name='DynamicParserConfiguration'/>
<s2 title='Sample xni.parser.DynamicParserConfiguration'>
</s2>
-->
<anchor name='CSVConfiguration'/>
<s2 title='Sample xni.parser.CSVConfiguration'>
<p>
This example is a very simple parser configuration that can
parse files with comma-separated values (CSV) to generate XML
events. For example, the following CSV document:
</p>
<source>Andy Clark,16 Jan 1973,Cincinnati</source>
<p>
produces the following XML "document" as represented by the
XNI streaming document information:
</p>
<source><![CDATA[<?xml version='1.0' encoding='UTF-8' standalone='true'?>
<!DOCTYPE csv [
<!ELEMENT csv (row)*>
<!ELEMENT row (col)*>
<!ELEMENT col (#PCDATA)>
]>
<csv>
<row>
<col>Andy Clark</col>
<col>16 Jan 1973</col>
<col>Cincinnati</col>
</row>
</csv>]]></source>
<p>
This class can <strong>NOT</strong> be run as a standalone
program. It is only an example of how to write a parser
configuration using XNI. You can use this parser configuration
by specifying the fully qualified class name to all of the XNI
samples that accept a parser configuration using the
<code>-p</code> option. For example:
</p>
<source>java xni.Counter -p xni.parser.CSVConfiguration document.xml</source>
</s2>
<anchor name='CSVParser'/>
<s2 title='Samples xni.parser.CSVParser'>
<p>
This parser class implements a SAX parser that can parse simple
comma-separated value (CSV) files.
</p>
<p>
This class can <strong>NOT</strong> be run as a standalone
program. It is only an example of how to write a parser
using XNI. You can use this parser
by specifying the fully qualified class name to all of the SAX
samples that accept a parser using the
<code>-p</code> option. For example:
</p>
<source>java sax.Counter -p xni.parser.CSVParser document.xml</source>
</s2>
<anchor name='PSVIConfiguration'/>
<s2 title='Sample xni.parser.PSVIConfiguration'>
<p>
This example is a parser configuration that can output post schema validation infoset. The configuration infludes: DTD validator, Namespace binder, XML Schema validators and PSVIWriter component.
</p>
<p>
This class can <strong>NOT</strong> be run as a standalone
program. It is only an example of how to write a parser
configuration using XNI. You can use this parser configuration
by specifying the fully qualified class name to all of the XNI
samples that accept a parser configuration using the
<code>-p</code> option:
</p>
<source>java xni.Counter -v -s -p xni.parser.PSVIConfiguration personal-schema.xml</source>
<note><link idref='features' anchor="validation">Validation</link> and <link idref='features' anchor="validation.schema">schema validation</link> features must be set to true to receive the correct PSVI output.</note>
</s2>
<anchor name='PSVIParser'/>
<s2 title='Samples xni.parser.PSVIParser'>
<p>
This parser class implements a SAX parser that outputs post schema validation infoset as XML.
</p>
<p>
This class can <strong>NOT</strong> be run as a standalone
program. It is only an example of how to write a parser
using XNI. You can use this parser
by specifying the fully qualified class name to all of the SAX
samples that accept a parser using the
<code>-p</code> option. For example:
</p>
<source>java sax.Counter -v -s -p xni.parser.PSVIParser personal-schema.xml</source>
<note><link idref='features' anchor="validation">Validation</link> and <link idref='features' anchor="validation.schema">schema validation</link> features must be set to true to receive the correct PSVI output.</note>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/samples.xml
Index: samples.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='Sample Programs'>
<s2 title='Overview'>
<p>
&ParserName; contains many useful samples to help you get
up-and-running with writing XML applications. Many of the sample
programs are even useful as standalone programs to help in
testing the validity of XML documents and/or debugging
applications.
</p>
<p>
The samples are organized either by API or by programming area in
the following categories:
</p>
<ul>
<li><link idref='samples-dom'>DOM Samples</link></li>
<li><link idref='samples-sax'>SAX Samples</link></li>
<li><link idref='samples-socket'>Socket Samples</link></li>
<li><link idref='samples-ui'>UI Samples</link></li>
<li><link idref='samples-xni'>XNI Samples</link></li>
</ul>
</s2>
<s2 title='Running the Samples'>
<p>
Running the sample applications requires that you have already
installed the Java Development Kit (JDK) or Java Runtime
Environment (JRE) on you computer and extracted the
&ParserName; software.
</p>
<p>
If you do not already have a JDK already on your computer download
one from Sun's Java website:
<jump href="http://java.sun.com">http://java.sun.com</jump> or from
IBM's website
<jump href="http://www.ibm.com/developer/java/">http://www.ibm.com/developer/java/</jump>.
The sample applications described in the following pages support
Java 1.x (e.g. 1.1.8, etc) and/or Java 2 (e.g. 1.2.2, 1.3, etc).
The UI samples are written using Swing and require Java 2 in order
to run but all of the command line programs will run using Java 1.x.
</p>
<p>
Command lines examples on the following pages use the Windows path
separator ';' (semicolon) and directory separator
'\' (backslash). On UNIX, use the ':' (colon)
character to separate the JAR files in the classpath, and replace
Windows directory separator '\' (backslash) with
'/' (forward slash).
</p>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/xni-components-dependence.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/xni-components-overview.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/xni-config.xml
Index: xni-config.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='XNI Parser Configuration'>
<s2 title='Parser Configuration'>
<p>
Parser configurations built using the Xerces Native Interface
are made from a series of parser components. This document
details the XNI API for these components and how they are put
together to construct a parser configuration in the following
sections:
</p>
<ul>
<li><link anchor='components'>Components</link></li>
<li><link anchor='configurations'>Configurations</link></li>
<li><link anchor='pipelines'>Pipelines</link></li>
</ul>
<p>
In addition, several <link anchor='examples'>examples</link>
are included to show how to create some parser components and
configurations:
</p>
<ul>
<li><link anchor='abstract-parser-config'>Abstract Parser Configuration</link></li>
<li><link anchor='csv-parser-config'>CSV Parser Configuration</link></li>
</ul>
<note>
All of the interfaces and classes defined in this document
reside in the <code>org.apache.xerces.xni.parser</code> package
but may use various interfaces and classes from the core XNI
package, <code>org.apache.xerces.xni</code>.
</note>
<note>
The source code for the samples in this document are included
in the downloaded packages for Xerces2.
</note>
</s2>
<anchor name='components'/>
<s2 title='Components'>
<p>
Parser configurations are comprised of a number of parser
components that perform various tasks. For example, a parser
component may be responsible for the actual scanning of XML
documents to generate document "streaming" information
events; another component may manage commonly used symbols
within the parser configuration in order to improve
performance; and a third component may even manage the
resolution of external parsed entities and the transcoding
of these entities from various international encodings into
<jump href='http://www.unicode.org/'>Unicode</jump> used
within the Java virtual machine. When these components are
assembled in a certain way, they constitute a single parser
configuration but they can also be used interchangeably with
other components that implement the appropriate interfaces.
</p>
<p>
<strong>Note:</strong>
Even though a parser is comprised of a number of components,
not all of these components are <em>configurable</em>. In
other words, some components depend on knowing the state of
certain features and properties of the parser configuration
while others can operate completely independent of the parser
configuration. However, when we use the term "component" when
talking about XNI, we are talking about a <em>configurable
component</em> within the parser configuration.
</p>
<p>
The following diagram shows an example of this collection of
parser components: (Please note that this is not the <em>only</em>
configuration of parser components.)
</p>
<p>
<img alt='Parser Components' src='xni-components-overview.gif'/>
</p>
<p>
The only distinguishing feature of a component
is that it can be notified of the state
of parser features and properties. Features represent parser
state of type <code>boolean</code> whereas properties represent
parser state of type <code>java.lang.Object</code>. Each
component can also be queried for which features and properties
it recognizes.
</p>
<anchor name='component'/>
<s3 title='Interface XMLComponent'>
<p>
This interface is the basic configurable component in a parser
configuration. It is managed by the
<link anchor='component-manager'>XMLComponentManager</link>
which holds the parser state.
</p>
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void reset(
<link anchor='component-manager'>XMLComponentManager</link> manager
) throws <link anchor='configuration-exception'>XMLConfigurationException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setFeature(
String featureId,
boolean state
) throws <link anchor='configuration-exception'>XMLConfigurationException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setProperty(
String propertyId,
Object value
) throws <link anchor='configuration-exception'>XMLConfigurationException</link>;
</code>
</td>
</tr>
<tr><td><code>public String[] getRecognizedFeatures();</code></td></tr>
<tr><td><code>public String[] getRecognizedProperties();</code></td></tr>
</table>
</s3>
<anchor name='configuration-exception'/>
<s3 title='Class XMLConfigurationException'>
<p>
</p>
<table>
<tr>
<th>
Extends <link idref='xni-core' anchor='exception'>XNIException</link>
</th>
</tr>
<tr><th>Constants</th></tr>
<tr>
<td><code>public static final short NOT_RECOGNIZED;</code></td>
</tr>
<tr>
<td><code>public static final short NOT_SUPPORTED;</code></td>
</tr>
<tr><th>Constructors</th></tr>
<tr>
<td>
<code>
public XMLConfigurationException(
short type,
String identifier
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public XMLConfigurationException(
short type,
String identifier,
String message
);
</code>
</td>
</tr>
<tr><th>Methods</th></tr>
<tr><td><code>public short getType();</code></td></tr>
<tr><td><code>public String getIdentifier();</code></td></tr>
</table>
</s3>
<p>
Components are managed by a component manager. The component
manager keeps track of the parser state for features and
properties. The component manager is responsible for notifying
each component when the value of those features and properties
change.
</p>
<p>
Before parsing a document, a parser configuration <em>must</em>
use the component manager to reset all of the parser components.
Then, during parsing, each time a feature or property value is
modified, all of the components <em>must</em> be informed of the
change.
</p>
<anchor name='component-manager'/>
<s3 title='Interface XMLComponentManager'>
<p>
The component manager interface allows components to query
needed features and properties during a call to the
<code>XMLComponent#reset(XMLComponentManager)</code> method.
However, components <em>should not</em> keep a reference to
the component manager. In other words, all necessary state
should be queried when the component is reset.
</p>
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public boolean getFeature(
String featureId
) throws <link anchor='configuration-exception'>XMLConfigurationException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public Object getProperty(
String propertyId
) throws <link anchor='configuration-exception'>XMLConfigurationException</link>;
</code>
</td>
</tr>
</table>
</s3>
<p>
<strong>Note:</strong>
A compliant XNI parser configuration is <em>not</em>
required to use any components that implement the
<code><link anchor='component'>XMLComponent</link></code>
interface. That interface is included as a convenience for
people building modular and configurable parser components.
The Xerces2 reference implementation uses the component
interface to implement its components so that they can be
used interchangeably in various configurations.
</p>
</s2>
<anchor name='configurations'/>
<s2 title='Configurations'>
<p>
An XNI parser configuration defines the entry point for a
parser to set features and properties, initiate a parse of
an XML instance document, perform entity resolution, and
receive notification of errors that occurred in the document.
</p>
<p>
A parser configuration is typically comprised of a series of
parser components. Some of these components may be
connected together to form the parsing pipeline. This parser
configuration is then used by a specific parser implementation
that generates a particular API, such as DOM or SAX. The
separation between the parser configuration and parser instance
allows the same API-generating parser to be used with an
unlimited number of different parser configurations.
</p>
<p>
When a document is parsed, the parser configuration resets the
configurable components and initiates the scanning of the
document. Typically, a scanner starts scanning the document
which generates XNI information set events that are sent to
the next component in the pipeline (e.g. the validator). The
information set events coming out of the end of the pipeline
are then communicated to the document and DTD handlers that
are registered with the parser configuration.
</p>
<p>
The following diagram shows both the generic parsing pipeline
contained within a parser configuration and the separation of
parser configuration and specific parser classes.
</p>
<p>
<img alt='Parser Configuration' src='xni-parser-configuration.gif'/>
</p>
<p>
There are two parser configuration interfaces defined in XNI:
the <code>XMLParserConfiguration</code> and the
<code>XMLPullParserConfiguration</code>. For most purposes, the
standard parser configuration will suffice. Document and DTD
handler interfaces will be registered on the parser configuration
and the document will be parsed completely by calling the
<code>parse(XMLInputSource)</code> method. In this situation,
the application is driven by the output of the configuration.
</p>
<p>
However, the <code>XMLPullParserConfiguration</code> interface
extends the <code>XMLParserConfiguration</code> interface to
provide methods that allow the application to drive the
configuration. Any configuration class that implements this
interface guarantees that it can be driven in a pull parsing
fashion but does not make any statement as to how much or how
little pull parsing will be performed at each step.
</p>
<anchor name='parser-configuration'/>
<s3 title='Interface XMLParserConfiguration'>
<p>
The parser configuration is the primary connection to specific
parser instances. Because the parser configuration is responsible
for holding the parser state, the
<code>addRecognizedFeatures(String[])</code> and
<code>addRecognizedProperties(String[])</code> methods allow the
parser instance to add recognized features and properties that
the parser configuration will store.
</p>
<!--
<table>
<tr>
<th>
Extends <link anchor='component-manager'>XMLComponentManager</link>
</th>
</tr>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void setFeature(
String featureId,
boolean state
) throws <link anchor='configuration-exception'>XMLConfigurationException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setProperty(
String propertyId,
Object value
) throws <link anchor='configuration-exception'>XMLConfigurationException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>public void addRecognizedFeatures(String[] featureIds);</code>
</td>
</tr>
<tr>
<td>
<code>public void addRecognizedProperties(String[] propertyIds);</code>
</td>
</tr>
<tr>
<td>
<code>
public void setEntityResolver(
<link anchor='entity-resolver'>XMLEntityResolver</link> resolver
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public <link anchor='entity-resolver'>XMLEntityResolver</link>
getEntityResolver();
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setErrorHandler(
<link anchor='error-handler'>XMLErrorHandler</link> handler
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public <link anchor='error-handler'>XMLErrorHandler</link>
getErrorHandler();
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setDocumentHandler(
<link idref='xni-core' anchor='document-handler'>XMLDocumentHandler</link> handler
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public <link anchor='document-handler'>XMLDocumentHandler</link>
getDocumentHandler();
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setDTDHandler(
<link idref='xni-core' anchor='dtd-handler'>XMLDTDHandler</link> handler
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public <link anchor='dtd-handler'>XMLDTDHandler</link>
getDTDHandler();
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setDTDContentModelHandler(
<link idref='xni-core' anchor='dtd-content-model-handler'>XMLDTDContentModelHandler</link> handler
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public <link anchor='dtd-content-model-handler'>XMLDTDContentModelHandler</link>
getDTDContentModelHandler();
</code>
</td>
</tr>
<tr>
<td>
<code>
public void parse(
<link anchor='input-source'>XMLInputSource</link> source
) throws java.io.IOException, <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr><td><code>public void setLocale(java.util.Locale);</code></td></tr>
<tr><td><code>public Locale getLocale();</code></td></tr>
</table>
-->
</s3>
<anchor name='pull-parser-configuration'/>
<s3 title='Interface XMLPullParserConfiguration'>
<p>
Parser configurations that implement this interface state that they
can be driven by the application in a pull parser fashion.
</p>
<table>
<tr>
<th>
Extends <link anchor='parser-configuration'>XMLParserConfiguration</link>
</th>
</tr>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void setInputSource(
<link anchor='input-source'>XMLInputSource</link> source
) throws java.io.IOException,
<link anchor='configuration-exception'>XMLConfigurationException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public boolean parse(boolean complete)
throws java.io.IOException,
<link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
</table>
</s3>
<anchor name='entity-resolver'/>
<s3 title='Interface XMLEntityResolver'>
<p>
This interface is used to resolve external parsed entities. The
application can register an object that implements this interface
with the parser configuration in order to intercept entities and
resolve them explicitly. If the registered entity resolver cannot
resolve the entity, it should return <code>null</code> so that the
parser will try to resolve the entity using a default mechanism. </p>
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public <link anchor='input-source'>XMLInputSource</link> resolveEntity(
<link anchor='resource-identifier'>XMLResourceIdentifier</link> resourceIdentifier
) throws java.io.IOException, <link anchor='parse-exception'>XMLParseException</link>;
</code>
</td>
</tr>
</table>
</s3>
<anchor name='error-handler'/>
<s3 title='Interface XMLErrorHandler'>
<p>
An interface for handling errors. If the application is interested
in error notifications, then it can register an error handler object
that implements this interface with the parser configuration.
</p>
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void warning(
String domain,
String key,
<link anchor='parse-exception'>XMLParseException</link> exception
) throws <link idref='xni-core' anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void error(
String domain,
String key,
<link anchor='parse-exception'>XMLParseException</link> exception
) throws <link idref='xni-core' anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void fatalError(
String domain,
String key,
<link anchor='parse-exception'>XMLParseException</link> exception
) throws <link idref='xni-core' anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
</table>
</s3>
<anchor name='input-source'/>
<s3 title='Class XMLInputSource'>
<p>
This class represents an input source for an XML document. The
basic properties of an input source are the following:
public identifier,
system identifier,
byte stream or character stream.
</p>
<!--
<table>
<tr><th>Constructors</th></tr>
<tr>
<td>
<code>
public XMLInputSource(
String publicId,
String systemId,
String baseSystemId
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public XMLInputSource(
String publicId,
String systemId,
String baseSystemId,
java.io.InputStream byteStream,
String encoding
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public XMLInputSource(
String publicId,
String systemId,
String baseSystemId
java.io.Reader characterStream,
String encoding
);
</code>
</td>
</tr>
<tr><th>Methods</th></tr>
<tr><td><code>public void setPublicId(String publicId);</code></td></tr>
<tr><td><code>public String getPublicId();</code></td></tr>
<tr><td><code>public void setSystemId(String systemId);</code></td></tr>
<tr><td><code>public String getSystemId();</code></td></tr>
<tr><td><code>public void getBaseSystemId(String baseSystemId);</code></td></tr>
<tr><td><code>public String getBaseSystemId();</code></td></tr>
<tr><td><code>public void getByteStream(java.io.InputStream byteStream);</code></td></tr>
<tr><td><code>public java.io.InputStream getByteStream();</code></td></tr>
<tr><td><code>public void getCharacterStream(java.io.Reader characterStream);</code></td></tr>
<tr><td><code>public java.io.Reader getCharacterStream();</code></td></tr>
<tr><td><code>public void setEncoding(String encoding);</code></td></tr>
<tr><td><code>public String getEncoding();</code></td></tr>
</table>
-->
</s3>
<anchor name='resource-identifier'/>
<s3 title='Class XMLResourceIdentifier'>
<p>
This represents the basic physical description of the location of any
XML resource (a Schema grammar, a DTD, a general entity etc.)
</p>
</s3>
<anchor name='parse-exception'/>
<s3 title='Class XMLParseException'>
<p>
A parsing exception. This exception is different from the standard
XNI exception in that it stores the location in the document (or
its entities) where the exception occurred.
</p>
<!--
<table>
<tr>
<th>
Extends <link idref='xni-core' anchor='exception'>XNIException</link>
</th>
</tr>
<tr><th>Constructors</th></tr>
<tr>
<td>
<code>
public XMLParseException(
<link idref='xni-core' anchor='locator'>XMLLocator</link> location,
String message
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public XMLParseException(
<link idref='xni-core' anchor='locator'>XMLLocator</link> location,
String message,
Exception exception
);
</code>
</td>
</tr>
<tr><th>Methods</th></tr>
<tr><td><code>public String getPublicId();</code></td></tr>
<tr><td><code>public String getSystemId();</code></td></tr>
<tr><td><code>public String getBaseSystemId();</code></td></tr>
<tr><td><code>public int getLineNumber();</code></td></tr>
<tr><td><code>public int getColumnNumber();</code></td></tr>
</table>
-->
</s3>
</s2>
<anchor name='pipelines'/>
<s2 title='Pipelines'>
<p>
The <link idref='xni-core'>Core Interfaces</link> provide
interfaces for the streaming information set. While these
interfaces are sufficient for communicating the document and
DTD information, it does not provide an easy way to construct
the pipeline or initiate the pipeline to start parsing an
XML document. The <code>org.apache.xerces.xni.parser</code>
package has additional interfaces to fill exactly this need.
</p>
<p>
Each parser configuration can be thought of as two separate
pipelines: one for document information and one for DTD
information. Each pipeline starts with a scanner and is followed
by zero or more filters (objects that implement interfaces
to handle the incoming information as well as register
handlers for the outgoing information). The information that
comes out the end of the pipeline is usually forwarded by
the parser configuration to the registered handlers.
</p>
<p>
There are two scanner interfaces defined: the XMLDocumentScanner
and the XMLDTDScanner:
</p>
<anchor name='document-scanner'/>
<s3 title='Interface XMLDocumentScanner'>
<p>This interface defines an XML document scanner.</p>
<table>
<tr>
<th>
Extends <link anchor='document-source'>XMLDocumentSource</link>
</th>
</tr>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void setInputSource(
<link anchor='input-source'>XMLInputSource</link> source
) throws java.io.IOException;
</code>
</td>
</tr>
<tr>
<td>
<code>
public boolean scanDocument(boolean complete)
throws java.io.IOException, <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
</table>
</s3>
<anchor name='dtd-scanner'/>
<s3 title='Interface XMLDTDScanner'>
<p>
This interface defines a DTD scanner. Typically, scanning of
the DTD internal subset is initiated from the XML document
scanner so the input source is implicitly the same as the
one used by the document scanner. Therefore, the
<code>setInputSource</code> method should only be called before
scanning of the DTD external subset.
</p>
<table>
<tr>
<th>
Extends <link anchor='dtd-source'>XMLDTDSource</link>,
<link anchor='dtd-content-model-source'>XMLDTDContentModelSource</link>
</th>
</tr>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void setInputSource(
<link anchor='input-source'>XMLInputSource</link> source
) throws java.io.IOException;
</code>
</td>
</tr>
<tr>
<td>
<code>
public boolean scanDTDInternalSubset(
boolean complete,
boolean standalone,
boolean hasExternalSubset
) throws java.io.IOException, <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public boolean scanDTDExternalSubset(
boolean complete
) throws java.io.IOException, <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
</table>
</s3>
<p>
Notice how each scanner interface's scanning methods take a
<code>complete</code> parameter and returns a boolean. This
allows (but does not require) scanners that implement these
interfaces to provide "pull" parsing behaviour in which the
application drives the parser's operation instead of having
parsing events "pushed" to the registered handlers.
</p>
<p>
After the scanners, zero or filters may be present in a parser
configuration pipeline. A document pipeline filter implements the
<link idref='xni-core' anchor='document-handler'>XMLDocumentHandler</link>
interface from the XNI Core Interfaces as well as the
<link anchor='document-source'>XMLDocumentSource</link>
interface which allows filters to be chained together in
the pipeline. There are equivalents source interfaces for the
DTD information as well.
</p>
<anchor name='document-source'/>
<s3 title='Interface XMLDocumentSource'>
<p>This interface allows a document handler to be registered.</p>
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void setDocumentHandler(
<link idref='xni-core' anchor='document-handler'>XMLDocumentHandler</link> handler
);
</code>
</td>
</tr>
</table>
</s3>
<anchor name='document-filter'/>
<s3 title='Interface XMLDocumentFilter'>
<p>
Defines a document filter that acts as both a receiver and
an emitter of document events.
</p>
<table>
<tr>
<th> Extends
<link idref='xni-core' anchor='document-handler'>XMLDocumentHandler</link>,
<link anchor='document-source'>XMLDocumentSource</link>
</th>
</tr>
</table>
</s3>
<anchor name='dtd-source'/>
<s3 title='Interface XMLDTDSource'>
<p>This interface allows a DTD handler to be registered.</p>
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void setDTDHandler(
<link idref='xni-core' anchor='dtd-handler'>XMLDTDHandler</link> handler
);
</code>
</td>
</tr>
</table>
</s3>
<anchor name='dtd-filter'/>
<s3 title='Interface XMLDTDFilter'>
<p>
Defines a DTD filter that acts as both a receiver and
an emitter of DTD events.
</p>
<table>
<tr>
<th> Extends
<link idref='xni-core' anchor='dtd-handler'>XMLDTDHandler</link>,
<link anchor='dtd-source'>XMLDTDSource</link>
</th>
</tr>
</table>
</s3>
<anchor name='dtd-content-model-source'/>
<s3 title='Interface XMLDTDContentModelSource'>
<p>This interface allows a DTD content model handler to be registered.</p>
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void setDTDContentModelHandler(
<link idref='xni-core' anchor='dtd-content-model-handler'>XMLDTDContentModelHandler</link> handler
);
</code>
</td>
</tr>
</table>
</s3>
<anchor name='dtd-filter'/>
<s3 title='Interface XMLDTDContentModelFilter'>
<p>
Defines a DTD content model filter that acts as both a receiver and
an emitter of DTD content model events.
</p>
<table>
<tr>
<th> Extends
<link idref='xni-core' anchor='dtd-content-model-handler'>XMLDTDContentModelHandler</link>,
<link anchor='dtd-content-model-source'>XMLDTDContentModelSource</link>
</th>
</tr>
</table>
</s3>
<p>
The next section gives some basic examples for using the XNI
framework to construct filters and parser configurations.
</p>
</s2>
<anchor name='examples'/>
<s2 title='Examples'>
<p>
The following samples show how to create various parser components
and parser configurations. The XNI samples included with the Xerces2
reference release provide a convenient way to test a parser
configuration. For example, to test the
<link anchor='csv-parser-config'>CSV Parser Configuration</link>
example, run the following command:
</p>
<source>java xni.DocumentTracer -p CSVConfiguration document.csv</source>
<p>
Or a new CSV parser can be constructed that produces standard
SAX events. For example:
</p>
<source>import org.apache.xerces.parsers.AbstractSAXParser;
public class CSVParser
extends AbstractSAXParser {
// Constructors
public CSVParser() {
super(new CSVConfiguration());
}
} // class CSVParser</source>
<p>
The following samples are available:
</p>
<ul>
<li><link anchor='abstract-parser-config'>Abstract Parser Configuration</link></li>
<li><link anchor='csv-parser-config'>CSV Parser Configuration</link></li>
</ul>
<anchor name='abstract-parser-config'/>
<s3 title='Abstract Parser Configuration'>
<p>
This abstract parser configuration simply helps manage
components, features and properties, and other tasks common to
all parser configurations.
</p>
<source><![CDATA[import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Hashtable;
import java.util.Locale;
import java.util.Vector;
import org.apache.xerces.xni.XMLDocumentHandler;
import org.apache.xerces.xni.XMLDTDHandler;
import org.apache.xerces.xni.XMLDTDContentModelHandler;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLComponent;
import org.apache.xerces.xni.parser.XMLConfigurationException;
import org.apache.xerces.xni.parser.XMLEntityResolver;
import org.apache.xerces.xni.parser.XMLErrorHandler;
import org.apache.xerces.xni.parser.XMLInputSource;
import org.apache.xerces.xni.parser.XMLParserConfiguration;
public abstract class AbstractConfiguration
implements XMLParserConfiguration {
// Data
protected final Vector fRecognizedFeatures = new Vector();
protected final Vector fRecognizedProperties = new Vector();
protected final Hashtable fFeatures = new Hashtable();
protected final Hashtable fProperties = new Hashtable();
protected XMLEntityResolver fEntityResolver;
protected XMLErrorHandler fErrorHandler;
protected XMLDocumentHandler fDocumentHandler;
protected XMLDTDHandler fDTDHandler;
protected XMLDTDContentModelHandler fDTDContentModelHandler;
protected Locale fLocale;
protected final Vector fComponents = new Vector();
// XMLParserConfiguration methods
public void addRecognizedFeatures(String[] featureIds) {
int length = featureIds != null ? featureIds.length : 0;
for (int i = 0; i < length; i++) {
String featureId = featureIds[i];
if (!fRecognizedFeatures.contains(featureId)) {
fRecognizedFeatures.addElement(featureId);
}
}
}
public void setFeature(String featureId, boolean state)
throws XMLConfigurationException {
if (!fRecognizedFeatures.contains(featureId)) {
short type = XMLConfigurationException.NOT_RECOGNIZED;
throw new XMLConfigurationException(type, featureId);
}
fFeatures.put(featureId, state ? Boolean.TRUE : Boolean.FALSE);
int length = fComponents.size();
for (int i = 0; i < length; i++) {
XMLComponent component = (XMLComponent)fComponents.elementAt(i);
component.setFeature(featureId, state);
}
}
public boolean getFeature(String featureId)
throws XMLConfigurationException {
if (!fRecognizedFeatures.contains(featureId)) {
short type = XMLConfigurationException.NOT_RECOGNIZED;
throw new XMLConfigurationException(type, featureId);
}
Boolean state = (Boolean)fFeatures.get(featureId);
return state != null ? state.booleanValue() : false;
}
public void addRecognizedProperties(String[] propertyIds) {
int length = propertyIds != null ? propertyIds.length : 0;
for (int i = 0; i < length; i++) {
String propertyId = propertyIds[i];
if (!fRecognizedProperties.contains(propertyId)) {
fRecognizedProperties.addElement(propertyId);
}
}
}
public void setProperty(String propertyId, Object value)
throws XMLConfigurationException {
if (!fRecognizedProperties.contains(propertyId)) {
short type = XMLConfigurationException.NOT_RECOGNIZED;
throw new XMLConfigurationException(type, propertyId);
}
if (value != null) {
fProperties.put(propertyId, value);
}
else {
fProperties.remove(propertyId);
}
int length = fComponents.size();
for (int i = 0; i < length; i++) {
XMLComponent component = (XMLComponent)fComponents.elementAt(i);
component.setProperty(propertyId, value);
}
}
public Object getProperty(String propertyId)
throws XMLConfigurationException {
if (!fRecognizedProperties.contains(propertyId)) {
short type = XMLConfigurationException.NOT_RECOGNIZED;
throw new XMLConfigurationException(type, propertyId);
}
Object value = fProperties.get(propertyId);
return value;
}
public void setEntityResolver(XMLEntityResolver resolver) {
fEntityResolver = resolver;
}
public XMLEntityResolver getEntityResolver() {
return fEntityResolver;
}
public void setErrorHandler(XMLErrorHandler handler) {
fErrorHandler = handler;
}
public XMLErrorHandler getErrorHandler() {
return fErrorHandler;
}
public void setDocumentHandler(XMLDocumentHandler handler) {
fDocumentHandler = handler;
}
public XMLDocumentHandler getDocumentHandler() {
return fDocumentHandler;
}
public void setDTDHandler(XMLDTDHandler handler) {
fDTDHandler = handler;
}
public XMLDTDHandler getDTDHandler() {
return fDTDHandler;
}
public void setDTDContentModelHandler(XMLDTDContentModelHandler handler) {
fDTDContentModelHandler = handler;
}
public XMLDTDContentModelHandler getDTDContentModelHandler() {
return fDTDContentModelHandler;
}
public abstract void parse(XMLInputSource inputSource)
throws IOException, XNIException;
public void setLocale(Locale locale) {
fLocale = locale;
}
// Protected methods
protected void addComponent(XMLComponent component) {
if (!fComponents.contains(component)) {
fComponents.addElement(component);
addRecognizedFeatures(component.getRecognizedFeatures());
addRecognizedProperties(component.getRecognizedProperties());
}
}
protected void resetComponents()
throws XMLConfigurationException {
int length = fComponents.size();
for (int i = 0; i < length; i++) {
XMLComponent component = (XMLComponent)fComponents.elementAt(i);
component.reset(this);
}
}
protected void openInputSourceStream(XMLInputSource source)
throws IOException {
if (source.getCharacterStream() != null) {
return;
}
InputStream stream = source.getByteStream();
if (stream == null) {
String systemId = source.getSystemId();
try {
URL url = new URL(systemId);
stream = url.openStream();
}
catch (MalformedURLException e) {
stream = new FileInputStream(systemId);
}
source.setByteStream(stream);
}
}
} // class AbstractConfiguration]]></source>
</s3>
<anchor name='csv-parser-config'/>
<s3 title='CSV Parser Configuration'>
<p>
This example is a very simple parser configuration that can
parse files with comma-separated values (CSV) to generate
XML events. For example, the following CSV document:
</p>
<source>Andy Clark,16 Jan 1973,Cincinnati</source>
<p>
produces the following XML "document" as represented by the
XNI streaming document information:
</p>
<source><![CDATA[<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE csv [
<!ELEMENT csv (row)*>
<!ELEMENT row (col)*>
<!ELEMENT col (#PCDATA)>
]>
<csv>
<row>
<col>Andy Clark</col>
<col>16 Jan 1973</col>
<col>Cincinnati</col>
</row>
</csv>]]></source>
<p>
Here is the source code for the CSV parser configuration.
Notice that it does not use any components. Rather, it implements
the CSV parsing directly in the parser configuration's
<code>parse(XMLInputSource)</code> method. This demonstrates
that you are <em>not</em> required to use the
<code>XMLComponent</code> interface but it is there for
building modular components that can be used in other
configurations.
</p>
<source><![CDATA[import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.Reader;
import java.util.StringTokenizer;
import org.apache.xerces.util.XMLAttributesImpl;
import org.apache.xerces.util.XMLStringBuffer;
import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLAttributes;
import org.apache.xerces.xni.XMLDTDContentModelHandler;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLInputSource;
public class CSVConfiguration
extends AbstractConfiguration {
// Constants
protected static final QName CSV = new QName(null, null, "csv", null);
protected static final QName ROW = new QName(null, null, "row", null);
protected static final QName COL = new QName(null, null, "col", null);
protected static final XMLAttributes EMPTY_ATTRS = new XMLAttributesImpl();
// Data
private final XMLStringBuffer fStringBuffer = new XMLStringBuffer();
// XMLParserConfiguration methods
public void setFeature(String featureId, boolean state) {}
public boolean getFeature(String featureId) { return false; }
public void setProperty(String propertyId, Object value) {}
public Object getProperty(String propertyId) { return null; }
public void parse(XMLInputSource source)
throws IOException, XNIException {
// get reader
openInputSourceStream(source);
Reader reader = source.getCharacterStream();
if (reader == null) {
InputStream stream = source.getByteStream();
reader = new InputStreamReader(stream);
}
BufferedReader bufferedReader = new BufferedReader(reader);
// start document
if (fDocumentHandler != null) {
fDocumentHandler.startDocument(null, "UTF-8");
fDocumentHandler.xmlDecl("1.0", "UTF-8", null);
fDocumentHandler.doctypeDecl("csv", null, null);
}
if (fDTDHandler != null) {
fDTDHandler.startDTD(null);
fDTDHandler.elementDecl("csv", "(row)*");
fDTDHandler.elementDecl("row", "(col)*");
fDTDHandler.elementDecl("col", "(#PCDATA)");
}
if (fDTDContentModelHandler != null) {
fDTDContentModelHandler.startContentModel("csv");
fDTDContentModelHandler.startGroup();
fDTDContentModelHandler.element("row");
fDTDContentModelHandler.endGroup();
short csvOccurs = XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE;
fDTDContentModelHandler.occurrence(csvOccurs);
fDTDContentModelHandler.endContentModel();
fDTDContentModelHandler.startContentModel("row");
fDTDContentModelHandler.startGroup();
fDTDContentModelHandler.element("col");
fDTDContentModelHandler.endGroup();
short rowOccurs = XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE;
fDTDContentModelHandler.occurrence(rowOccurs);
fDTDContentModelHandler.endContentModel();
fDTDContentModelHandler.startContentModel("col");
fDTDContentModelHandler.startGroup();
fDTDContentModelHandler.pcdata();
fDTDContentModelHandler.endGroup();
fDTDContentModelHandler.endContentModel();
}
if (fDTDHandler != null) {
fDTDHandler.endDTD();
}
if (fDocumentHandler != null) {
fDocumentHandler.startElement(CSV, EMPTY_ATTRS);
}
// read lines
String line;
while ((line = bufferedReader.readLine()) != null) {
if (fDocumentHandler != null) {
fDocumentHandler.startElement(ROW, EMPTY_ATTRS);
StringTokenizer tokenizer = new StringTokenizer(line, ",");
while (tokenizer.hasMoreTokens()) {
fDocumentHandler.startElement(COL, EMPTY_ATTRS);
String token = tokenizer.nextToken();
fStringBuffer.clear();
fStringBuffer.append(token);
fDocumentHandler.characters(fStringBuffer);
fDocumentHandler.endElement(COL);
}
fDocumentHandler.endElement(ROW);
}
}
bufferedReader.close();
// end document
if (fDocumentHandler != null) {
fDocumentHandler.endElement(CSV);
fDocumentHandler.endDocument();
}
}
} // class CSVConfiguration]]></source>
<p>
The source code is longer than it actually needs to be because
it also emits the DTD information necessary for a validating
parser to validate the document. The real core of the example
is the following:
</p>
<source><![CDATA[fDocumentHandler.startDocument(null, "UTF-8");
fDocumentHandler.startElement(CSV, EMPTY_ATTRS);
String line;
while ((line = bufferedReader.readLine()) != null) {
if (fDocumentHandler != null) {
fDocumentHandler.startElement(ROW, EMPTY_ATTRS);
StringTokenizer tokenizer = new StringTokenizer(line, ",");
while (tokenizer.hasMoreTokens()) {
fDocumentHandler.startElement(COL, EMPTY_ATTRS);
String token = tokenizer.nextToken();
fStringBuffer.clear();
fStringBuffer.append(token);
fDocumentHandler.characters(fStringBuffer);
fDocumentHandler.endElement(COL);
}
fDocumentHandler.endElement(ROW);
}
}
fDocumentHandler.endElement(CSV);
fDocumentHandler.endDocument();]]></source>
</s3>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/xni-core.xml
Index: xni-core.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='XNI Core Interfaces'>
<s2 title='Core Interfaces'>
<p>
The Xerces Native Interface core contains a series of
interfaces and classes designed to communicate a document's
"streaming" information set. This page documents the API
available for receiving this information in the following
sections:
</p>
<ul>
<li><link anchor='document-information'>Document Information</link></li>
<li><link anchor='dtd-information'>DTD Information</link></li>
</ul>
<p>
A few examples are also included to illustrate the use of the
streaming information set:
</p>
<ul>
<li>
<link anchor='pass-through-filter'>Pass-Through Document
Handler Filter</link>
</li>
<li><link anchor='upper-case-filter'>Upper-Case Filter</link></li>
</ul>
<p>
For information regarding the parser configuration framework,
refer to the <link idref='xni-config'>Parser Configuration</link>
documentation.
</p>
<note>
The source code for the samples in this document are included
in the downloaded packages for Xerces2.
</note>
</s2>
<s2 title='Document Information'>
<p>
The document information is communicated using the
<code>XMLDocumentHandler</code> interface. In addition, the
<code>XMLDocumentFragmentHandler</code> interface is included
to get information regarding document fragments. Programmers
already familiar with the SAX programming interfaces should
be immediately comfortable programming to the Xerces Native
Interface. However, XNI does not depend on the SAX interfaces
and classes.
</p>
<note>
All of the interfaces and classes documented on this page
are contained within the <code>org.apache.xerces.xni</code>
package.
</note>
<anchor name='document-handler'/>
<s3 title='Interface XMLDocumentHandler'>
<p>
Communicates document structure and content information. This
is the most important handler interface in the Xerces Native
Interface.
</p>
<!-- REVISIT: this info is already available in http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void startDocument(
<link anchor='locator'>XMLLocator</link> locator,
String encoding, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void xmlDecl(
String version,
String encoding,
String standalone, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void doctypeDecl(
String rootElement,
String publicId,
String systemId, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void comment(
<link anchor='string'>XMLString</link> text, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void processingInstruction(
String target,
<link anchor='string'>XMLString</link> data, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startPrefixMapping(
String prefix,
String uri, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endPrefixMapping(
String prefix, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startElement(
<link anchor='qname'>QName</link> element,
<link anchor='attributes'>XMLAttributes</link> attributes,
Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void emptyElement(
<link anchor='qname'>QName</link> element,
<link anchor='attributes'>XMLAttributes</link> attributes,
Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endElement(
<link anchor='qname'>QName</link> element,
Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startGeneralEntity(
String name,
XMLResourceIdentifier identifier,
String encoding, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void textDecl(
String version,
String encoding, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endGeneralEntity(
String name, Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void characters(
<link anchor='string'>XMLString</link> text,
Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void ignorableWhitespace(
<link anchor='string'>XMLString</link> text,
Augmentations augs
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startCDATA(Augmentations augs)
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endCDATA(Augmentations augs)
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endDocument(Augmentations augs)
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
</table>
-->
</s3>
<anchor name='document-fragment-handler'/>
<s3 title='Interface XMLDocumentFragmentHandler'>
<p>
Communicates information about a document fragment. This
interface is provided for convenience in defining a document
fragment but is not required to be used by a compliant XNI
parser component or configuration.
</p>
<!-- REVISIT: see http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void startDocumentFragment(
<link anchor='locator'>XMLLocator</link> locator,
<link anchor='namespace-context'>NamespaceContext</link>
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startEntity(
String name,
String publicId,
String systemId,
String baseSystemId,
String encoding
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void textDecl(
String version,
String encoding
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endEntity(
String name
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void comment(
<link anchor='string'>XMLString</link> text
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void processingInstruction(
String target,
<link anchor='string'>XMLString</link> data
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startPrefixMapping(
String prefix,
String uri
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endPrefixMapping(
String prefix
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startElement(
<link anchor='qname'>QName</link> element,
<link anchor='attributes'>XMLAttributes</link> attributes
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void emptyElement(
<link anchor='qname'>QName</link> element,
<link anchor='attributes'>XMLAttributes</link> attributes
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endElement(
<link anchor='qname'>QName</link> element
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void characters(
<link anchor='string'>XMLString</link> text
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void ignorableWhitespace(
<link anchor='string'>XMLString</link> text
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startCDATA()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endCDATA()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endDocumentFragment()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
</table>
-->
</s3>
<p>
Besides the handler interfaces there are several related
interfaces and classes. All of these are described below.
</p>
<anchor name='exception'/>
<s3 title='Class XNIException'>
<p>Represents a generic Xerces Native Interface exception.</p>
<p>
<strong>Note:</strong>
This exception extends <code>java.lang.RuntimeException</code>.
Therefore, even though all of the handler interface methods can
throw this type of exception, it is not explicitly required to
be caught. Since XNI is intended to be an internal set of
interfaces, it is expected that XNI implementations will provide
a catch block for this exception at the top level so that XNI
exceptions do not "leak" out to the application code.
</p>
<!-- REVISIT: http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Constructors</th></tr>
<tr><td><code>public XNIException(String message);</code></td></tr>
<tr>
<td><code>public XNIException(Exception exception);</code></td>
</tr>
<tr>
<td>
<code>
public XNIException(String message, Exception exception);
</code>
</td>
</tr>
<tr><th>Methods</th></tr>
<tr><td><code>public Exception getException();</code></td></tr>
</table>
-->
</s3>
<anchor name='augs'/>
<s3 title='Interface Augmentations'>
<p> This interface enables arbitrary information to be passed
through the pipeline on various calls from one component to
another. XNI tries to model, as close as is feasible, the
information made available by the W3C's InfoSet
specification. The <link anchor="augs">Augmentations</link>
interface is intended to permit components to augment the infoset
for some document at almost any given point. Many other XNI
interfaces besides the DocumentHandler support Augmentations
parameters.</p>
<p> One kind of particularly useful Infoset augmentation is
provided through the Post-Schema validation Infoset. For
information about Xerces2's support of the PSVI, and how
Augmentations are used in a well-defined way to permit this
support, see the <link idref="samples-xni">documentation</link> for the PSVI Writer and
PSVI Configuration samples.</p>
</s3>
<anchor name='resource'/>
<s3 title='Interface XMLResourceIdentifier'>
<p>
This interface serves to gather together information relevant to
any kind of XML resource (external entity, notation, schema
grammar, etc.). There are four fields in this interface:</p>
<ul>
<li>baseSystemId: The URI against which the literal systemId
in the entity (or the URI to be resolved in the
<code>schemaLocation</code> attribute as the case may be)
should be resolved relative to.
</li>
<li> literalSystemId: The "real" (unexpanded) value
of the systemId (or <code>schemaLocation</code>) of the entity
which this object relates to.
</li>
<li> expandedSystemId: The value of the systemId (or
<code>schemaLocation</code>) after being subjects to relative
URI expansion. SAX programmers will be familiar with this
concept from the SAX Locator interface, for example; this
property maps to the <code>systemId</code> property of that
interface.
</li>
<li> publicId: the publicId of the entity.
</li>
</ul>
<p> As in the case of other XNI objects, XMLResourceIdentifiers
cannot be depended upon to retain their values between calls;
hence, callees should extract whatever information they need
from them (or clone the object) before returning control back to
the parser. </p>
</s3>
<anchor name='locator'/>
<s3 title='Interface XMLLocator'>
<p>
This interface is used to communicate the document location to
the various handler interfaces. The application can use the
methods on this interface to query the public, literal system, and expanded system
base system identifier as well as the line and column number.
This interface extends the <link anchor="resource">XMLResourceIdentifier</link> interface.
</p>
<p>
A locator is passed as a parameter in the first method called
by the <code>XMLDocumentHandler</code>,
<code>XMLDocumentFragmentHandler</code>, and
<code>XMLDTDHandler</code> interfaces.
</p>
<p>
<strong>Note:</strong>
Parser components that emit document information are not required
to provide a locator object. However, the Xerces2 reference
implementation <em>does</em> provide a locator to registered
handlers.
</p>
<!-- REVISIT: http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Methods</th></tr>
<tr><td><code>public String getPublicId();</code></td></tr>
<tr><td><code>public String getSystemId();</code></td></tr>
<tr><td><code>public String getBaseSystemId();</code></td></tr>
<tr><td><code>public int getLineNumber();</code></td></tr>
<tr><td><code>public int getColumnNumber();</code></td></tr>
</table>
-->
</s3>
<anchor name='qname'/>
<s3 title='Class QName'>
<p>The QName object is a structure of qualified name information.</p>
<p>
<strong>Note:</strong>
The fields of this object have public visibility but should be
considered to be <em>read-only</em> to all methods that are
passed this object. The caller that creates and passes the QName
object "owns" the data. Therefore, callees should
<strong>not</strong> retain a reference to the passed object and
are required to copy the references contained in the object if
the data is to be used beyond the scope of the method call.
</p>
<!-- REVISIT: http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Fields</th></tr>
<tr><td><code>public String prefix;</code></td></tr>
<tr><td><code>public String localpart;</code></td></tr>
<tr><td><code>public String rawname;</code></td></tr>
<tr><td><code>public String uri;</code></td></tr>
<tr><th>Constructors</th></tr>
<tr><td><code>public QName();</code></td></tr>
<tr>
<td>
<code>
public QName(String prefix, String localpart,
String rawname, String uri);
</code>
</td>
</tr>
<tr>
<td>
<code>
public QName(<link anchor='qname'>QName</link> qname);
</code>
</td>
</tr>
<tr><th>Convenience Methods</th></tr>
<tr>
<td>
<code>
public void setValues(String prefix, String localpart,
String rawname, String uri);
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setValues(<link anchor='qname'>QName</link> qname);
</code>
</td>
</tr>
<tr><td><code>public void clear();</code></td></tr>
</table>
-->
</s3>
<anchor name='attributes'/>
<s3 title='Interface XMLAttributes'>
<p>
This interface represents the collection of attributes that is
passed to the <code>startElement</code> and <code>emptyElement</code>
methods of the <code>XMLDocumentHandler</code> and
<code>XMLDocumentFragmentHandler</code> interfaces. This
collection of attributes contains all of the information about
the attributes of an element (except order) and is editable.
</p>
<p>
This interface is also capable of storing information about
entities appearing in the attribute value. However, it should
be noted that if entity information is set for an attribute,
then the non-normalized value of the attribute <strong>must</strong>
also be stored because the offsets and lengths of entities in
the attribute have no meaning for the normalized value.
</p>
<!-- REVISIT: http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void addAttribute(
<link anchor='qname'>QName</link> attrName,
String attrType,
String attrValue
);
</code>
</td>
</tr>
<tr><td><code>public void removeAllAttributes();</code></td></tr>
<tr>
<td><code>public void removeAttributeAt(int attrIndex);</code></td>
</tr>
<tr>
<td>
<code>
public void addAttributeEntity(
int attrIndex,
String entityName,
int entityOffset,
int entityLength
);
</code>
</td>
</tr>
<tr>
<td>
<code>public void removeAllEntitiesFor(int attrIndex);</code>
</td>
</tr>
<tr>
<td>
<code>
public void removeEntityAt(int attrIndex, int entityIndex);
</code>
</td>
</tr>
<tr><td><code>public int getLength();</code></td></tr>
<tr><td><code>public int getIndex(String qName);</code></td></tr>
<tr>
<td>
<code>public int getIndex(String uri, String localName);</code>
</td>
</tr>
<tr>
<td>
<code>
public void setName(
int attrIndex,
<link anchor='qname'>QName</link> attrName
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public void getName(
int attrIndex,
<link anchor='qname'>QName</link> attrName
);
</code>
</td>
</tr>
<tr><td><code>public String getURI(int attrIndex);</code></td></tr>
<tr>
<td><code>public String getLocalName(int attrIndex);</code></td>
</tr>
<tr><td><code>public String getQName(int attrIndex);</code></td></tr>
<tr>
<td>
<code>public void setType(int attrIndex, String attrType);</code>
</td>
</tr>
<tr><td><code>public String getType(int attrIndex);</code></td></tr>
<tr><td><code>public String getType(String qName);</code></td></tr>
<tr>
<td>
<code>public String getType(String uri, String localName);</code>
</td>
</tr>
<tr>
<td>
<code>public void setValue(int attrIndex, String attrValue);</code>
</td>
</tr>
<tr><td><code>public String getValue(int attrIndex);</code></td></tr>
<tr><td><code>public String getValue(String qName);</code></td></tr>
<tr>
<td>
<code>public String getValue(String uri, String localName);</code>
</td>
</tr>
<tr>
<td>
<code>
public void setNonNormalizedValue(int attrIndex, String attrValue);
</code>
</td>
</tr>
<tr>
<td>
<code>public String getNonNormalizedValue(int attrIndex);</code>
</td>
</tr>
<tr>
<td>
<code>
public void setSpecified(int attrIndex, boolean specified);
</code>
</td>
</tr>
<tr>
<td><code>public boolean isSpecified(int attrIndex);</code></td>
</tr>
<tr>
<td><code>public int getEntityCount(int attrIndex);</code></td>
</tr>
<tr>
<td>
<code>
public void setEntityName(
int attrIndex,
int entityIndex,
String entityName
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public String getEntityName(
int attrIndex,
int entityIndex
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setEntityOffset(
int attrIndex,
int entityIndex,
int entityOffset
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public int getEntityOffset(
int attrIndex,
int entityIndex
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setEntityLength(
int attrIndex,
int entityIndex,
int entityLength
);
</code>
</td>
</tr>
<tr>
<td>
<code>
public int getEntityLength(
int attrIndex,
int entityIndex
);
</code>
</td>
</tr>
</table>
-->
</s3>
<anchor name='string'/>
<s3 title='Class XMLString'>
<p>
The XMLString object is a structure for holding text information.
This object allows the underlying implementation to pass text
information by using its own internal character buffer without
creating new String objects or copying the data.
</p>
<p>
<strong>Note:</strong>
The fields of this object have public visibility but should be
considered to be <em>read-only</em> to all methods that are
passed this object. The caller that creates and passes the
XMLString object "owns" the data. Therefore, callees should
<strong>not</strong> retain a reference to the passed object and
are required to copy the information contained in the object if
the data is to be used beyond the scope of the method call. Also,
callees should <strong>never</strong> modify the contents of the
character array directly as that could adversely affect the
operation of the caller.
</p>
<!-- REVISIT: http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Fields</th></tr>
<tr><td><code>public char[] ch;</code></td></tr>
<tr><td><code>public int offset;</code></td></tr>
<tr><td><code>public int length;</code></td></tr>
<tr><th>Constructors</th></tr>
<tr><td><code>public XMLString();</code></td></tr>
<tr>
<td>
<code>
public XMLString(char[] ch, int offset, int length);
</code>
</td>
</tr>
<tr>
<td>
<code>
public XMLString(<link anchor='string'>XMLString</link> string);
</code>
</td>
</tr>
<tr><th>Convenience Methods</th></tr>
<tr>
<td>
<code>
public void setValues(char[] ch, int offset, int length);
</code>
</td>
</tr>
<tr>
<td>
<code>
public void setValues(<link anchor='string'>XMLString</link> string);
</code>
</td>
</tr>
<tr><td><code>public void clear();</code></td></tr>
</table>
-->
</s3>
<anchor name='namespace-context'/>
<s3 title='Interface NamespaceContext'>
<p>
Namespace context information for document fragments. This
object is passed to the first method of the
<code>XMLDocumentFragmentHandler</code> interface.
</p>
<!-- REVISIT: http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Constants</th></tr>
<tr><td><code>public static final String XMLNS;</code></td></tr>
<tr><td><code>public String getURI(String prefix);</code></td></tr>
<tr><td><code>public int getDeclaredPrefixCount();</code></td></tr>
<tr>
<td><code>public String getDeclaredPrefixAt(int index);</code></td>
</tr>
<tr>
<td>
<code>
public <link anchor='namespace-context'>NamespaceContext</link>
getParentContext();
</code>
</td>
</tr>
</table>
-->
</s3>
</s2>
<s2 title='DTD Information'>
<p>
The DTD information is communicated through two interfaces:
<code>XMLDTDHandler</code> and <code>XMLDTDContentModelHandler</code>.
The first handler interface passes the basic DTD information
whereas the second handler interface breaks down each element
declaration content model into separate callbacks.
</p>
<s3 title='Interface XMLDTDHandler'>
<p>
Communicates basic DTD information such as element and attribute
declarations. The implementor of this interface can also be
informed of characters within an ignored conditional section.
</p>
<!-- REVISIT: http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Constants</th></tr>
<tr>
<td><code>public static final short CONDITIONAL_INCLUDE;</code></td>
</tr>
<tr>
<td><code>public static final short CONDITIONAL_IGNORE;</code></td>
</tr>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void startDTD(
<link anchor='locator'>XMLLocator</link> locator
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startEntity(
String name,
String publicId,
String systemId,
String baseSystemId,
String encoding
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void textDecl(
String version,
String encoding
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endEntity(
String name
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void comment(
<link anchor='string'>XMLString</link> text
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void processingInstruction(
String target,
<link anchor='string'>XMLString</link> data
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void elementDecl(
String name,
String contentModel
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startAttlist(
String elementName
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void attributeDecl(
String elementName,
String attributeName,
String type,
String[] enumeration,
String defaultType,
<link anchor='string'>XMLString</link> defaultValue
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endAttlist() throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void internalEntityDecl(
String name,
<link anchor='string'>XMLString</link> text
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void externalEntityDecl(
String name,
String publicId,
String systemId,
String baseSystemId
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void unparsedEntityDecl(
String name,
String publicId,
String systemId,
String notation
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void notationDecl(
String name,
String publicId,
String systemId
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startConditional(
short type
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void characters(
<link anchor='string'>XMLString</link> text
) throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endConditional() throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endDTD() throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
</table>
-->
</s3>
<s3 title='Interface XMLDTDContentModelHandler'>
<p>
Breaks down each element declaration's content model into
a set of separate methods so that handlers don't have to
reparse the content model string given in the
<code>XMLDTDHandler#elementDecl(String,String)</code> method.
This separation also helps those applications that want to
know boundaries of entities when used as part of an element's
content model.
</p>
<!-- REVISIT: http://xml.apache.org/xerces2-j/api.html
<table>
<tr><th>Constants</th></tr>
<tr>
<td>
<code>public static final short SEPARATOR_CHOICE;</code>
</td>
</tr>
<tr>
<td>
<code>public static final short SEPARATOR_SEQUENCE;</code>
</td>
</tr>
<tr>
<td>
<code>public static final short OCCURS_ZERO_OR_ONE;</code>
</td>
</tr>
<tr>
<td>
<code>public static final short OCCURS_ZERO_OR_MORE;</code>
</td>
</tr>
<tr>
<td>
<code>public static final short OCCURS_ONE_OR_MORE;</code>
</td>
</tr>
<tr><th>Methods</th></tr>
<tr>
<td>
<code>
public void startContentModel()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void any()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void empty()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void startGroup()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void pcdata()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void element(String elementName)
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void separator(short type)
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void occurrence(short type)
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endGroup()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
<tr>
<td>
<code>
public void endContentModel()
throws <link anchor='exception'>XNIException</link>;
</code>
</td>
</tr>
</table>
-->
</s3>
</s2>
<s2 title='Examples'>
<p>
The following examples demonstrate the basic use of the various
XNI handler interfaces.
</p>
<anchor name='pass-through-filter'/>
<s3 title='Pass-Through Document Handler Filter'>
<p>
The following example demonstrates a basic pass-through
document handler filter. This filter receives document handler
events and passes them through to the next document handler.
</p>
<source>import org.apache.xerces.xni.<link anchor='qname'>QName</link>;
import org.apache.xerces.xni.<link anchor='attributes'>XMLAttributes</link>;
import org.apache.xerces.xni.<link anchor='document-handler'>XMLDocumentHandler</link>;
import org.apache.xerces.xni.<link anchor='locator'>XMLLocator</link>;
import org.apache.xerces.xni.<link anchor='string'>XMLString</link>;
import org.apache.xerces.xni.<link anchor='exception'>XNIException</link>;
import org.apache.xerces.xni.<link anchor='resource'>XMLResourceIdentifier</link>;
import org.apache.xerces.xni.<link anchor='augs'>Augmentations</link>;
public class PassThroughFilter
implements <link anchor='document-handler'>XMLDocumentHandler</link> {
// Data
protected <link anchor='document-handler'>XMLDocumentHandler</link> fDocumentHandler;
// Public methods
public void setDocumentHandler(<link anchor='document-handler'>XMLDocumentHandler</link> handler) {
fDocumentHandler = handler;
}
// XMLDocumentHandler methods
public void startDocument(<link anchor='locator'>XMLLocator</link>
locator, String encoding, <link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.startDocument(locator, encoding, augs);
}
}
public void xmlDecl(String version, String encoding,
String standalone, <link
anchor="augs">Augmentations</link> augs) throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.xmlDecl(version, encoding, standalone,
augs);
}
}
public void doctypeDecl(String rootElement, String publicId,
String systemId, <link
anchor="augs">Augmentations</link> augs) throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.doctypeDecl(rootElement, publicId,
systemId, augs);
}
}
public void comment(<link anchor='string'>XMLString</link> text,
<link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.comment(text, augs);
}
}
public void processingInstruction(String target, <link
anchor='string'>XMLString</link> data, <link
anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.processingInstruction(target, data, augs);
}
}
public void startPrefixMapping(String prefix, String uri, <link
anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.startPrefixMapping(prefix, uri, augs);
}
}
public void endPrefixMapping(String prefix, <link
anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.endPrefixMapping(prefix, augs);
}
}
public void startElement(<link anchor='qname'>QName</link>
element, <link anchor='attributes'>XMLAttributes</link>
attributes, <link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.startElement(element, attributes, augs);
}
}
public void emptyElement(<link anchor='qname'>QName</link>
element, <link anchor='attributes'>XMLAttributes</link>
attributes, <link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.emptyElement(element, attributes, augs);
}
}
public void endElement(<link anchor='qname'>QName</link> element,
<link anchor="augs">augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.endElement(element, augs);
}
}
public void startEntity(String name,
<link anchor="resource">XMLResourceIdentifier</link> resId,
String encoding, <link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.startEntity(name,
resId, encoding, augs);
}
}
public void textDecl(String version, String encoding, <link
anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.textDecl(version, encoding, augs);
}
}
public void endEntity(String name, <link
anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.endEntity(name, augs);
}
}
public void characters(<link anchor='string'>XMLString</link> text,
<link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.characters(text, augs);
}
}
public void ignorableWhitespace(<link
anchor='string'>XMLString</link> text ,
<link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.ignorableWhitespace(text, augs);
}
}
public void startCDATA(<link anchor="augs">Augmentations</link>
augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.startCDATA(augs);
}
}
public void endCDATA(<link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.endCDATA(augs);
}
}
public void endDocument(<link anchor="augs">Augmentations</link>
augs)
throws <link anchor='exception'>XNIException</link> {
if (fDocumentHandler != null) {
fDocumentHandler.endDocument(augs);
}
}
} // class PassThroughFilter</source>
</s3>
<anchor name='upper-case-filter'/>
<s3 title='Upper-Case Filter'>
<p>
The following code extends the pass-through document handler
filter to upper-case all of the element names.
</p>
<source>import org.apache.xerces.xni.<link anchor='qname'>QName</link>;
import org.apache.xerces.xni.<link anchor='attributes'>XMLAttributes</link>;
import org.apache.xerces.xni.<link anchor='string'>XNIException</link>;
import org.apache.xerces.xni.<link anchor='augs'>Augmentations</link>;
public class UpperCaseFilter
extends PassThroughFilter {
// Data
private final <link anchor='qname'>QName</link> fQName = new QName();
// XMLDocumentHandler methods
public void startElement(<link anchor='qname'>QName</link> element, <link anchor='attributes'>XMLAttributes</link> attributes,
<link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
super.startElement(toUpperCase(element), attributes, augs);
}
public void emptyElement(<link anchor='qname'>QName</link>
element, <link anchor='attributes'>XMLAttributes</link>
attributes, <link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
super.emptyElement(toUpperCase(element), attributes, augs);
}
public void endElement(<link anchor='qname'>QName</link> element,
<link anchor="augs">Augmentations</link> augs)
throws <link anchor='exception'>XNIException</link> {
super.endElement(toUpperCase(element), augs);
}
// Protected methods
protected QName toUpperCase(<link anchor='qname'>QName</link> qname) {
String prefix = qname.prefix != null
? qname.prefix.toUpperCase() : null;
String localpart = qname.localpart != null
? qname.localpart.toUpperCase() : null;
String rawname = qname.rawname != null
? qname.rawname.toUpperCase() : null;
String uri = qname.uri;
fQName.setValues(prefix, localpart, rawname, uri);
return fQName;
}
} // class UpperCaseFilter</source>
</s3>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/xni-design.xml
Index: xni-design.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='XNI Design Details'>
<s2 title='Overview'>
<p>
A parser written to conform to the Xerces Native Interface (XNI)
framework is configured as a pipeline of parser components. The
document's "streaming" information set flows through this pipeline
of components to produce some sort of programming interface as the
output. For example, the pipeline could produce a W3C Document
Object Model (DOM) or a series of Simple API for XML (SAX) events.
</p>
<p>
The core XNI interfaces provide a mechanism for the document
information to flow from component to component. However, beyond
the basic information intefaces, XNI also defines a framework for
constructing these pipelines and parser configurations. This
document is designed to give you an overview of this framework
and what a parser looks like that is written to conform to the
Xerces Native Interface. An overview of these frameworks are
described below:
</p>
<ul>
<li><link anchor='pipeline'>Pipeline</link></li>
<li><link anchor='configuration'>Configuration</link></li>
</ul>
<p>
For more detailed information, refer to the following documents:
</p>
<ul>
<li><link idref='xni-core'>Core Interfaces</link></li>
<li><link idref='xni-config'>Parser Configuration</link></li>
<li><link idref='xni-xerces2'>Xerces2 Parser Components</link></li>
</ul>
</s2>
<anchor name='pipeline'/>
<s2 title='Pipeline'>
<p>
The XNI parser pipeline is any combination of components that
are either capable of producing XNI events, consuming XNI events,
or both. All pipelines consist of a source, zero or more filters,
and a target. The source is typically the XML scanner; common
filters are DTD and XML Schema validators, a namespace binder,
etc; and the target is the parser that consumes the XNI events
and produces a common programming interface such as DOM or SAX.
The following diagram illustrates the basic pipeline configuration.
</p>
<p>
<img alt='Basic Pipeline Configuration' src='xni-pipeline-basic.gif'/>
</p>
<p>
However, this is a simplified view of the pipeline configuration.
The Xerces Native Interface actually defines two different pipelines
with three interfaces: one for document information and two for DTD
information.
</p>
<p>
The Xerces2 parser, the reference implementation of XNI,
contains more components than the basic pipeline configuration
diagram shows. The following diagram shows the Xerces2 pipeline
configuration. The arrow going from left to right on the top of the
image represents the flow of document information and the arrows on
the bottom of the image represent the DTD information flowing through
the parser pipeline.
</p>
<p>
<img alt='Xerces2 Pipeline Configuration' src='xni-pipeline-detailed.gif'/>
</p>
<p>
As the diagram shows, the "Document Scanner" is the source for
document information and the "DTD Scanner" is the source for DTD
information. Both document and DTD information generated by the
scanners flow into the "DTD Validator" where structure and content
is validated according to the DTD grammar, if present. From here,
the validated document information with possible augmentations such
as default attribute values and attribute value normalization flows
to the "Namespace Binder" which applies the namespace information to
elements and attributes. The newly namespace-bound document
document information then flows to the "Schema Validator" for
validation based on the XML Schema, if present. Finally, the
document and DTD information flow to the "Parser" which generates
a programming interface such as DOM or SAX.
</p>
<p>
XNI defines the document information using a number of core
interfaces. (These interfaces are described in more detail in the
<link idref='xni-api-core'>Core API</link> documentation.) But XNI
also defines a set of interfaces to build parser configurations
that assemble the pipelines in order to parse documents. The next
section gives a general overview of the this parser configuration
provided by XNI.
</p>
</s2>
<anchor name='configuration'/>
<s2 title='Configuration'>
<p>
A parser implementation written using the Xerces Native Interface
can be seen as a collection of components, some of which are
connected together to form the pipelines for document and DTD
information. All of the components in the parser are managed by
a "Component Manager" that does the following:
</p>
<ul>
<li>Keeps track of parser settings and options,</li>
<li>
Instantiates and configures the various components in the parser, and
</li>
<li>Assembles the parsing pipeline and initiates parsing of documents.</li>
</ul>
<p>
The following diagram represents a typical parser configuration
that has a component manager and various components such as a
"Symbol Table", "Scanner", etc.
</p>
<p>
<img alt='Generic Parser Configuration' src='xni-components-overview.gif'/>
</p>
<p>
Some of the components in a configuration are configurable and others
are not. The actual details regarding component configuration, however,
can be found in the <link idref='xni-config'>XNI Parser Configuration</link>
document. But for now it is sufficient to understand the basic overview
of parser configurations.
</p>
<p>
The XNI parser configuration framework provides an easy and
convenient way to construct different kinds of parser configurations.
By separating the configuration from the API generation (in each
specific parser object), different parser configurations can be used to
build a DOM tree or emit SAX events without re-implementing the DOM or
SAX code. The following diagram shows this separation. Notice how the
document information flows through the pipeline in the parser
configuration and then to the parser object which generates different
APIs.
</p>
<p>
<img alt='Configuration and Parser Separation' src='xni-parser-configuration.gif'/>
</p>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/xni-entity-manager.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/xni-parser-configuration.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/xni-pipeline-basic.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/xni-pipeline-detailed.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/xni-xerces2.xml
Index: xni-xerces2.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='Xerces2 Components'>
<s2 title='Re-using Xerces2 Parser Components'>
<p>
The Xerces Native Interface (XNI) defines a general way to build
parser components and configurations. The Xerces2 reference
implementation is written using this framework so that the parser
components can be re-used to create new parser configurations. In
order to re-use the Xerces2 parser components, however, the
developer must know the dependencies of each standard component.
This document provides an overview of the Xerces2 parser components
and lists the relevent dependencies.
</p>
<p>
An overview of the general dependencies and the dependencies for
each standard component are detailed below:
</p>
<ul>
<li><link anchor='overview'>Overview</link></li>
<li>Fundamental Dependencies</li>
<ul>
<li><link anchor='symbol-table'>Symbol Table</link></li>
<li><link anchor='error-reporter'>Error Reporter</link></li>
</ul>
<li>Individual Component Dependencies</li>
<ul>
<li><link anchor='document-scanner'>Document Scanner</link></li>
<li><link anchor='dtd-scanner'>DTD Scanner</link></li>
<li><link anchor='entity-manager'>Entity Manager</link></li>
<li><link anchor='dtd-validator'>DTD Validator</link></li>
<li><link anchor='namespace-binder'>Namespace Binder</link></li>
<li><link anchor='schema-validator'>Schema Validator</link></li>
</ul>
<!-- NOTE:
- More components and their dependencies may be added as
- they are made and integrated into the standard Xerces2
- configuration.
-->
</ul>
</s2>
<anchor name='overview'/>
<s2 title='Overview'>
<p>
The standard parser configuration for the Xerces2 reference
implementation of XNI is defined in the
<code>org.apache.xerces.parsers.StandardParserConfiguration</code>
class. This configuration is comprised of a number of
components. Some of these components are configurable and some
are shared within the configuration but do not implement the
<link idref='xni-config' anchor='component'>XMLComponent</link>
interface.
</p>
<p>
The following list details the set of components used in the
Xerces2 standard configuration. The components marked with an
asterisk (*) are configurable.
</p>
<ul>
<li>Symbol Table</li>
<li>Error Reporter (*)</li>
<li>Document Scanner (*)</li>
<li>DTD Scanner (*)</li>
<li>Entity Manager (*)</li>
<li>DTD Validator (*)</li>
<li>Namespace Binder (*)</li>
<li>Schema Validator (*)</li>
</ul>
<note>
There are additional components other than those in the above
list, such as the "Grammar Pool" and "Datatype Validator
Factory". However, the validation engine in the Xerces2
reference implementation is currently being re-designed and
re-implemented. Therefore, these components are subject to
change and should not be used or relied upon.
</note>
<p>
In general, there are levels of dependency among the components
in the standard configuration. Some components are required by
all of the configurable components, where as there are certain
components required by other components. The following diagram
illustrates these basic levels of dependency.
</p>
<p>
<img alt='Xerces2 Component Dependencies' src='xni-components-dependence.gif'/>
</p>
<p>
The dependencies of each component are detailed in subsequent
sections of this document but the basic dependencies are
listed below:
</p>
<ul>
<li>
All of the configurable Xerces2 components in the standard
configuration depend on the
"<link anchor='symbol-table'>Symbol Table</link>" and the
"<link anchor='error-reporter'>Error Reporter</link>".
</li>
<li>
Both the "<link anchor='document-scanner'>Document Scanner</link>"
and the "<link anchor='dtd-scanner'>DTD Scanner</link>" depend
on the "<link anchor='entity-manager'>Entity Manager</link>"
component.
</li>
<li>
In addition to the other dependencies, the
"<link anchor='document-scanner'>Document Scanner</link>" also
depends on the
"<link anchor='dtd-scanner'>DTD Scanner</link>" for scanning of
the internal and external subsets of the DTD.
</li>
</ul>
<p>
Each configurable component queries the components that it
depends on before each document is parsed. The configuration
is required to call the
<link idref='xni-config' anchor='component'>XMLComponent</link>'s
"reset" method. From the
<link idref='xni-config' anchor='component-manager'>XMLComponentManager</link>
object that is passed to the "reset" method, the component
can query the other components that it needs. Therefore, each
component is assigned a unique property identifier used to
query the components from the component manager.
</p>
<p>
The following example source code shows how one of the
standard Xerces2 components is queried within a configurable
component. However, for complete dependency details and the
property identifiers defined for each component, refer to the
appropriate sections of this document.
</p>
<source><![CDATA[import org.apache.xerces.xni.parser.XMLComponent;
import org.apache.xerces.xni.parser.XMLComponentManager;
import org.apache.xerces.xni.parser.XMLConfigurationException;
public class MyComponent
implements XMLComponent {
// Constants
public static final String SYMBOL_TABLE =
"http://apache.org/xml/properties/internal/symbol-table";
// XMLComponent methods
public void reset(XMLComponentManager manager)
throws XMLConfigurationException {
SymbolTable symbolTable =
(SymbolTable)manager.getProperty(SYMBOL_TABLE);
}
}]]></source>
</s2>
<anchor name='symbol-table'/>
<s2 title='Symbol Table'>
<p>Property information:</p>
<table>
<tr>
<th>Property Id</th>
<td>http://apache.org/xml/properties/internal/symbol-table</td>
</tr>
<tr>
<th>Type</th>
<td>org.apache.xerces.util.SymbolTable</td>
</tr>
</table>
<p>
For performance reasons, the Xerces2 reference implementation
uses a custom symbol table in order to re-use common strings
that appear in the document. The symbol table is responsible
for keeping track of these common strings and always return
the same <code>java.lang.String</code> reference for lexically
equivalent strings. This not only reduces the amount of unique
objects created while parsing, it also allows components (e.g.
the validators, etc) to perform comparisons directly on the
references for certain string objects without having to call
the "equals" method.
</p>
<p>
<strong>Note:</strong>
Nearly all of the standard components depend on this component.
Therefore, if you write a parser configuration that re-uses any
of the standard components, you must have an instance of this
component registered with the appropriate property identifier.
</p>
</s2>
<anchor name='error-reporter'/>
<s2 title='Error Reporter'>
<p>Property information:</p>
<table>
<tr>
<th>Property Id</th>
<td>http://apache.org/xml/properties/internal/error-reporter</td>
</tr>
<tr>
<th>Type</th>
<td>org.apache.xerces.impl.XMLErrorReporter</td>
</tr>
</table>
<p>Recognized features:</p>
<ul>
<li>http://apache.org/xml/features/continue-after-fatal-error</li>
</ul>
<p>Recognized properties:</p>
<ul>
<li>http://apache.org/xml/properties/internal/error-handler</li>
</ul>
<p>
In any parser instance, there must be a way for components to
report errors in a uniform way. The "Error Reporter" component
serves this purpose and simplifies the process of localizing
error messages and notifying the registered
<link idref='xni-parser' anchor='error-handler'>XMLErrorHandler</link>.
</p>
<p>
In general, errors are identified by the domain of the error
and a unique key within that domain. The XMLErrorReporter class
allows message formatters to be set for each domain and then
delegates the formatting of error messages (with replacement
text) to the message formatter assigned to that error domain.
The localized error message is then sent to the registered
error handler.
</p>
<p>
An error message formatter is any class that implements the
<code>org.apache.xerces.util.MessageFormatter</code> interface.
If you write a new parser component for use with the existing
Xerces2 components, you should implement your own message
formatter and register it with the Error Reporter. For
example:
</p>
<source><![CDATA[import java.util.Locale;
import java.util.MissingResourceException;
import org.apache.xerces.util.MessageFormatter;
public class MyFormatter
implements MessageFormatter {
// MessageFormatter methods
public String formatMessage(Locale locale, String key, Object[] args)
throws MissingResourceException {
// localize and format message based on locale, key,
// and replacement text arguments
return "MY ERROR ("+key+")";
}
}]]></source>
<source><![CDATA[import org.apache.xerces.impl.XMLErrorReporter;
import org.apache.xerces.xni.parser.XMLComponent;
import org.apache.xerces.xni.parser.XMLComponentManager;
import org.apache.xerces.xni.parser.XMLConfigurationException;
public class MyComponent
implements XMLComponent {
// Constants
public static final String ERROR_REPORTER =
"http://apache.org/xml/properties/internal/error-reporter";
public static final String DOMAIN = "http://example.com/mydomain";
// XMLComponent methods
public void reset(XMLComponentManager manager)
throws XMLConfigurationException {
XMLErrorReporter reporter =
(XMLErrorReporter)manager.getProperty(ERROR_REPORTER);
if (reporter.getMessageFormatter(DOMAIN) == null) {
reporter.putMesssageFormatter(DOMAIN, new MyFormatter());
}
}
}]]></source>
<p>
<strong>Note:</strong>
It is <em>strongly</em> encouraged that any new error domains
that you create follow the standard URI syntax. While there is
no requirement that the URI must point to an actual resource on
the Internet, it is a common way to separate domains and it
provides more useful information to the application.
</p>
<p>
<strong>Note:</strong>
Nearly all of the standard components depend on this component.
Therefore, if you write a parser configuration that re-uses any
of the standard components, you must have an instance of this
component registered with the appropriate property identifier.
</p>
</s2>
<anchor name='document-scanner'/>
<s2 title='Document Scanner'>
<p>Property information:</p>
<table>
<tr>
<th>Property Id</th>
<td>http://apache.org/xml/properties/internal/document-scanner</td>
</tr>
<tr>
<th>Type</th>
<td>org.apache.xerces.xni.parser.XMLDocumentScanner</td>
</tr>
</table>
<p>Required properties:</p>
<ul>
<li>http://apache.org/xml/properties/internal/symbol-table</li>
<li>http://apache.org/xml/properties/internal/error-reporter</li>
<li>http://apache.org/xml/properties/internal/entity-manager</li>
<li>http://apache.org/xml/properties/internal/dtd-scanner</li>
</ul>
<p>Recognized features:</p>
<ul>
<li>http://xml.org/sax/features/namespaces</li>
<li>http://xml.org/sax/features/validation</li>
<li>http://apache.org/xml/features/nonvalidating/load-external-dtd</li>
<li>http://apache.org/xml/features/scanner/notify-char-refs</li>
<li>http://apache.org/xml/features/scanner/notify-builtin-refs</li>
</ul>
<p>
The <code>org.apache.xerces.impl.XMLDocumentScannerImpl</code>
class implements the XNI document scanner interface and is
implemented so that it can also function as a "pull" parser.
A pull parser allows the application to drive the parsing of
the document instead of having all of the document events
"pushed" to the registered handlers.
</p>
</s2>
<anchor name='dtd-scanner'/>
<s2 title='DTD Scanner'>
<p>Property information:</p>
<table>
<tr>
<th>Property Id</th>
<td>http://apache.org/xml/properties/internal/dtd-scanner</td>
</tr>
<tr>
<th>Type</th>
<td>org.apache.xerces.xni.parser.XMLDTDScanner</td>
</tr>
</table>
<p>Required properties:</p>
<ul>
<li>http://apache.org/xml/properties/internal/symbol-table</li>
<li>http://apache.org/xml/properties/internal/error-reporter</li>
<li>http://apache.org/xml/properties/internal/entity-manager</li>
</ul>
<p>Recognized features:</p>
<ul>
<li>http://xml.org/sax/features/validation</li>
<li>http://apache.org/xml/features/scanner/notify-char-refs</li>
</ul>
<p>
The <code>org.apache.xerces.impl.XMLDTDScannerImpl</code>
class implements the XNI DTD scanner interface and is
implemented so that it can also function as a "pull" parser.
A pull parser allows the application to drive the parsing of
the DTD instead of having all of the DTD events
"pushed" to the registered handlers.
</p>
</s2>
<anchor name='entity-manager'/>
<s2 title='Entity Manager'>
<p>Property information:</p>
<table>
<tr>
<th>Property Id</th>
<td>http://apache.org/xml/properties/internal/entity-manager</td>
</tr>
<tr>
<th>Type</th>
<td>org.apache.xerces.impl.XMLEntityManager</td>
</tr>
</table>
<p>Required properties:</p>
<ul>
<li>http://apache.org/xml/properties/internal/symbol-table</li>
<li>http://apache.org/xml/properties/internal/error-reporter</li>
</ul>
<p>Recognized features:</p>
<ul>
<li>http://xml.org/sax/features/validation</li>
<li>http://xml.org/sax/features/external-general-entities</li>
<li>http://xml.org/sax/features/external-parameter-entities</li>
<li>http://apache.org/xml/features/allow-java-encodings</li>
</ul>
<p>Recognized properties:</p>
<ul>
<li>http://apache.org/xml/properties/entity-resolver</li>
</ul>
<p>
Both the <link anchor='document-scanner'>Document Scanner</link>
and the <link anchor='dtd-scanner'>DTD Scanner</link> depend
on the Entity Manager. This component handles starting and
stopping entities automatically so that the scanners can continue
operation transparently even when entities go in and out of
scope.
</p>
<p>
The Entity Manager implements an Entity Scanner which is a
low-level scanner for document and DTD information. Because
the document and DTD scanners interact only with the Entity
Scanner to scan the document, the scanners are shielded from
changes caused by starting and stopping entities. Changes in
the entities being scanned happens transparently within the
Manager/Scanner combination but the scanner components are
notified of the start and end of the entity by implementing
the XMLEntityHandler interface that is only part of the
Xerces2 reference implementation.
</p>
</s2>
<anchor name='dtd-validator'/>
<s2 title='DTD Validator'>
<p>Property information:</p>
<table>
<tr>
<th>Property Id</th>
<td>http://apache.org/xml/properties/internal/validator/dtd</td>
</tr>
<tr>
<th>Type</th>
<td>org.apache.xerces.impl.dtd.XMLDTDValidator</td>
</tr>
</table>
<p>Required properties:</p>
<ul>
<li>http://apache.org/xml/properties/internal/symbol-table</li>
<li>http://apache.org/xml/properties/internal/error-reporter</li>
<!--
- NOTE: The following properties are also required but the
- validation engine is being redesigned so I'm not
- listing them in the documentation.
<li>http://apache.org/xml/properties/internal/grammar-pool</li>
<li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
-->
</ul>
<p>Recognized features:</p>
<ul>
<li>http://xml.org/sax/features/namespaces</li>
<li>http://xml.org/sax/features/validation</li>
<li>http://apache.org/xml/features/validation/dynamic</li>
</ul>
<p>
The DTD Validator performs validation of the document events that
it receives which may augment the streaming information set with
default attribute values and normalizing attribute values.
</p>
</s2>
<anchor name='namespace-binder'/>
<s2 title='Namespace Binder'>
<p>Property information:</p>
<table>
<tr>
<th>Property Id</th>
<td>http://apache.org/xml/properties/internal/namespace-binder</td>
</tr>
<tr>
<th>Type</th>
<td>org.apache.xerces.impl.XMLNamespaceBinder</td>
</tr>
</table>
<p>Required properties:</p>
<ul>
<li>http://apache.org/xml/properties/internal/symbol-table</li>
<li>http://apache.org/xml/properties/internal/error-reporter</li>
</ul>
<p>Recognized features:</p>
<ul>
<li>http://xml.org/sax/features/namespaces</li>
</ul>
<p>
The Namespace Binder is responsible for detecting namespace bindings
in the startElement/emptyElement methods and emitting appropriate
start and end prefix mapping events. Namespace binding should always
occur <em>after</em> DTD validation (since namespace bindings may
have been defaulted from an attribute declaration in the DTD) and
<em>before</em> Schema validation.
</p>
</s2>
<anchor name='schema-validator'/>
<s2 title='Schema Validator'>
<p>Property information:</p>
<table>
<tr>
<th>Property Id</th>
<td>http://apache.org/xml/properties/internal/validator/schema</td>
</tr>
<tr>
<th>Type</th>
<td>org.apache.xerces.impl.xs.XMLSchemaValidator</td>
</tr>
</table>
<p>Required properties:</p>
<ul>
<li>http://apache.org/xml/properties/internal/symbol-table</li>
<li>http://apache.org/xml/properties/internal/error-reporter</li>
<!--
- NOTE: The following properties are also required but the
- validation engine is being redesigned so I'm not
- listing them in the documentation.
<li>http://apache.org/xml/properties/internal/grammar-pool</li>
<li>http://apache.org/xml/properties/internal/datatype-validator-factory</li>
-->
</ul>
<p>Recognized features:</p>
<ul>
<li>http://xml.org/sax/features/namespaces</li>
<li>http://xml.org/sax/features/validation</li>
<li>http://apache.org/xml/features/validation/dynamic</li>
</ul>
<p>
The Schema Validator performs validation of the document events that
it receives which may augment the streaming information set with
default simple type values and normalizing simple type values.
</p>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/xni.xml
Index: xni.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE s1 SYSTEM 'dtd/document.dtd'>
<s1 title='Xerces Native Interface'>
<s2 title='Overview'>
<p>
The Xerces Native Interface (XNI) is a framework for communicating
a "streaming" document information set and constructing generic
parser configurations. XNI is part of the Xerces2 development but
the Xerces2 parser is just a standards compliant reference
implementation of the Xerces Native Interface. Other parsers can be
written that conform to XNI without conforming to any particular
standards or using any code from the reference implementation.
</p>
<p>
The Xerces Native Interface is used to implement the Xerces2 parser
from a set of modular components in a standard configuration. This
configuration is then used to drive the DOM and SAX parser
implementations provided with Xerces2. However, XNI is merely an
<em>internal</em> set of interfaces. There is no need for an XML
application programmer to learn XNI if they only intend to interface
to the Xerces2 parser using standard interfaces like JAXP, DOM, and
SAX. Xerces developers and application developers that need more
power and flexibility than that provided by the standard interfaces
should read and understand XNI.
</p>
<p>Overview information:</p>
<ul>
<li>
<jump href='#streaming-info-set'>"Streaming" Information
Set</jump>
</li>
<li>
<jump href='#generic-parser-configurations'>Generic Parser
Configurations</jump>
</li>
</ul>
<p>Design and implementation information:</p>
<ul>
<li><link idref='xni-design'>Design Details</link></li>
<li><link idref='xni-core'>Core Interfaces</link></li>
<li><link idref='xni-config'>Parser Configuration</link></li>
<li><link idref='xni-xerces2'>Xerces2 Parser Components</link></li>
</ul>
</s2>
<anchor name='streaming-info-set'/>
<s2 title='"Streaming" Information Set'>
<p>
What is meant by a "streaming" information set? Quite simply,
the streaming information set is the document information that can
be communicated by parsing the document in a serial manner. In
other words, it is the information received as-you-see-it. An XNI
parser provides this streaming info set to a registered document
handler. The XNI document handler is similar to the standard
SAX <code>ContentHandler</code> interface but is different in
several important ways:
</p>
<ul>
<li>
XNI attempts to provide lossless communication of the streaming
information set. Therefore, XNI passes the encodings of external
parsed entities and other information that is lost when using SAX.
</li>
<li>
The XNI document handler interface is also designed to build a
pipeline of parser components where the streaming information set
can be fully modified and augmented by each stage in the pipeline.
SAX, however, is primarilly a read-only set of interfaces.
</li>
</ul>
<p>
The Xerces Native Interface breaks the document's streaming
information set into several more manageable interfaces:
</p>
<table>
<tr><th>Interface</th><th>Description</th></tr>
<tr>
<td><code>XMLDocumentHandler</code></td>
<td>Communicates document structure and content information.</td>
</tr>
<tr>
<td><code>XMLDTDHandler</code></td>
<td>
Communicates basic DTD information such as element and attribute
declarations.
</td>
</tr>
<tr>
<td><code>XMLDTDContentModelHandler</code></td>
<td>
Breaks down each element declaration's content model into a
set of separate methods so that handlers don't have to reparse
the content model string given in the
<code>XMLDTDHandler#elementDecl(String,String)</code> method.
This separation also helps those applications that want to
know boundaries of entities when used as part of an element's
content model.
</td>
</tr>
</table>
<p>
And an additional handler is provided for convenience in defining
document fragments:
</p>
<table>
<tr><th>Interface</th><th>Description</th></tr>
<tr>
<td><code>XMLDocumentFragmentHandler</code></td>
<td>Communicates information about a document fragment.</td>
</tr>
</table>
<p>
For complete details of the Xerces Native Interface, refer to
the <link idref='xni-core'>Core Interfaces</link> documentation.
</p>
</s2>
<anchor name='generic-parser-configurations'/>
<s2 title='Generic Parser Configurations'>
<p>
The Xerces Native Interface document handler interfaces define a
document's streaming information set but XNI also contains a set
of interfaces that define parser components and configurations.
These interfaces provide a framework for a library of parser parts
that can be used interchangeably or completely replaced at the
programmer's option. This framework allows an unparalleled level
of configuration and implementation choices to implement XML
applications.
</p>
<p>
The following list details some possible examples of parsers and
configurations that can be written using the XNI parser configuration
framework:
</p>
<ul>
<li>
<strong>HTML Parser</strong><br/>
An HTML scanner can be written that breaks an HTML document into
a series of XNI callbacks. Using a configuration that swaps the
default XML scanner with the HTML scanner, you can create DOM and
SAX parsers for HTML documents.
</li>
<li>
<strong>Optimized Parser</strong><br/>
For improved XML performance, a minimal XML scanner can be written
and swapped for the default, fully compliant XML scanner. In
addition, the validator component can be removed from the parser
pipeline to reduce the amount of work required to parse XML
documents.
</li>
<li>
<strong>XInclude Processor</strong><br/>
An XNI parser component can be written to handle XInclude by
analyzing the streaming information set and automatically
inserting the contents of referenced links into the event stream.
By adding this component to the parser pipeline before the
validator, included content would appear transparent to the
validator as if that content was in the original document.
</li>
</ul>
<p>
This is just a small sample of what is possible when using the
XNI parser configuration framework. For complete details of the
XNI parser configurations, refer to the
<link idref='xni-config'>Parser Configuration</link>
documentation.
</p>
</s2>
</s1>
1.1 xml-site/sources/xerces2-j/dtd/blocks.ent
Index: blocks.ent
===================================================================
<?xml encoding='UTF-8'?>
<!-- BLOCKS ENTITY -->
<!ENTITY % blocks "p|note|ul|ol|gloss|table|source|anchor">
<!-- import the external markup.ent dtd -->
<!ENTITY % markupEntity SYSTEM "markup.ent">
%markupEntity;
<!ENTITY % content "(#PCDATA|%markup;|%links;)*">
<!ELEMENT p %content;>
<!ELEMENT note %content;>
<!ELEMENT ul (li|ol|ul)+>
<!ELEMENT ol (li|ol|ul)+>
<!ELEMENT li %content;>
<!ELEMENT gloss (label|item)+>
<!ELEMENT label %content;>
<!ELEMENT item %content;>
<!ELEMENT source (#PCDATA|link)*>
<!ELEMENT table (tr)+>
<!ELEMENT tr (tn|th|td)+>
<!ELEMENT tn EMPTY>
<!ATTLIST tn colspan CDATA "1"
rowspan CDATA "1">
<!ELEMENT th %content;>
<!ATTLIST th colspan CDATA "1"
rowspan CDATA "1">
<!ELEMENT td %content;>
<!ATTLIST td colspan CDATA "1"
rowspan CDATA "1">
1.1 xml-site/sources/xerces2-j/dtd/book.dtd
Index: book.dtd
===================================================================
<?xml encoding='UTF-8'?>
<!-- STYLEBOOK BOOK DTD -->
<!-- import the external source-specific dtd -->
<!ENTITY % externalEntity SYSTEM "entities.ent">
%externalEntity;
<!ELEMENT book (resources?|document|hidden|faqs|releases|
external|separator|settings|design)+>
<!ATTLIST book title CDATA #REQUIRED
copyright CDATA #IMPLIED>
<!ELEMENT resources EMPTY>
<!ATTLIST resources source CDATA #REQUIRED>
<!ELEMENT document EMPTY>
<!ATTLIST document label CDATA #REQUIRED
title CDATA #REQUIRED
id ID #REQUIRED
source CDATA #REQUIRED>
<!ELEMENT hidden EMPTY>
<!ATTLIST hidden title CDATA #REQUIRED
id ID #REQUIRED
source CDATA #REQUIRED>
<!ELEMENT faqs (faq+)>
<!ATTLIST faqs label CDATA #REQUIRED
title CDATA #REQUIRED
id ID #IMPLIED>
<!ELEMENT faq EMPTY>
<!ATTLIST faq title CDATA #REQUIRED
id ID #REQUIRED
source CDATA #REQUIRED>
<!ELEMENT releases EMPTY>
<!ATTLIST releases label CDATA #REQUIRED
title CDATA #REQUIRED
id ID #REQUIRED
source CDATA #REQUIRED>
<!ELEMENT external EMPTY>
<!ATTLIST external label CDATA #REQUIRED
href CDATA #REQUIRED>
<!ELEMENT separator EMPTY>
<!ELEMENT settings EMPTY>
<!ATTLIST settings label CDATA #REQUIRED
title CDATA #REQUIRED
id ID #REQUIRED
source CDATA #REQUIRED>
<!ELEMENT design EMPTY>
<!ATTLIST design title CDATA #REQUIRED
id ID #REQUIRED
source CDATA #REQUIRED>
<!-- CVS $Revision: 1.1 $ $Date: 2002/02/05 21:16:58 $ -->
1.1 xml-site/sources/xerces2-j/dtd/characters.ent
Index: characters.ent
===================================================================
<?xml encoding='UTF-8'?>
<!-- CHARACTERS ENTITY -->
<!-- Latin A -->
<!ENTITY nbsp " "> <!-- U+00A0 ISOnum - no-break space = non-breaking space -->
<!ENTITY iexcl "¡"> <!-- U+00A1 ISOnum - inverted exclamation mark -->
<!ENTITY cent "¢"> <!-- U+00A2 ISOnum - cent sign -->
<!ENTITY pound "£"> <!-- U+00A3 ISOnum - pound sign -->
<!ENTITY curren "¤"> <!-- U+00A4 ISOnum - currency sign -->
<!ENTITY yen "¥"> <!-- U+00A5 ISOnum - yen sign = yuan sign -->
<!ENTITY brvbar "¦"> <!-- U+00A6 ISOnum - broken bar = broken vertical bar -->
<!ENTITY sect "§"> <!-- U+00A7 ISOnum - section sign -->
<!ENTITY uml "¨"> <!-- U+00A8 ISOdia - diaeresis = spacing diaeresis -->
<!ENTITY copy "©"> <!-- U+00A9 ISOnum - copyright sign -->
<!ENTITY ordf "ª"> <!-- U+00AA ISOnum - feminine ordinal indicator -->
<!ENTITY laquo "«"> <!-- U+00AB ISOnum - left-pointing double angle quotation mark = left pointing guillemet -->
<!ENTITY not "¬"> <!-- U+00AC ISOnum - not sign -->
<!ENTITY shy "­"> <!-- U+00AD ISOnum - soft hyphen = discretionary hyphen -->
<!ENTITY reg "®"> <!-- U+00AE ISOnum - registered sign = registered trade mark sign -->
<!ENTITY macr "¯"> <!-- U+00AF ISOdia - macron = spacing macron = overline = APL overbar -->
<!ENTITY deg "°"> <!-- U+00B0 ISOnum - degree sign -->
<!ENTITY plusmn "±"> <!-- U+00B1 ISOnum - plus-minus sign = plus-or-minus sign -->
<!ENTITY sup2 "²"> <!-- U+00B2 ISOnum - superscript two = superscript digit two = squared -->
<!ENTITY sup3 "³"> <!-- U+00B3 ISOnum - superscript three = superscript digit three = cubed -->
<!ENTITY acute "´"> <!-- U+00B4 ISOdia - acute accent = spacing acute -->
<!ENTITY micro "µ"> <!-- U+00B5 ISOnum - micro sign -->
<!ENTITY para "¶"> <!-- U+00B6 ISOnum - pilcrow sign = paragraph sign -->
<!ENTITY middot "·"> <!-- U+00B7 ISOnum - middle dot = Georgian comma = Greek middle dot -->
<!ENTITY cedil "¸"> <!-- U+00B8 ISOdia - cedilla = spacing cedilla -->
<!ENTITY sup1 "¹"> <!-- U+00B9 ISOnum - superscript one = superscript digit one -->
<!ENTITY ordm "º"> <!-- U+00BA ISOnum - masculine ordinal indicator -->
<!ENTITY raquo "»"> <!-- U+00BB ISOnum - right-pointing double angle quotation mark = right pointing guillemet -->
<!ENTITY frac14 "¼"> <!-- U+00BC ISOnum - vulgar fraction one quarter = fraction one quarter -->
<!ENTITY frac12 "½"> <!-- U+00BD ISOnum - vulgar fraction one half = fraction one half -->
<!ENTITY frac34 "¾"> <!-- U+00BE ISOnum - vulgar fraction three quarters = fraction three quarters -->
<!ENTITY iquest "¿"> <!-- U+00BF ISOnum - inverted question mark = turned question mark -->
<!ENTITY Agrave "À"> <!-- U+00C0 ISOlat1 - latin capital letter A with grave = latin capital letter A grave -->
<!ENTITY Aacute "Á"> <!-- U+00C1 ISOlat1 - latin capital letter A with acute -->
<!ENTITY Acirc "Â"> <!-- U+00C2 ISOlat1 - latin capital letter A with circumflex -->
<!ENTITY Atilde "Ã"> <!-- U+00C3 ISOlat1 - latin capital letter A with tilde -->
<!ENTITY Auml "Ä"> <!-- U+00C4 ISOlat1 - latin capital letter A with diaeresis -->
<!ENTITY Aring "Å"> <!-- U+00C5 ISOlat1 - latin capital letter A with ring above = latin capital letter A ring -->
<!ENTITY AElig "Æ"> <!-- U+00C6 ISOlat1 - latin capital letter AE = latin capital ligature AE -->
<!ENTITY Ccedil "Ç"> <!-- U+00C7 ISOlat1 - latin capital letter C with cedilla -->
<!ENTITY Egrave "È"> <!-- U+00C8 ISOlat1 - latin capital letter E with grave -->
<!ENTITY Eacute "É"> <!-- U+00C9 ISOlat1 - latin capital letter E with acute -->
<!ENTITY Ecirc "Ê"> <!-- U+00CA ISOlat1 - latin capital letter E with circumflex -->
<!ENTITY Euml "Ë"> <!-- U+00CB ISOlat1 - latin capital letter E with diaeresis -->
<!ENTITY Igrave "Ì"> <!-- U+00CC ISOlat1 - latin capital letter I with grave -->
<!ENTITY Iacute "Í"> <!-- U+00CD ISOlat1 - latin capital letter I with acute -->
<!ENTITY Icirc "Î"> <!-- U+00CE ISOlat1 - latin capital letter I with circumflex -->
<!ENTITY Iuml "Ï"> <!-- U+00CF ISOlat1 - latin capital letter I with diaeresis -->
<!ENTITY ETH "Ð"> <!-- U+00D0 ISOlat1 - latin capital letter ETH -->
<!ENTITY Ntilde "Ñ"> <!-- U+00D1 ISOlat1 - latin capital letter N with tilde -->
<!ENTITY Ograve "Ò"> <!-- U+00D2 ISOlat1 - latin capital letter O with grave -->
<!ENTITY Oacute "Ó"> <!-- U+00D3 ISOlat1 - latin capital letter O with acute -->
<!ENTITY Ocirc "Ô"> <!-- U+00D4 ISOlat1 - latin capital letter O with circumflex -->
<!ENTITY Otilde "Õ"> <!-- U+00D5 ISOlat1 - latin capital letter O with tilde -->
<!ENTITY Ouml "Ö"> <!-- U+00D6 ISOlat1 - latin capital letter O with diaeresis -->
<!ENTITY times "×"> <!-- U+00D7 ISOnum - multiplication sign -->
<!ENTITY Oslash "Ø"> <!-- U+00D8 ISOlat1 - latin capital letter O with stroke = latin capital letter O slash -->
<!ENTITY Ugrave "Ù"> <!-- U+00D9 ISOlat1 - latin capital letter U with grave -->
<!ENTITY Uacute "Ú"> <!-- U+00DA ISOlat1 - latin capital letter U with acute -->
<!ENTITY Ucirc "Û"> <!-- U+00DB ISOlat1 - latin capital letter U with circumflex -->
<!ENTITY Uuml "Ü"> <!-- U+00DC ISOlat1 - latin capital letter U with diaeresis -->
<!ENTITY Yacute "Ý"> <!-- U+00DD ISOlat1 - latin capital letter Y with acute -->
<!ENTITY THORN "Þ"> <!-- U+00DE ISOlat1 - latin capital letter THORN -->
<!ENTITY szlig "ß"> <!-- U+00DF ISOlat1 - latin small letter sharp s = ess-zed -->
<!ENTITY agrave "à"> <!-- U+00E0 ISOlat1 - latin small letter a with grave = latin small letter a grave -->
<!ENTITY aacute "á"> <!-- U+00E1 ISOlat1 - latin small letter a with acute -->
<!ENTITY acirc "â"> <!-- U+00E2 ISOlat1 - latin small letter a with circumflex -->
<!ENTITY atilde "ã"> <!-- U+00E3 ISOlat1 - latin small letter a with tilde -->
<!ENTITY auml "ä"> <!-- U+00E4 ISOlat1 - latin small letter a with diaeresis -->
<!ENTITY aring "å"> <!-- U+00E5 ISOlat1 - latin small letter a with ring above = latin small letter a ring -->
<!ENTITY aelig "æ"> <!-- U+00E6 ISOlat1 - latin small letter ae = latin small ligature ae -->
<!ENTITY ccedil "ç"> <!-- U+00E7 ISOlat1 - latin small letter c with cedilla -->
<!ENTITY egrave "è"> <!-- U+00E8 ISOlat1 - latin small letter e with grave -->
<!ENTITY eacute "é"> <!-- U+00E9 ISOlat1 - latin small letter e with acute -->
<!ENTITY ecirc "ê"> <!-- U+00EA ISOlat1 - latin small letter e with circumflex -->
<!ENTITY euml "ë"> <!-- U+00EB ISOlat1 - latin small letter e with diaeresis -->
<!ENTITY igrave "ì"> <!-- U+00EC ISOlat1 - latin small letter i with grave -->
<!ENTITY iacute "í"> <!-- U+00ED ISOlat1 - latin small letter i with acute -->
<!ENTITY icirc "î"> <!-- U+00EE ISOlat1 - latin small letter i with circumflex -->
<!ENTITY iuml "ï"> <!-- U+00EF ISOlat1 - latin small letter i with diaeresis -->
<!ENTITY eth "ð"> <!-- U+00F0 ISOlat1 - latin small letter eth -->
<!ENTITY ntilde "ñ"> <!-- U+00F1 ISOlat1 - latin small letter n with tilde -->
<!ENTITY ograve "ò"> <!-- U+00F2 ISOlat1 - latin small letter o with grave -->
<!ENTITY oacute "ó"> <!-- U+00F3 ISOlat1 - latin small letter o with acute -->
<!ENTITY ocirc "ô"> <!-- U+00F4 ISOlat1 - latin small letter o with circumflex -->
<!ENTITY otilde "õ"> <!-- U+00F5 ISOlat1 - latin small letter o with tilde -->
<!ENTITY ouml "ö"> <!-- U+00F6 ISOlat1 - latin small letter o with diaeresis -->
<!ENTITY divide "÷"> <!-- U+00F7 ISOnum - division sign -->
<!ENTITY oslash "ø"> <!-- U+00F8 ISOlat1 - latin small letter o with stroke = latin small letter o slash -->
<!ENTITY ugrave "ù"> <!-- U+00F9 ISOlat1 - latin small letter u with grave -->
<!ENTITY uacute "ú"> <!-- U+00FA ISOlat1 - latin small letter u with acute -->
<!ENTITY ucirc "û"> <!-- U+00FB ISOlat1 - latin small letter u with circumflex -->
<!ENTITY uuml "ü"> <!-- U+00FC ISOlat1 - latin small letter u with diaeresis -->
<!ENTITY yacute "ý"> <!-- U+00FD ISOlat1 - latin small letter y with acute -->
<!ENTITY thorn "þ"> <!-- U+00FE ISOlat1 - latin small letter thorn -->
<!ENTITY yuml "ÿ"> <!-- U+00FF ISOlat1 - latin small letter y with diaeresis -->
<!-- C0 Controls and Basic Latin -->
<!ENTITY quot """> <!-- U+0022 ISOnum - quotation mark = APL quote -->
<!ENTITY amp "&"> <!-- U+0026 ISOnum - ampersand -->
<!ENTITY lt "<"> <!-- U+003C ISOnum - less-than sign -->
<!ENTITY gt ">"> <!-- U+003E ISOnum - greater-than sign -->
<!-- Latin Extended-A -->
<!ENTITY OElig "Œ"> <!-- U+0152 ISOlat2 - latin capital ligature OE -->
<!ENTITY oelig "œ"> <!-- U+0153 ISOlat2 - latin small ligature oe -->
<!-- ligature is a misnomer, this is a separate character in some languages -->
<!ENTITY Scaron "Š"> <!-- U+0160 ISOlat2 - latin capital letter S with caron -->
<!ENTITY scaron "š"> <!-- U+0161 ISOlat2 - latin small letter s with caron -->
<!ENTITY Yuml "Ÿ"> <!-- U+0178 ISOlat2 - latin capital letter Y with diaeresis -->
<!-- Spacing Modifier Letters -->
<!ENTITY circ "ˆ" > <!-- U+02C6 ISOpub - modifier letter circumflex accent -->
<!ENTITY tilde "˜" > <!-- U+02DC ISOdia - small tilde -->
<!-- General Punctuation -->
<!ENTITY ensp " "> <!-- U+2002 ISOpub - en space -->
<!ENTITY emsp " "> <!-- U+2003 ISOpub - em space -->
<!ENTITY thinsp " "> <!-- U+2009 ISOpub - thin space -->
<!ENTITY zwnj "‌"> <!-- U+200C RFC 2070 - zero width non-joiner -->
<!ENTITY zwj "‍"> <!-- U+200D RFC 2070 - zero width joiner -->
<!ENTITY lrm "‎"> <!-- U+200E RFC 2070 - left-to-right mark -->
<!ENTITY rlm "‏"> <!-- U+200F RFC 2070 - right-to-left mark -->
<!ENTITY ndash "–"> <!-- U+2013 ISOpub - en dash -->
<!ENTITY mdash "—"> <!-- U+2014 ISOpub - em dash -->
<!ENTITY lsquo "‘"> <!-- U+2018 ISOnum - left single quotation mark -->
<!ENTITY rsquo "’"> <!-- U+2019 ISOnum - right single quotation mark -->
<!ENTITY sbquo "‚"> <!-- U+201A NEW - single low-9 quotation mark -->
<!ENTITY ldquo "“"> <!-- U+201C ISOnum - left double quotation mark -->
<!ENTITY rdquo "”"> <!-- U+201D ISOnum - right double quotation mark, -->
<!ENTITY bdquo "„"> <!-- U+201E NEW - double low-9 quotation mark -->
<!ENTITY dagger "†"> <!-- U+2020 ISOpub - dagger -->
<!ENTITY Dagger "‡"> <!-- U+2021 ISOpub - double dagger -->
<!ENTITY permil "‰"> <!-- U+2030 ISOtech - per mille sign -->
<!ENTITY lsaquo "‹"> <!-- U+2039 ISO prop. - single left-pointing angle quotation mark -->
<!-- lsaquo is proposed but not yet ISO standardized -->
<!ENTITY rsaquo "›"> <!-- U+203A ISO prop. - single right-pointing angle quotation mark -->
<!-- rsaquo is proposed but not yet ISO standardized -->
<!ENTITY euro "€"> <!-- U+20AC NEW - euro sign -->
<!-- Latin Extended-B -->
<!ENTITY fnof "ƒ"> <!-- U+0192 ISOtech - latin small f with hook = function = florin -->
<!-- Greek -->
<!ENTITY Alpha "Α"> <!-- U+0391 - greek capital letter alpha -->
<!ENTITY Beta "Β"> <!-- U+0392 - greek capital letter beta -->
<!ENTITY Gamma "Γ"> <!-- U+0393 ISOgrk3 - greek capital letter gamma -->
<!ENTITY Delta "Δ"> <!-- U+0394 ISOgrk3 - greek capital letter delta -->
<!ENTITY Epsilon "Ε"> <!-- U+0395 - greek capital letter epsilon -->
<!ENTITY Zeta "Ζ"> <!-- U+0396 - greek capital letter zeta -->
<!ENTITY Eta "Η"> <!-- U+0397 - greek capital letter eta -->
<!ENTITY Theta "Θ"> <!-- U+0398 ISOgrk3 - greek capital letter theta -->
<!ENTITY Iota "Ι"> <!-- U+0399 - greek capital letter iota -->
<!ENTITY Kappa "Κ"> <!-- U+039A - greek capital letter kappa -->
<!ENTITY Lambda "Λ"> <!-- U+039B ISOgrk3 - greek capital letter lambda -->
<!ENTITY Mu "Μ"> <!-- U+039C - greek capital letter mu -->
<!ENTITY Nu "Ν"> <!-- U+039D - greek capital letter nu -->
<!ENTITY Xi "Ξ"> <!-- U+039E ISOgrk3 - greek capital letter xi -->
<!ENTITY Omicron "Ο"> <!-- U+039F - greek capital letter omicron -->
<!ENTITY Pi "Π"> <!-- U+03A0 ISOgrk3 - greek capital letter pi -->
<!ENTITY Rho "Ρ"> <!-- U+03A1 - greek capital letter rho -->
<!ENTITY Sigma "Σ"> <!-- U+03A3 ISOgrk3 - greek capital letter sigma -->
<!ENTITY Tau "Τ"> <!-- U+03A4 - greek capital letter tau -->
<!ENTITY Upsilon "Υ"> <!-- U+03A5 ISOgrk3 - greek capital letter upsilon -->
<!ENTITY Phi "Φ"> <!-- U+03A6 ISOgrk3 - greek capital letter phi -->
<!ENTITY Chi "Χ"> <!-- U+03A7 - greek capital letter chi -->
<!ENTITY Psi "Ψ"> <!-- U+03A8 ISOgrk3 - greek capital letter psi -->
<!ENTITY Omega "Ω"> <!-- U+03A9 ISOgrk3 - greek capital letter omega -->
<!ENTITY alpha "α"> <!-- U+03B1 ISOgrk3 - greek small letter alpha -->
<!ENTITY beta "β"> <!-- U+03B2 ISOgrk3 - greek small letter beta -->
<!ENTITY gamma "γ"> <!-- U+03B3 ISOgrk3 - greek small letter gamma -->
<!ENTITY delta "δ"> <!-- U+03B4 ISOgrk3 - greek small letter delta -->
<!ENTITY epsilon "ε"> <!-- U+03B5 ISOgrk3 - greek small letter epsilon -->
<!ENTITY zeta "ζ"> <!-- U+03B6 ISOgrk3 - greek small letter zeta -->
<!ENTITY eta "η"> <!-- U+03B7 ISOgrk3 - greek small letter eta -->
<!ENTITY theta "θ"> <!-- U+03B8 ISOgrk3 - greek small letter theta -->
<!ENTITY iota "ι"> <!-- U+03B9 ISOgrk3 - greek small letter iota -->
<!ENTITY kappa "κ"> <!-- U+03BA ISOgrk3 - greek small letter kappa -->
<!ENTITY lambda "λ"> <!-- U+03BB ISOgrk3 - greek small letter lambda -->
<!ENTITY mu "μ"> <!-- U+03BC ISOgrk3 - greek small letter mu -->
<!ENTITY nu "ν"> <!-- U+03BD ISOgrk3 - greek small letter nu -->
<!ENTITY xi "ξ"> <!-- U+03BE ISOgrk3 - greek small letter xi -->
<!ENTITY omicron "ο"> <!-- U+03BF NEW - greek small letter omicron -->
<!ENTITY pi "π"> <!-- U+03C0 ISOgrk3 - greek small letter pi -->
<!ENTITY rho "ρ"> <!-- U+03C1 ISOgrk3 - greek small letter rho -->
<!ENTITY sigmaf "ς"> <!-- U+03C2 ISOgrk3 - greek small letter final sigma -->
<!ENTITY sigma "σ"> <!-- U+03C3 ISOgrk3 - greek small letter sigma -->
<!ENTITY tau "τ"> <!-- U+03C4 ISOgrk3 - greek small letter tau -->
<!ENTITY upsilon "υ"> <!-- U+03C5 ISOgrk3 - greek small letter upsilon -->
<!ENTITY phi "φ"> <!-- U+03C6 ISOgrk3 - greek small letter phi -->
<!ENTITY chi "χ"> <!-- U+03C7 ISOgrk3 - greek small letter chi -->
<!ENTITY psi "ψ"> <!-- U+03C8 ISOgrk3 - greek small letter psi -->
<!ENTITY omega "ω"> <!-- U+03C9 ISOgrk3 - greek small letter omega -->
<!ENTITY thetasym "ϑ"> <!-- U+03D1 NEW - greek small letter theta symbol -->
<!ENTITY upsih "ϒ"> <!-- U+03D2 NEW - greek upsilon with hook symbol -->
<!ENTITY piv "ϖ"> <!-- U+03D6 ISOgrk3 - greek pi symbol -->
<!-- General Punctuation -->
<!ENTITY bull "•"> <!-- U+2022 ISOpub - bullet = black small circle -->
<!ENTITY hellip "…"> <!-- U+2026 ISOpub - horizontal ellipsis = three dot leader -->
<!ENTITY prime "′"> <!-- U+2032 ISOtech - prime = minutes = feet -->
<!ENTITY Prime "″"> <!-- U+2033 ISOtech - double prime = seconds = inches -->
<!ENTITY oline "‾"> <!-- U+203E NEW - overline = spacing overscore -->
<!ENTITY frasl "⁄"> <!-- U+2044 NEW - fraction slash -->
<!-- Letterlike Symbols -->
<!ENTITY weierp "℘"> <!-- U+2118 ISOamso - script capital P = power set = Weierstrass p -->
<!ENTITY image "ℑ"> <!-- U+2111 ISOamso - blackletter capital I = imaginary part -->
<!ENTITY real "ℜ"> <!-- U+211C ISOamso - blackletter capital R = real part symbol -->
<!ENTITY trade "™"> <!-- U+2122 ISOnum - trade mark sign -->
<!ENTITY alefsym "ℵ"> <!-- U+2135 NEW - alef symbol = first transfinite cardinal -->
<!-- Arrows -->
<!ENTITY larr "←"> <!-- U+2190 ISOnum - leftwards arrow -->
<!ENTITY uarr "↑"> <!-- U+2191 ISOnum - upwards arrow -->
<!ENTITY rarr "→"> <!-- U+2192 ISOnum - rightwards arrow -->
<!ENTITY darr "↓"> <!-- U+2193 ISOnum - downwards arrow -->
<!ENTITY harr "↔"> <!-- U+2194 ISOamsa - left right arrow -->
<!ENTITY crarr "↵"> <!-- U+21B5 NEW - downwards arrow with corner leftwards = carriage return -->
<!ENTITY lArr "⇐"> <!-- U+21D0 ISOtech - leftwards double arrow -->
<!ENTITY uArr "⇑"> <!-- U+21D1 ISOamsa - upwards double arrow -->
<!ENTITY rArr "⇒"> <!-- U+21D2 ISOtech - rightwards double arrow -->
<!ENTITY dArr "⇓"> <!-- U+21D3 ISOamsa - downwards double arrow -->
<!ENTITY hArr "⇔"> <!-- U+21D4 ISOamsa - left right double arrow -->
<!-- Mathematical Operators -->
<!ENTITY forall "∀"> <!-- U+2200 ISOtech - for all -->
<!ENTITY part "∂"> <!-- U+2202 ISOtech - partial differential -->
<!ENTITY exist "∃"> <!-- U+2203 ISOtech - there exists -->
<!ENTITY empty "∅"> <!-- U+2205 ISOamso - empty set = null set = diameter -->
<!ENTITY nabla "∇"> <!-- U+2207 ISOtech - nabla = backward difference -->
<!ENTITY isin "∈"> <!-- U+2208 ISOtech - element of -->
<!ENTITY notin "∉"> <!-- U+2209 ISOtech - not an element of -->
<!ENTITY ni "∋"> <!-- U+220B ISOtech - contains as member -->
<!ENTITY prod "∏"> <!-- U+220F ISOamsb - n-ary product = product sign -->
<!ENTITY sum "∑"> <!-- U+2211 ISOamsb - n-ary sumation -->
<!ENTITY minus "−"> <!-- U+2212 ISOtech - minus sign -->
<!ENTITY lowast "∗"> <!-- U+2217 ISOtech - asterisk operator -->
<!ENTITY radic "√"> <!-- U+221A ISOtech - square root = radical sign -->
<!ENTITY prop "∝"> <!-- U+221D ISOtech - proportional to -->
<!ENTITY infin "∞"> <!-- U+221E ISOtech - infinity -->
<!ENTITY ang "∠"> <!-- U+2220 ISOamso - angle -->
<!ENTITY and "∧"> <!-- U+2227 ISOtech - logical and = wedge -->
<!ENTITY or "∨"> <!-- U+2228 ISOtech - logical or = vee -->
<!ENTITY cap "∩"> <!-- U+2229 ISOtech - intersection = cap -->
<!ENTITY cup "∪"> <!-- U+222A ISOtech - union = cup -->
<!ENTITY int "∫"> <!-- U+222B ISOtech - integral -->
<!ENTITY there4 "∴"> <!-- U+2234 ISOtech - therefore -->
<!ENTITY sim "∼"> <!-- U+223C ISOtech - tilde operator = varies with = similar to -->
<!ENTITY cong "≅"> <!-- U+2245 ISOtech - approximately equal to -->
<!ENTITY asymp "≈"> <!-- U+2248 ISOamsr - almost equal to = asymptotic to -->
<!ENTITY ne "≠"> <!-- U+2260 ISOtech - not equal to -->
<!ENTITY equiv "≡"> <!-- U+2261 ISOtech - identical to -->
<!ENTITY le "≤"> <!-- U+2264 ISOtech - less-than or equal to -->
<!ENTITY ge "≥"> <!-- U+2265 ISOtech - greater-than or equal to -->
<!ENTITY sub "⊂"> <!-- U+2282 ISOtech - subset of -->
<!ENTITY sup "⊃"> <!-- U+2283 ISOtech - superset of -->
<!ENTITY nsub "⊄"> <!-- U+2284 ISOamsn - not a subset of -->
<!ENTITY sube "⊆"> <!-- U+2286 ISOtech - subset of or equal to -->
<!ENTITY supe "⊇"> <!-- U+2287 ISOtech - superset of or equal to -->
<!ENTITY oplus "⊕"> <!-- U+2295 ISOamsb - circled plus = direct sum -->
<!ENTITY otimes "⊗"> <!-- U+2297 ISOamsb - circled times = vector product -->
<!ENTITY perp "⊥"> <!-- U+22A5 ISOtech - up tack = orthogonal to = perpendicular -->
<!ENTITY sdot "⋅"> <!-- U+22C5 ISOamsb - dot operator -->
<!-- Miscellaneous Technical -->
<!ENTITY lceil "⌈"> <!-- U+2308 ISOamsc - left ceiling = apl upstile -->
<!ENTITY rceil "⌉"> <!-- U+2309 ISOamsc - right ceiling -->
<!ENTITY lfloor "⌊"> <!-- U+230A ISOamsc - left floor = apl downstile -->
<!ENTITY rfloor "⌋"> <!-- U+230B ISOamsc - right floor -->
<!ENTITY lang "〈"> <!-- U+2329 ISOtech - left-pointing angle bracket = bra -->
<!ENTITY rang "〉"> <!-- U+232A ISOtech - right-pointing angle bracket = ket -->
<!-- Geometric Shapes -->
<!ENTITY loz "◊"> <!-- U+25CA ISOpub - lozenge -->
<!-- Miscellaneous Symbols -->
<!ENTITY spades "♠"> <!-- U+2660 ISOpub - black spade suit -->
<!ENTITY clubs "♣"> <!-- U+2663 ISOpub - black club suit = shamrock -->
<!ENTITY hearts "♥"> <!-- U+2665 ISOpub - black heart suit = valentine -->
<!ENTITY diams "♦"> <!-- U+2666 ISOpub - black diamond suit -->
<!-- CVS $Revision: 1.1 $ $Date: 2002/02/05 21:16:58 $ -->
<!-- Portions (C) International Organization for Standardization 1986
Permission to copy in any form is granted for use with
conforming SGML systems and applications as defined in
ISO 8879, provided this notice is included in all copies. -->
1.1 xml-site/sources/xerces2-j/dtd/design.dtd
Index: design.dtd
===================================================================
<?xml encoding='UTF-8'?>
<!-- $Id: design.dtd,v 1.1 2002/02/05 21:16:58 neilg Exp $ -->
<!-- overall organization -->
<!ELEMENT design (note*,types*,category*)>
<!ATTLIST design name CDATA #IMPLIED
date CDATA #IMPLIED>
<!ELEMENT date (#PCDATA)>
<!ELEMENT types (category)*>
<!ELEMENT category (note*,(class|interface)*)>
<!ATTLIST category name CDATA #REQUIRED
package NMTOKEN #IMPLIED
>
<!-- markup -->
<!ELEMENT note (#PCDATA)>
<!-- types -->
<!ENTITY % types 'array|primitive|reference|collection'>
<!ELEMENT array (note*,(primitive|reference))>
<!ATTLIST array dimension CDATA '1'>
<!ELEMENT primitive EMPTY>
<!ATTLIST primitive type (long|int|short|byte|char|boolean) #REQUIRED>
<!ELEMENT reference EMPTY>
<!ATTLIST reference idref IDREF #REQUIRED>
<!ELEMENT collection (note*,collector,items)>
<!ELEMENT collector (%types;)>
<!ELEMENT items (%types;)>
<!ELEMENT union (note?,part,part+)>
<!ELEMENT part (note?,(%types;)*)>
<!-- sections -->
<!ENTITY % visibility 'public|private|protected'>
<!ELEMENT constant (note*,(%types;))>
<!ATTLIST constant name NMTOKEN #REQUIRED
value CDATA #IMPLIED
visibility (%visibility;) 'public'
>
<!ELEMENT field (note*,(%types;))>
<!ATTLIST field name NMTOKEN #REQUIRED
visibility (%visibility;) 'protected'
>
<!ELEMENT constructor (note*,param*,throws*)>
<!ATTLIST constructor visibility (%visibility;) 'public'>
<!ELEMENT method (note*,param*,returns?,throws*)>
<!ATTLIST method name NMTOKEN #REQUIRED
visibility (%visibility;) 'public'
>
<!ELEMENT param (note*,(%types;))>
<!ATTLIST param name NMTOKEN #REQUIRED>
<!ELEMENT returns (note*,(%types;))>
<!ELEMENT throws (note*,reference)>
<!-- objects -->
<!ELEMENT class (note*,extends?,implements*,constant*,field*,constructor*,method*)>
<!ATTLIST class id ID #REQUIRED
name NMTOKEN #REQUIRED
visibility (%visibility;) #FIXED 'public'
>
<!ELEMENT interface (note*,extends*,constant*,method*)>
<!ATTLIST interface id ID #REQUIRED
name NMTOKEN #REQUIRED
visibility (%visibility;) #FIXED 'public'
>
<!ELEMENT extends (note*,reference)>
<!ELEMENT implements (note*,reference)>
1.1 xml-site/sources/xerces2-j/dtd/document.dtd
Index: document.dtd
===================================================================
<?xml encoding='UTF-8'?>
<!-- STYLEBOOK DOCUMENT DTD -->
<!-- import the external blocks.ent dtd -->
<!ENTITY % blocksEntity SYSTEM "blocks.ent">
%blocksEntity;
<!ELEMENT s1 (s2|%blocks;)*>
<!ELEMENT s2 (s3|%blocks;)*>
<!ELEMENT s3 (s4|%blocks;)*>
<!ELEMENT s4 (%blocks;)*>
<!ATTLIST s1 title CDATA #REQUIRED>
<!ATTLIST s2 title CDATA #REQUIRED>
<!ATTLIST s3 title CDATA #REQUIRED>
<!ATTLIST s4 title CDATA #REQUIRED>
<!-- CVS $Revision: 1.1 $ $Date: 2002/02/05 21:16:58 $ -->
1.1 xml-site/sources/xerces2-j/dtd/entities.ent
Index: entities.ent
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!-- upper case versions of names and versions -->
<!ENTITY ParserNameLong 'Xerces2 Java Parser'>
<!ENTITY ParserName 'Xerces-J'>
<!ENTITY ParserVersion '@@VERSION@@'>
<!-- lower case versions of names and versions -->
<!ENTITY parsername 'xerces-j'>
<!ENTITY parserversion '@@version@@'>
<!-- packaging names -->
<!ENTITY parserdir 'xerces-@@_version_@@'>
<!ENTITY parserdistname 'Xerces-J-bin'>
1.1 xml-site/sources/xerces2-j/dtd/faqs.dtd
Index: faqs.dtd
===================================================================
<?xml encoding='UTF-8'?>
<!-- STYLEBOOK FAQS DTD -->
<!-- import the external blocks.ent dtd -->
<!ENTITY % blocksEntity SYSTEM "blocks.ent">
%blocksEntity;
<!ELEMENT faqs (faq)+>
<!ATTLIST faqs title CDATA #REQUIRED>
<!ELEMENT faq (q,a)>
<!ATTLIST faq title CDATA #IMPLIED>
<!ELEMENT q (#PCDATA)>
<!ELEMENT a (%blocks;)+>
<!-- CVS $Revision: 1.1 $ $Date: 2002/02/05 21:16:58 $ -->
1.1 xml-site/sources/xerces2-j/dtd/links.ent
Index: links.ent
===================================================================
<?xml encoding='UTF-8'?>
<!-- LINKS ENTITY -->
<!ENTITY % links "link|anchor|jump|img|resource-ref|human-resource-ref">
<!ELEMENT anchor EMPTY>
<!ATTLIST anchor name NMTOKEN #REQUIRED>
<!ELEMENT img EMPTY>
<!ATTLIST img src CDATA #REQUIRED
alt CDATA #REQUIRED>
<!ELEMENT link (#PCDATA|img)*>
<!ATTLIST link idref NMTOKEN #IMPLIED
anchor CDATA #IMPLIED>
<!ELEMENT jump (#PCDATA|img)*>
<!ATTLIST jump href CDATA #REQUIRED>
<!-- cross-reference resource elements -->
<!ELEMENT resource-ref EMPTY>
<!ATTLIST resource-ref idref CDATA #REQUIRED>
<!ELEMENT human-resource-ref EMPTY>
<!ATTLIST human-resource-ref idref CDATA #REQUIRED>
1.1 xml-site/sources/xerces2-j/dtd/markup.ent
Index: markup.ent
===================================================================
<?xml encoding='UTF-8'?>
<!-- MARKUP ENTITY -->
<!ENTITY % markup "em|strong|ref|code|br">
<!-- import the external source-specific dtd -->
<!ENTITY % externalEntity SYSTEM "entities.ent">
%externalEntity;
<!-- import the external charecters.ent dtd -->
<!ENTITY % charEntity SYSTEM "characters.ent">
%charEntity;
<!-- import the external links.ent dtd -->
<!ENTITY % linksEntity SYSTEM "links.ent">
%linksEntity;
<!ELEMENT em (#PCDATA|%links;)*>
<!ELEMENT strong (#PCDATA|%links;)*>
<!ELEMENT ref (#PCDATA|%links;)*>
<!ELEMENT code (#PCDATA|%links;)*>
<!ELEMENT br EMPTY>
<!-- CVS $Revision: 1.1 $ $Date: 2002/02/05 21:16:58 $ -->
1.1 xml-site/sources/xerces2-j/dtd/releases.dtd
Index: releases.dtd
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!ENTITY % include.blocks SYSTEM 'blocks.ent'>
%include.blocks;
<!ELEMENT desc (#PCDATA|%blocks;|%markup;|%links;)*>
<!ELEMENT note (#PCDATA|%markup;)*>
<!ELEMENT releases (desc?,release+)>
<!ELEMENT release (desc?,changes?)>
<!ATTLIST release version CDATA #REQUIRED
date CDATA #IMPLIED>
<!ELEMENT changes (add|remove|fix|update)+>
<!ELEMENT add (note,submitter?)>
<!ELEMENT remove (note,submitter?)>
<!ELEMENT fix (note,submitter?)>
<!ELEMENT update (note,submitter?)>
<!ELEMENT submitter EMPTY>
<!ATTLIST submitter name CDATA #REQUIRED
mailto CDATA #IMPLIED>
1.1 xml-site/sources/xerces2-j/dtd/settings.dtd
Index: settings.dtd
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!ENTITY % include.blocks SYSTEM 'blocks.ent'>
<!ENTITY % include.markup SYSTEM 'markup.ent'>
%include.blocks;
%include.markup;
<!ENTITY % boolean '(true|false)'>
<!ENTITY % access-options '(read-only|read-write|write-only)'>
<!ELEMENT settings (features,properties)>
<!ELEMENT features (desc?,(fcategory+|feature+)?)>
<!ELEMENT properties (desc?,(pcategory+|property+)?)>
<!ELEMENT desc (#PCDATA|%markup;|%blocks;)*>
<!ATTLIST desc name CDATA #IMPLIED>
<!ELEMENT note (#PCDATA|%markup;)*>
<!ELEMENT fcategory (desc?,feature+)>
<!ATTLIST fcategory name CDATA #REQUIRED>
<!ELEMENT pcategory (desc?,property+)>
<!ATTLIST pcategory name CDATA #REQUIRED>
<!ELEMENT access EMPTY>
<!ATTLIST access general %access-options; #IMPLIED
parsing %access-options; #IMPLIED
not-parsing %access-options; #IMPLIED>
<!ELEMENT see EMPTY>
<!ATTLIST see idref IDREF #REQUIRED>
<!ELEMENT feature (desc?,true,false,default?,access?,note*,see*)>
<!ATTLIST feature name CDATA #REQUIRED
id ID #IMPLIED>
<!ELEMENT true (#PCDATA|%markup;)*>
<!ELEMENT false (#PCDATA|%markup;)*>
<!ELEMENT default EMPTY>
<!ATTLIST default value CDATA #REQUIRED>
<!ELEMENT property (desc?,type,default?,access?,note*,see*)>
<!ATTLIST property name CDATA #REQUIRED
id ID #IMPLIED>
<!ELEMENT type (#PCDATA)>
1.1 xml-site/sources/xerces2-j/style/graphics/button-a.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/graphics/button-b.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/loader.xml
Index: loader.xml
===================================================================
<?xml version="1.0"?>
<!-- CVS $Revision: 1.1 $ $Date: 2002/02/05 21:16:58 $ -->
<loader>
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/book2project.xsl"/>
</processor>
</loader>
1.1 xml-site/sources/xerces2-j/style/resources/bottom.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/button-asf-hi.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/button-asf-lo.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/button-w3c-hi.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/button-w3c-lo.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/button-xml-hi.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/button-xml-lo.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/changes-add.jpg
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/changes-fix.jpg
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/changes-remove.jpg
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/changes-update.jpg
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/close.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/dot.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/join.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/line.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/logo.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/note.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/right.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/script.js
Index: script.js
===================================================================
rolloverImagesOn=new Array();
rolloverImagesOff=new Array();
function rolloverOn(name) {
if(rolloverImagesOn[name]){
document.images[name].src=rolloverImagesOn[name].src;
}
}
function rolloverOff(name) {
if(rolloverImagesOff[name]){
document.images[name].src=rolloverImagesOff[name].src;
}
}
function rolloverLoad(name,on,off) {
rolloverImagesOn[name]=new Image();
rolloverImagesOn[name].src=on;
rolloverImagesOff[name]=new Image();
rolloverImagesOff[name].src=off;
}
1.1 xml-site/sources/xerces2-j/style/resources/separator.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/resources/void.gif
<<Binary file>>
1.1 xml-site/sources/xerces2-j/style/stylesheets/any2header.xsl
Index: any2header.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="label"/>
<xsl:template match='/'>
<image width="456" height="35" bgcolor="0086b2">
<text font="Arial" size="29" x="454" y="8" halign="right" valign="top" color="004080"
text="{label}"/>
<text font="Arial" size="29" x="452" y="6" halign="right" valign="top" color="ffffff"
text="{$label}"/>
</image>
</xsl:template>
<!--
<xsl:template match="/">
<image width="456" height="35" bgcolor="0086b2">
<xsl:apply-templates/>
</image>
</xsl:template>
<xsl:template match="s1|faqs|releases|features|properties">
<xsl:variable name="title">
<xsl:if test="string-length(@title)=0">
<xsl:value-of select="$label"/>
</xsl:if>
<xsl:if test="string-length(@title)>0">
<xsl:value-of select="@title"/>
</xsl:if>
</xsl:variable>
<text font="Arial" size="29" x="454" y="8" halign="right" valign="top" color="004080"
text="{$title}"/>
<text font="Arial" size="29" x="452" y="6" halign="right" valign="top" color="ffffff"
text="{$title}"/>
</xsl:template>
-->
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/any2project.xsl
Index: any2project.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="label"/>
<xsl:template match="/">
<project>
<xsl:apply-templates/>
</project>
</xsl:template>
<xsl:template match="img">
<resource source="{@src}" target="images/{@src}"/>
</xsl:template>
<xsl:template match="node()">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/book2group.xsl
Index: book2group.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="id"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="book">
<group title="{faqs[attribute::id=$id]/@label}">
<xsl:apply-templates select="faqs[attribute::id=$id]/faq"/>
</group>
</xsl:template>
<xsl:template match="faq">
<entry id="{@id}" title="{document(concat('sbk:/sources/',@source))/faqs/@title}">
<xsl:apply-templates
select="document(concat('sbk:/sources/',@source))/faqs/faq"
mode='faqs-faq'/>
</entry>
</xsl:template>
<xsl:template match="faq" mode='faqs-faq'>
<voice>
<xsl:if test="string-length(@title)=0">
<xsl:value-of select="q"/>
</xsl:if>
<xsl:if test="string-length(@title)>0">
<xsl:value-of select="@title"/>
</xsl:if>
</voice>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/book2project.xsl
Index: book2project.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- match the root book element -->
<xsl:template match="/book">
<project>
<parameter name="copyright" value="{@copyright}"/>
<!-- copy all resources to the targets -->
<process source="sbk:/style/resources/" producer="directory">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/directory2project.xsl"/>
<parameter name="base" value="resources/"/>
</processor>
</process>
<xsl:apply-templates/>
</project>
</xsl:template>
<!-- ********************************************************************** -->
<!-- CREATE THE TARGET HTML -->
<!-- ********************************************************************** -->
<xsl:template match="document">
<process source="{@source}" producer="parser">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
</processor>
</process>
<xsl:call-template name="header">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="source" select="@source"/>
<xsl:with-param name="label" select="@title"/>
</xsl:call-template>
<xsl:call-template name="labels">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="label" select="@label"/>
</xsl:call-template>
<create source="{@source}" target="{@id}.html" producer="parser" printer="html">
<processor name="xslt">
<parameter name="id" value="{@id}"/>
<parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
</processor>
</create>
</xsl:template>
<xsl:template match="hidden">
<process source="{@source}" producer="parser">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
</processor>
</process>
<xsl:call-template name="header">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="source" select="@source"/>
<xsl:with-param name="label" select="@title"/>
</xsl:call-template>
<create source="{@source}" target="{@id}.html" producer="parser" printer="html">
<processor name="xslt">
<parameter name="id" value="{@id}"/>
<parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
</processor>
</create>
</xsl:template>
<xsl:template match="design">
<process source="{@source}" producer="parser">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
</processor>
</process>
<xsl:call-template name="header">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="source" select="@source"/>
<xsl:with-param name="label" select="@title"/>
</xsl:call-template>
<create source="{@source}" target="{@id}.html" producer="parser" printer="html">
<processor name="xslt">
<parameter name="id" value="{@id}"/>
<parameter name="stylesheet" value="sbk:/style/stylesheets/design2document.xsl"/>
</processor>
<processor name="xslt">
<parameter name="id" value="{@id}"/>
<parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
</processor>
</create>
</xsl:template>
<xsl:template match="settings">
<process source="{@source}" producer="parser">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
</processor>
</process>
<xsl:call-template name="header">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="source" select="@source"/>
<xsl:with-param name="label" select="@title"/>
</xsl:call-template>
<xsl:call-template name="labels">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="label" select="@label"/>
</xsl:call-template>
<create source="{@source}" target="{@id}.html" producer="parser" printer="html">
<processor name="xslt">
<parameter name="id" value="{@id}"/>
<parameter name="stylesheet" value="sbk:/style/stylesheets/settings2document.xsl"/>
</processor>
<processor name="xslt">
<parameter name="id" value="{@id}"/>
<parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
</processor>
</create>
</xsl:template>
<xsl:template match="releases">
<process source="{@source}" producer="parser">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
</processor>
</process>
<xsl:call-template name="header">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="source" select="@source"/>
<xsl:with-param name="label" select="@title"/>
</xsl:call-template>
<xsl:call-template name="labels">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="label" select="@label"/>
</xsl:call-template>
<create source="{@source}" target="{@id}.html" producer="parser" printer="html">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/releases2document.xsl"/>
</processor>
<processor name="xslt">
<parameter name="id" value="{@id}"/>
<parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
</processor>
</create>
</xsl:template>
<xsl:template match="faqs">
<xsl:apply-templates/>
<xsl:call-template name="header">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="source" select="@source"/>
<xsl:with-param name="label" select="@title"/>
</xsl:call-template>
<xsl:call-template name="labels">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="label" select="@label"/>
</xsl:call-template>
<create source="" target="{@id}.html" producer="project" printer="html">
<parameter name="id" value="{@id}"/>
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/book2group.xsl"/>
</processor>
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/group2document.xsl"/>
</processor>
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
</processor>
</create>
</xsl:template>
<xsl:template match="faq">
<process source="{@source}" producer="parser">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/any2project.xsl"/>
</processor>
</process>
<xsl:call-template name="header">
<xsl:with-param name="id" select="@id"/>
<xsl:with-param name="source" select="@source"/>
<xsl:with-param name="label" select="@title"/>
</xsl:call-template>
<create source="{@source}" target="{@id}.html" producer="parser" printer="html">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/faqs2document.xsl"/>
</processor>
<processor name="xslt">
<parameter name="id" value="{@id}"/>
<parameter name="stylesheet" value="sbk:/style/stylesheets/document2html.xsl"/>
</processor>
</create>
</xsl:template>
<xsl:template match="external">
<xsl:call-template name="labels">
<xsl:with-param name="id" select="concat('ext-',position())"/>
<xsl:with-param name="label" select="@label"/>
</xsl:call-template>
</xsl:template>
<!-- ********************************************************************** -->
<!-- NAMED TEMPLATES -->
<!-- ********************************************************************** -->
<!-- Generate the doument header image -->
<xsl:template name="header">
<xsl:param name="id"/>
<xsl:param name="source"/>
<xsl:param name="label"/>
<create source="{$source}" target="graphics/{$id}-header.jpg" producer="parser" printer="image">
<processor name="xslt">
<parameter name="label" value="{$label}"/>
<parameter name="stylesheet" value="sbk:/style/stylesheets/any2header.xsl"/>
</processor>
</create>
</xsl:template>
<!-- Generate the three rollover label images -->
<xsl:template name="labels">
<xsl:param name="id"/>
<xsl:param name="label"/>
<create source="" target="graphics/{$id}-label-1.jpg" producer="context" printer="image">
<parameter name="label" value="{$label}"/>
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/context2label.xsl"/>
<parameter name="image" value="sbk:/style/graphics/button-a.gif"/>
<parameter name="color" value="ffffff"/>
</processor>
</create>
<create source="" target="graphics/{$id}-label-2.jpg" producer="context" printer="image">
<parameter name="label" value="{$label}"/>
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/context2label.xsl"/>
<parameter name="image" value="sbk:/style/graphics/button-b.gif"/>
<parameter name="color" value="ffff00"/>
</processor>
</create>
<create source="" target="graphics/{$id}-label-3.jpg" producer="context" printer="image">
<parameter name="label" value="{$label}"/>
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/context2label.xsl"/>
<parameter name="image" value="sbk:/style/graphics/button-b.gif"/>
<parameter name="color" value="ffffff"/>
</processor>
</create>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/changes2document.xsl
Index: changes2document.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="changes">
<s1 title="{@title}">
<xsl:apply-templates/>
</s1>
</xsl:template>
<xsl:template match="release">
<s2 title="Release {@version} {@date}">
<br/><xsl:apply-templates/>
</s2>
</xsl:template>
<xsl:template match="features">
<s3 title="Features">
<ul><xsl:apply-templates/></ul>
</s3>
</xsl:template>
<xsl:template match="fixes">
<s3 title="Bugs fixed">
<ul><xsl:apply-templates/></ul>
</s3>
</xsl:template>
<xsl:template match="feat|fix">
<li><xsl:apply-templates/></li>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/context2footer.xsl
Index: context2footer.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="context">
<image source="sbk:/style/graphics/footer.gif">
<xsl:apply-templates/>
</image>
</xsl:template>
<xsl:template match="parameter">
<xsl:if test="@name='copyright'">
<text font="Arial Bold" size="11" x="124" y="6" style="plain"
halign="left" valign="top" color="666699"
text="Copyright © {@value}. All Rights Reserved."/>
<text font="Arial Bold" size="11" x="123" y="5" style="plain"
halign="left" valign="top" color="333366"
text="Copyright © {@value}. All Rights Reserved."/>
<text font="Arial Bold" size="11" x="122" y="4" style="plain"
halign="left" valign="top" color="ffffff"
text="Copyright © {@value}. All Rights Reserved."/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/context2label.xsl
Index: context2label.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="image"/>
<xsl:param name="color"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="context">
<image source="{$image}">
<xsl:apply-templates/>
</image>
</xsl:template>
<xsl:template match="parameter">
<xsl:if test="@name='label'">
<text font="Arial" size="12" x="14" y="1" halign="left"
valign="top" color="{$color}" style="italic" text="{@value}"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/design2document.xsl
Index: design2document.xsl
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<!--<xsl:strip-space elements='p th td li strong em'/>-->
<xsl:template match='/design'>
<s1 title='{@name}'>
<xsl:apply-templates select='category'/>
</s1>
</xsl:template>
<xsl:template match='category'>
<s2 title='{@name}'>
<s3 title='Package {@package}'>
<xsl:apply-templates select='interface|class'/>
</s3>
</s2>
</xsl:template>
<xsl:template match='interface|class'>
<anchor name='{@id}'/>
<table>
<tr>
<th>
<xsl:choose>
<xsl:when test='name()="interface"'>
interface <em><xsl:value-of select='@name'/></em>
</xsl:when>
<xsl:otherwise>
class <strong><xsl:value-of select='@name'/></strong>
</xsl:otherwise>
</xsl:choose>
</th>
</tr>
<xsl:if test='extends'>
<tr>
<td>
extends
<xsl:for-each select='extends'>
<xsl:call-template name='type'/>
<xsl:if test='not(position()=last())'>
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:if>
<xsl:if test='implements'>
<tr>
<td>
implements
<xsl:for-each select='implements'>
<xsl:call-template name='type'/>
<xsl:if test='not(position()=last())'>
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:if>
<xsl:if test='constant'>
<tr>
<td>
constants:
<ul>
<xsl:for-each select='constant'>
<li>
<xsl:value-of select='@visibility'/>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<xsl:text> </xsl:text>
<xsl:value-of select='@name'/>
</li>
</xsl:for-each>
</ul>
</td>
</tr>
</xsl:if>
<xsl:if test='method'>
<tr>
<td>
methods:
<ul>
<xsl:for-each select='method'>
<li>
<xsl:value-of select='@visibility'/>
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test='returns'>
<xsl:apply-templates/>
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>void </xsl:otherwise>
</xsl:choose>
<xsl:value-of select='@name'/>
<xsl:text>(</xsl:text>
<xsl:for-each select='param'>
<xsl:apply-templates/>
<xsl:if test='not(position()=last())'>, </xsl:if>
</xsl:for-each>
<xsl:text>)</xsl:text>
</li>
</xsl:for-each>
</ul>
</td>
</tr>
</xsl:if>
</table>
</xsl:template>
<xsl:template match='constant|field|param'>
<xsl:call-template name='type'/>
<xsl:text> </xsl:text>
<xsl:value-of select='@name'/>
</xsl:template>
<xsl:template name='type'>
<xsl:apply-templates select='primitive|array|reference|collection'/>
</xsl:template>
<xsl:template match='primitive'>
<xsl:value-of select='@type'/>
</xsl:template>
<xsl:template match='array'>
<xsl:call-template name='type'/>[]
</xsl:template>
<xsl:template match='reference'>
<xsl:variable name='idref'><xsl:value-of select='@idref'/></xsl:variable>
<xsl:choose>
<xsl:when test='//class[@id=$idref]'>
<strong><xsl:value-of select='//*[@id=$idref]/@name'/></strong>
</xsl:when>
<xsl:otherwise>
<em><xsl:value-of select='//*[@id=$idref]/@name'/></em>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match='collection'>
COLLECTION
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/design2html.xsl
Index: design2html.xsl
===================================================================
<?xml version='1.0' encoding='US-ASCII'?>
<!-- $Id: design2html.xsl,v 1.1 2002/02/05 21:16:59 neilg Exp $ -->
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:template match='design'>
<HTML>
<HEAD>
<TITLE>Xerces 2 | Design</TITLE>
<STYLE type='text/css'>
.class { background: #DDDDFF }
.class-title { font: bold }
.interface { background: #FFDDDD }
.interface-title { font: italic }
.extends { }
.implements { }
.constants { }
.constant-title { }
.fields { }
.field-title { }
.constructors { }
.constructor-title { text-decoration: underline }
.methods { }
.method-title { text-decoration: underline }
.param-title { }
</STYLE>
</HEAD>
<BODY>
<H1 align='center'>
<xsl:value-of select='@name'/>
<xsl:text> </xsl:text>
Design
</H1>
<H2>Classes and Interfaces</H2>
<xsl:for-each select='category'>
<xsl:apply-templates select='.'/>
</xsl:for-each>
Last modified: <xsl:value-of select='@date'/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match='category'>
<H3><xsl:value-of select='@name'/></H3>
<xsl:for-each select='class|interface'>
<BLOCKQUOTE>
<xsl:apply-templates select='.'/>
</BLOCKQUOTE>
</xsl:for-each>
</xsl:template>
<xsl:template match='class|interface'>
<A name='{@name}'>
<DL class='{name()}'>
<DT>
<xsl:value-of select='name()'/>
<xsl:text> </xsl:text>
<SPAN class='{name()}-title'>
<xsl:value-of select='@name'/>
</SPAN>
</DT>
<xsl:if test='extends'>
<DD class='extends'>
extends
<xsl:for-each select='extends'>
<xsl:call-template name='type'/>
</xsl:for-each>
</DD>
</xsl:if>
<xsl:if test='implements'>
<DD class='implements'>
implements
<xsl:for-each select='implements'>
<xsl:call-template name='type'/>
<xsl:if test='not(position()=last())'>
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</DD>
</xsl:if>
<xsl:if test='constant'>
<DD class='constants'>
constants:
<UL>
<xsl:for-each select='constant'>
<LI>
<xsl:apply-templates select='.'/>
</LI>
</xsl:for-each>
</UL>
</DD>
</xsl:if>
<xsl:if test='field'>
<DD class='fields'>
fields:
<UL>
<xsl:for-each select='field'>
<LI>
<xsl:apply-templates select='.'/>
</LI>
</xsl:for-each>
</UL>
</DD>
</xsl:if>
<xsl:if test='constructor'>
<DD class='constructors'>
constructors:
<UL>
<xsl:for-each select='constructor'>
<LI>
<xsl:apply-templates select='.'/>
</LI>
</xsl:for-each>
</UL>
</DD>
</xsl:if>
<xsl:if test='method'>
<DD class='methods'>
methods:
<UL>
<xsl:for-each select='method'>
<LI>
<xsl:apply-templates select='.'/>
</LI>
</xsl:for-each>
</UL>
</DD>
</xsl:if>
</DL>
</A>
</xsl:template>
<xsl:template match='constant|field|param'>
<!--
<xsl:if test='not(name()="param") and not(@visibility="public")'>
<IMG alt='' src='{@visibility}.gif'/>
</xsl:if>
-->
<xsl:call-template name='type'/>
<xsl:text> </xsl:text>
<SPAN class='{name()}-title'>
<xsl:value-of select='@name'/>
</SPAN>
</xsl:template>
<xsl:template match='constructor'>
<!--
<xsl:if test='not(@visibility="public")'>
<IMG alt='' src='{@visibility}.gif'/>
</xsl:if>
-->
<SPAN class='constructor-title'>
<xsl:value-of select='../@name'/>
</SPAN>
(
<xsl:for-each select='param'>
<xsl:apply-templates select='.'/>
<xsl:if test='not(position()=last())'>
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
)
</xsl:template>
<xsl:template match='method'>
<!--
<xsl:if test='not(@visibility="public")'>
<IMG alt='' src='{@visibility}.gif'/>
</xsl:if>
-->
<SPAN class='method-title'>
<xsl:value-of select='@name'/>
</SPAN>
(
<xsl:for-each select='param'>
<xsl:apply-templates select='.'/>
<xsl:if test='not(position()=last())'>
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
)
<xsl:for-each select='returns'>
:
<xsl:call-template name='type'/>
</xsl:for-each>
</xsl:template>
<xsl:template name='type'>
<xsl:apply-templates select='array|primitive|reference|collection'/>
</xsl:template>
<xsl:template match='array'>
<xsl:call-template name='type'/>[]
</xsl:template>
<xsl:template match='primitive'>
<xsl:value-of select='@type'/>
</xsl:template>
<xsl:template match='union'>
<xsl:for-each select='part'>
<xsl:apply-templates select='.'/>
</xsl:for-each>
</xsl:template>
<xsl:template match='reference'>
<xsl:choose>
<xsl:when test='id(@idref)[name()="interface"]'>
<SPAN class='interface-title'>
<xsl:value-of select='id(@idref)/@name'/>
</SPAN>
</xsl:when>
<xsl:otherwise>
<SPAN class='class-title'>
<xsl:value-of select='id(@idref)/@name'/>
</SPAN>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match='collection'>
<xsl:for-each select='collector'>
<xsl:call-template name='type'/>
</xsl:for-each>
<
<xsl:for-each select='items'>
<xsl:call-template name='type'/>
</xsl:for-each>
>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/directory2project.xsl
Index: directory2project.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="base"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="directory">
<project>
<xsl:apply-templates/>
</project>
</xsl:template>
<xsl:template match="entry">
<!--xsl:if test="@directory!='true'"-->
<resource source="{@href}" target="{$base}{@href}"/>
<!--/xsl:if-->
<!-- don't copy subdir to avoid copying proprietary CVS files
<xsl:if test="@directory='true'">
<process source="{@href}" producer="directory">
<processor name="xslt">
<parameter name="stylesheet" value="sbk:/style/stylesheets/directory2project.xsl"/>
<parameter name="base" value="{$base}{@href}"/>
</processor>
</process>
</xsl:if>
-->
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/document2html.xsl
Index: document2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="stylebook.project"/>
<xsl:param name="copyright"/>
<xsl:param name="id"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s1">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8"/>
<script language="JavaScript" type="text/javascript" src="resources/script.js"/>
<title><xsl:value-of select="@title"/></title>
</head>
<body text="#000000" link="#0000ff" vlink="#0000aa" alink="#ff0000"
topmargin="4" leftmargin="4" marginwidth="4" marginheight="4"
bgcolor="#ffffff">
<!-- THE TOP BAR (HEADER) -->
<table width="620" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="135" height="60" rowspan="3" valign="top" align="left">
<img width="135" height="60" src="resources/logo.gif" hspace="0" vspace="0" border="0"/></td>
<td width="456" height="5" valign="top" align="left" colspan="4">
<img width="456" height="5" src="resources/line.gif" hspace="0" vspace="0" border="0"/></td>
<td width="29" height="60" rowspan="3" valign="top" align="left">
<img width="29" height="60" src="resources/right.gif" hspace="0" vspace="0" border="0"/></td>
</tr>
<tr>
<td width="456" height="35" valign="top" align="left" colspan="4" bgcolor="#0086b2">
<img src="graphics/{$id}-header.jpg" width="456" height="35" hspace="0" vspace="0" border="0" alt="{s1/@title}"/></td>
</tr>
<tr>
<td width="168" height="20" valign="top" align="left">
<img width="168" height="20" src="resources/bottom.gif" hspace="0" vspace="0" border="0"/></td>
<td width="96" height="20" valign="top" align="left">
<a href="http://xml.apache.org/" onMouseOver="rolloverOn('xml');" onMouseOut="rolloverOff('xml');" target="new">
<img alt="http://xml.apache.org/" width="96" height="20" src="resources/button-xml-lo.gif"
name="xml" hspace="0" vspace="0" border="0"
onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');"/>
</a>
</td>
<td width="96" height="20" valign="top" align="left">
<a href="http://www.apache.org/" onMouseOver="rolloverOn('asf');" onMouseOut="rolloverOff('asf');" target="new">
<img alt="http://www.apache.org/" width="96" height="20" src="resources/button-asf-lo.gif"
name="asf" hspace="0" vspace="0" border="0"
onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');"/>
</a>
</td>
<td width="96" height="20" valign="top" align="left">
<a href="http://www.w3.org/" onMouseOver="rolloverOn('w3c');" onMouseOut="rolloverOff('w3c');" target="new">
<img alt="http://www.w3.org/" width="96" height="20" src="resources/button-w3c-lo.gif"
name="w3c" hspace="0" vspace="0" border="0"
onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');"/>
</a>
</td>
</tr>
</table>
<!-- THE MAIN PANEL (SIDEBAR AND CONTENT) -->
<table width="620" cellspacing="0" cellpadding="0" border="0">
<tr>
<!-- THE SIDE BAR -->
<td width="120" valign="top" align="left">
<img width="120" height="14" src="resources/join.gif" hspace="0" vspace="0" border="0"/><br/>
<xsl:apply-templates select="document($stylebook.project)"/>
<img width="120" height="14" src="resources/close.gif" hspace="0" vspace="0" border="0"/><br/>
</td>
<!-- THE CONTENT PANEL -->
<td width="500" valign="top" align="left">
<table border="0" cellspacing="0" cellpadding="3">
<tr><td><xsl:apply-templates/></td></tr>
</table>
</td>
</tr>
</table><br/>
<table width="620" border="0" cellspacing="0" cellpadding="0">
<tr><td bgcolor="#0086b2"><img src="images/dot.gif" width="1" height="1"/></td></tr>
<tr>
<td align="center"><font size="-1" color="#0086b2"><i>
Copyright © <xsl:value-of select="$copyright"/>.
All Rights Reserved.
</i></font></td>
</tr>
</table>
</body>
</html>
</xsl:template>
<!-- ###################################################################### -->
<!-- book -->
<xsl:template match="book">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="document|faqs|releases|settings">
<xsl:if test="@id=$id">
<img src="graphics/{@id}-label-1.jpg" width="120" height="12" hspace="0" vspace="0" border="0" alt="{@label}"/>
</xsl:if>
<xsl:if test="@id!=$id">
<a href="{@id}.html" onMouseOver="rolloverOn('side-{@id}');" onMouseOut="rolloverOff('side-{@id}');">
<img onLoad="rolloverLoad('side-{@id}','graphics/{@id}-label-2.jpg','graphics/{@id}-label-3.jpg');"
name="side-{@id}" src="graphics/{@id}-label-3.jpg" width="120" height="12" hspace="0" vspace="0" border="0" alt="{@label}"/>
</a>
</xsl:if>
<br/>
</xsl:template>
<xsl:template match="external">
<xsl:variable name="extid" select="concat('ext-',position())"/>
<a href="{@href}" onMouseOver="rolloverOn('side-{$extid}');" onMouseOut="rolloverOff('side-{$extid}');">
<img onLoad="rolloverLoad('side-{$extid}','graphics/{$extid}-label-2.jpg','graphics/{$extid}-label-3.jpg');"
name="side-{$extid}" src="graphics/{$extid}-label-3.jpg" width="120" height="12" hspace="0" vspace="0" border="0" alt="{@label}"/>
</a>
<br/>
</xsl:template>
<xsl:template match="separator">
<img src="resources/separator.gif" width="120" height="6" hspace="0" vspace="0" border="0"/><br/>
</xsl:template>
<!-- ###################################################################### -->
<!-- document -->
<xsl:template match="s2">
<table width="494" cellspacing="0" cellpadding="0" border="0">
<tr>
<td bgcolor="666699" colspan="2" width="494">
<table width="494" cellspacing="0" cellpadding="0" border="0">
<tr>
<td bgcolor="#039acc" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#039acc" width="492" height="1"><img src="resources/void.gif" width="492" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#039acc" width="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="492">
<font size="+1" face="arial,helvetica,sanserif" color="#ffffff">
<img src="resources/void.gif" width="2" height="2" vspace="0" hspace="0" border="0"/>
<b><xsl:value-of select="@title"/></b>
</font>
</td>
<td bgcolor="#017299" width="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#017299" width="492" height="1"><img src="resources/void.gif" width="492" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#017299" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="10"> </td>
<td width="484">
<font face="arial,helvetica,sanserif" color="#000000">
<xsl:apply-templates/>
</font>
</td>
</tr>
</table>
<br/>
</xsl:template>
<xsl:template match="s3">
<table width="484" cellspacing="0" cellpadding="0" border="0">
<tr>
<td bgcolor="666699" colspan="2" width="484">
<table width="484" cellspacing="0" cellpadding="0" border="0">
<tr>
<td bgcolor="#039acc" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#039acc" width="482" height="1"><img src="resources/void.gif" width="482" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#039acc" width="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="482">
<font face="arial,helvetica,sanserif" color="#ffffff">
<img src="resources/void.gif" width="2" height="2" vspace="0" hspace="0" border="0"/>
<b><xsl:value-of select="@title"/></b>
</font>
</td>
<td bgcolor="#017299" width="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#017299" width="482" height="1"><img src="resources/void.gif" width="482" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#017299" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="10"> </td>
<td width="474">
<font size="-1" face="arial,helvetica,sanserif" color="#000000">
<xsl:apply-templates/>
</font>
</td>
</tr>
</table>
<br/>
</xsl:template>
<xsl:template match="s4">
<table width="474" cellspacing="0" cellpadding="0" border="0">
<tr>
<td bgcolor="666699" colspan="2" width="484">
<table width="474" cellspacing="0" cellpadding="0" border="0">
<tr>
<td bgcolor="#039acc" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#039acc" width="472" height="1"><img src="resources/void.gif" width="472" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#039acc" width="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="472">
<font size="-1" face="arial,helvetica,sanserif" color="#ffffff">
<img src="resources/void.gif" width="2" height="2" vspace="0" hspace="0" border="0"/>
<b><xsl:value-of select="@title"/></b>
</font>
</td>
<td bgcolor="#017299" width="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#017299" width="472" height="1"><img src="resources/void.gif" width="472" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#017299" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="10"> </td>
<td width="464">
<font size="-1" face="arial,helvetica,sanserif" color="#000000">
<xsl:apply-templates/>
</font>
</td>
</tr>
</table>
<br/>
</xsl:template>
<!-- ###################################################################### -->
<!-- blocks -->
<xsl:template match="p">
<p><xsl:apply-templates/></p>
</xsl:template>
<xsl:template match="note">
<table width="100%" cellspacing="3" cellpadding="0" border="0">
<tr>
<td width="20" valign="top">
<img src="resources/note.gif" width="20" height="24" vspace="0" hspace="0" border="0" alt="Note:"/>
</td>
<td valign="top">
<font size="-1" face="arial,helvetica,sanserif" color="#000000">
<i>
<xsl:apply-templates/>
</i>
</font>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="ul">
<ul><xsl:apply-templates/></ul>
</xsl:template>
<xsl:template match="ol">
<ol><xsl:apply-templates/></ol>
</xsl:template>
<xsl:template match="li">
<li><xsl:apply-templates/></li>
</xsl:template>
<!--Definition lists: gloss, term, label, item -->
<xsl:template match="gloss">
<dl><xsl:apply-templates/></dl>
</xsl:template>
<!-- <term> contains a single-word, multi-word or symbolic
designation which is regarded as a technical term. -->
<xsl:template match="term">
<dfn><xsl:apply-templates/></dfn>
</xsl:template>
<xsl:template match="label" priority="1">
<dt><xsl:apply-templates/></dt>
</xsl:template>
<xsl:template match="item" priority="2">
<dd>
<xsl:apply-templates/>
</dd>
</xsl:template>
<xsl:template match="source">
<div align="right">
<table width="464" cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="462" height="1"><img src="resources/void.gif" width="462" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#0086b2" width="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff" width="462">
<font size="-1"><pre><xsl:apply-templates/></pre></font>
</td>
<td bgcolor="#0086b2" width="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="462" height="1"><img src="resources/void.gif" width="462" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="1" height="1"><img src="resources/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
</xsl:template>
<xsl:template match="table">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="tr">
<tr><xsl:apply-templates/></tr>
</xsl:template>
<xsl:template match="th">
<td bgcolor="#039acc" colspan="{@colspan}" rowspan="{@rowspan}" valign="center" align="center">
<font color="#ffffff" size="-1" face="arial,helvetica,sanserif">
<b><xsl:apply-templates/></b> 
</font>
</td>
</xsl:template>
<xsl:template match="td">
<td bgcolor="#a0ddf0" colspan="{@colspan}" rowspan="{@rowspan}" valign="top" align="{@align}">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<xsl:apply-templates/> 
</font>
</td>
</xsl:template>
<xsl:template match="tn">
<td bgcolor="#ffffff" colspan="{@colspan}" rowspan="{@rowspan}">
 
</td>
</xsl:template>
<!-- ###################################################################### -->
<!-- markup -->
<xsl:template match="em">
<i><xsl:apply-templates/></i>
</xsl:template>
<xsl:template match='strong'>
<strong><xsl:apply-templates/></strong>
</xsl:template>
<xsl:template match="ref">
<i><xsl:apply-templates/></i>
</xsl:template>
<xsl:template match="code">
<!--<code><font face="courier, monospaced"><xsl:apply-templates/></font></code>-->
<code><xsl:apply-templates/></code>
</xsl:template>
<xsl:template match="br">
<br/>
</xsl:template>
<!-- ###################################################################### -->
<!-- links -->
<xsl:template match="link">
<xsl:if test="string-length(@anchor)=0">
<xsl:if test="string-length(@idref)=0">
<xsl:apply-templates/>
</xsl:if>
<xsl:if test="string-length(@idref)>0">
<a href="{@idref}.html"><xsl:apply-templates/></a>
</xsl:if>
</xsl:if>
<xsl:if test="string-length(@anchor)>0">
<xsl:if test="string-length(@idref)=0">
<a href="#{@anchor}"><xsl:apply-templates/></a>
</xsl:if>
<xsl:if test="string-length(@idref)>0">
<a href="{@idref}.html#{@anchor}"><xsl:apply-templates/></a>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="anchor">
<a name="{@name}"><xsl:comment>anchor</xsl:comment></a>
</xsl:template>
<xsl:template match="jump">
<a href="{@href}"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="img">
<xsl:choose>
<xsl:when test='starts-with(@src,"sbk:/resources/")'>
<img src='resources/{substring-after(@src,"sbk:/resources/")}'
border="0" vspace="4" hspace="4">
<xsl:if test='@alt'>
<xsl:attribute name='alt'><xsl:value-of select='@alt'/></xsl:attribute>
</xsl:if>
</img>
</xsl:when>
<xsl:otherwise>
<img src="images/{@src}" border="0" vspace="4" hspace="4">
<xsl:if test='@alt'>
<xsl:attribute name='alt'><xsl:value-of select='@alt'/></xsl:attribute>
</xsl:if>
</img>
<!--<img src="images/{@src}" border="0" vspace="4" hspace="4" align="right"/>-->
<!--<img src="{@src}" border="0"/>-->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="resource-ref">
<xsl:variable name="resourceFile"
select="document($stylebook.project)/book/resources/@source"/>
<xsl:variable name="xref" select="@idref"/>
<xsl:variable name="href"
select="document($resourceFile)/resources/resource[@id=$xref]/@location"/>
<xsl:variable name="label"
select="document($resourceFile)/resources/resource[@id=$xref]/@title"/>
<A href="{$href}" target="_top"><xsl:value-of select="$label"/></A>
</xsl:template>
<xsl:template match="human-resource-ref">
<xsl:variable name="resourceFile"
select="document($stylebook.project)/book/resources/@source"/>
<xsl:variable name="ref" select="@idref"/>
<xsl:variable name="mailto"
select="document($resourceFile)/resources/human-resource[@id=$ref]/@mailto"/>
<xsl:variable name="name"
select="document($resourceFile)/resources/human-resource[@id=$ref]/@name"/>
<A href="mailto:{$mailto}"><xsl:value-of select="$name"/></A>
</xsl:template>
<!-- ###################################################################### -->
<!-- copy
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
-->
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/faqs2document.xsl
Index: faqs2document.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="faqs">
<s1 title="{@title}">
<s2 title="Questions">
<ul>
<xsl:apply-templates select="faq" mode="index"/>
</ul>
</s2>
<s2 title="Answers">
<br/>
<xsl:apply-templates select="faq"/>
</s2>
</s1>
</xsl:template>
<xsl:template match="faq" mode="index">
<li>
<link anchor="faq-{position()}">
<xsl:if test="string-length(@title)=0">
<xsl:value-of select="q"/>
</xsl:if>
<xsl:if test="string-length(@title)>0">
<xsl:value-of select="@title"/>
</xsl:if>
</link>
</li>
</xsl:template>
<xsl:template match="faq">
<anchor name="faq-{position()}"/>
<s3 title="{q}">
<xsl:apply-templates select="a"/>
</s3>
</xsl:template>
<xsl:template match="a">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/group2document.xsl
Index: group2document.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="group">
<s1 title="{@title}">
<xsl:apply-templates/>
</s1>
</xsl:template>
<xsl:template match="entry">
<s2 title="{@title}">
<p>
Read the <link idref="{@id}"><xsl:value-of select="@title"/></link>
document or jump directly to:
</p>
<ul>
<xsl:apply-templates/>
</ul>
</s2>
</xsl:template>
<xsl:template match="voice">
<li><link idref="{ancestor::*/@id}" anchor="faq-{position()}"><xsl:apply-templates/></link></li>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/releases2document.xsl
Index: releases2document.xsl
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:template match='/releases'>
<s1 title='Releases'>
<xsl:apply-templates/>
</s1>
</xsl:template>
<xsl:template match='release'>
<s2>
<xsl:choose>
<xsl:when test='@date'>
<xsl:attribute name='title'>
<xsl:value-of select='@version'/>
-
<xsl:value-of select='@date'/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name='title'>
<xsl:value-of select='@version'/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select='desc'/>
<xsl:if test='changes'>
<ul>
<xsl:apply-templates select='changes/*'/>
</ul>
</xsl:if>
</s2>
</xsl:template>
<xsl:template match='desc'>
<xsl:copy-of select='*|text()'/>
</xsl:template>
<xsl:template match='add|remove|fix|update'>
<xsl:variable name='name'><xsl:value-of select='name()'/></xsl:variable>
<li>
<img alt='{$name}:' src='sbk:/resources/changes-{$name}.jpg' border='0'/>
<xsl:copy-of select='note/*|note/text()'/>
<xsl:if test='submitter'>
<xsl:apply-templates select='submitter'/>
</xsl:if>
</li>
</xsl:template>
<xsl:template match='submitter'>
<code>
<xsl:choose>
<xsl:when test='@mailto'>
[<jump href='mailto:{@mailto}'><xsl:value-of select='@name'/></jump>]
</xsl:when>
<xsl:otherwise>
[<xsl:value-of select='@name'/>]
</xsl:otherwise>
</xsl:choose>
</code>
</xsl:template>
</xsl:stylesheet>
1.1 xml-site/sources/xerces2-j/style/stylesheets/settings2document.xsl
Index: settings2document.xsl
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<!-- Top-Level Templates -->
<xsl:template match='/features'>
<s1 title='Features'>
<xsl:apply-templates select='desc' mode='header'/>
<xsl:apply-templates select='fcategory'/>
</s1>
</xsl:template>
<xsl:template match='/properties'>
<s1 title='Properties'>
<xsl:apply-templates select='desc' mode='header'/>
<xsl:apply-templates select='pcategory'/>
</s1>
</xsl:template>
<xsl:template match='fcategory|pcategory'>
<s2 title='{@name}'>
<xsl:apply-templates select='desc'/>
<xsl:apply-templates/>
</s2>
</xsl:template>
<xsl:template match='feature'>
<anchor name='{@id}'/>
<s3 title='{@name}'>
<table>
<xsl:apply-templates select='desc' mode='table'/>
<tr>
<th>True:</th>
<td><xsl:apply-templates select='true'/></td>
</tr>
<tr>
<th>False:</th>
<td><xsl:apply-templates select='false'/></td>
</tr>
<xsl:apply-templates select='default' mode='table'/>
<xsl:apply-templates select='access' mode='table'/>
<xsl:apply-templates select='note' mode='table'/>
<xsl:apply-templates select='see' mode='table'/>
</table>
</s3>
</xsl:template>
<xsl:template match='property'>
<anchor name='{@id}'/>
<s3 title='{@name}'>
<table>
<xsl:apply-templates select='desc' mode='table'/>
<tr>
<th>Type:</th>
<td><xsl:value-of select='type'/></td>
</tr>
<xsl:apply-templates select='default' mode='table'/>
<xsl:apply-templates select='access' mode='table'/>
<xsl:apply-templates select='note' mode='table'/>
<xsl:apply-templates select='see' mode='table'/>
</table>
</s3>
</xsl:template>
<!-- Table Contents Templates -->
<xsl:template match='desc' mode='table'>
<tr>
<th>Desc:</th>
<td><xsl:apply-templates/></td>
</tr>
</xsl:template>
<xsl:template match='access' mode='table'>
<tr>
<th>Access:</th>
<td>
<xsl:choose>
<xsl:when test='@general'>
<xsl:value-of select='@general'/>
</xsl:when>
<xsl:otherwise>
<xsl:if test='@parsing'>
(parsing) <xsl:value-of select='@parsing'/>;
</xsl:if>
<xsl:if test='@not-parsing'>
(not parsing) <xsl:value-of select='@not-parsing'/>;
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<xsl:template match='default' mode='table'>
<tr>
<th>Default:</th>
<td><xsl:value-of select='@value'/></td>
</tr>
</xsl:template>
<xsl:template match='note' mode='table'>
<tr>
<th>Note:</th>
<td><xsl:call-template name='markup'/></td>
</tr>
</xsl:template>
<xsl:template match='see' mode='table'>
<tr>
<th>See:</th>
<td>
<xsl:variable name='idref'><xsl:value-of select='@idref'/></xsl:variable>
<jump href='#{$idref}'><xsl:value-of select='//*[@id=$idref]/@name'/></jump>
</td>
</tr>
</xsl:template>
<!-- General Templates -->
<xsl:template match='desc'>
<xsl:call-template name='markup'/>
</xsl:template>
<xsl:template match='desc' mode='header'>
<s2 title='{@name}'>
<xsl:call-template name='markup'/>
</s2>
</xsl:template>
<xsl:template name='markup'>
<xsl:copy-of select='*|text()'/>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: general-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: general-cvs-help@xml.apache.org