git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@225904 13f79535-47bb-0310-9956-ffa450edef68
298 lines
10 KiB
HTML
298 lines
10 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>SAX2: Changes</title>
|
|
<link rel="stylesheet" type="text/css" href="sax-style.css" />
|
|
</head>
|
|
|
|
<body>
|
|
<h1>SAX2: Changes</h1>
|
|
|
|
<blockquote>
|
|
<p class="copyright">This document is in the Public Domain.</p>
|
|
</blockquote>
|
|
|
|
|
|
<div>
|
|
<h2>Changes from SAX 2.0 to SAX 2.0 r2 prerelease</h2>
|
|
|
|
<p>(See the ChangeLog in the distribution for more details.)</p>
|
|
|
|
<ul>
|
|
<li>Added simple test program src/SAXTest.java</li>
|
|
<li>Synchronized static methods in XMLReaderFactory for thread
|
|
safety.</li>
|
|
<li>Fixed bug in ParserAdapter that reported an incorrect error when
|
|
an attribute using a Namespace prefix appeared before the Namespace
|
|
declaration.</li>
|
|
<li>Fixed bugs in AttributesImpl that caused infinite loops or
|
|
prevented removing attributes.</li>
|
|
<li>Specified that InputSource.getSystemId should return null (not an
|
|
empty string) when no system ID is available.</li>
|
|
<li>Modified DefaultHandler.resolveEntity to throw IOException, as in
|
|
the interface specification.</li>
|
|
<li>Added default constructors to SAXException,
|
|
SAXNotRecognizedException, and SAXNotSupportedException.</li>
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<h2>Changes from SAX 2.0prerelease to SAX 2.0</h2>
|
|
|
|
<ul>
|
|
<li>Documented the fact that parse() and event handlers are
|
|
synchronous.</li>
|
|
<li>Documented the fact that xml: prefix never has
|
|
start/endPrefixMapping events.</li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<h2>Changes from SAX 2.0beta2 to SAX 2.0prerelease</h2>
|
|
|
|
<p>(See the <code>ChangeLog</code> included in the distribution for
|
|
more detailed information.)</p>
|
|
|
|
<ul>
|
|
|
|
<li>If the <code>org.xml.sax.driver property</code> is not specified
|
|
but the SAX <code>org.xml.sax.parser</code> property is specified, <a
|
|
href="javadoc/org/xml/sax/helpers/XMLReaderFactory.html#createXMLReader()"
|
|
>XMLReaderFactory.createXMLReader()</a> will
|
|
attempt to create an XML1 <a
|
|
href="javadoc/org/xml/sax/Parser.html">Parser</a> and then wrap it in
|
|
a <a
|
|
href="javadoc/org/xml/sax/helpers/ParserAdapter.html">ParserAdapter</a>.</li>
|
|
|
|
<li><a
|
|
href="javadoc/org/xml/sax/helpers/DefaultHandler.html">DefaultHandler</a>
|
|
now throws a <a
|
|
href="javadoc/org/xml/sax/SAXException.html">SAXException</a> for its
|
|
<var>notationDecl</var> and <var>unparsedEntityDecl</var> methods, so
|
|
that they can be subclassed properly.</li>
|
|
|
|
<li>Bug fixed in <a
|
|
href="javadoc/org/xml/sax/helpers/AttributesImpl.html"
|
|
>AttributesImpl</a>; last attribute can now be removed.</li>
|
|
|
|
<li>Added <var>setAttributes</var> method <a
|
|
href="javadoc/org/xml/sax/helpers/AttributesImpl.html">AttributesImpl</a>
|
|
to simplify reusing an object.</li>
|
|
|
|
<li><a
|
|
href="javadoc/org/xml/sax/SAXParseException.html">SAXParseException</a>
|
|
now allows a null <var>locator</var> argument in its
|
|
constructors.</li>
|
|
|
|
<li>Specified that the <a
|
|
href="javadoc/org/xml/sax/ContentHandler.html">ContentHandler</a>
|
|
<var>skippedEntity</var> method will have an entity name of "[dtd]"
|
|
for the external DTD subset.</li>
|
|
|
|
<li>Specified that the <a
|
|
href="javadoc/org/xml/sax/ContentHandler.html">ContentHandler</a>
|
|
<var>processingInstruction</var> method will exclude whitespace
|
|
between the target and data.</li>
|
|
|
|
<li>In <a
|
|
href="javadoc/org/xml/sax/helpers/NamespaceSupport.html">NamespaceSupport</a>,
|
|
setting the "" prefix to "" removes any default mapping, and changed
|
|
<var>getPrefix</var>, <var>getPrefixes</var> so that they will not
|
|
return the default prefix.</li>
|
|
|
|
<li>In <a href="javadoc/org/xml/sax/Attributes.html">Attributes</a>,
|
|
renamed <var>getRawName</var> to <var>getQName</var>. Likewise, in <a
|
|
href="javadoc/org/xml/sax/helpers/AttributesImpl.html">AttributesImpl</a>,
|
|
renamed <var>setRawName</var> to <var>setQName</var>.</li>
|
|
|
|
<li>Removed the <code>org.xml.sax.ext</code> package into a separate
|
|
distribution, SAX2-ext. The <var>DeclHandler</var> and
|
|
<var>LexicalHandler</var> classes are no longer part of the core SAX2
|
|
distribution.</li>
|
|
|
|
<li>Added docs/quick-start.html</li>
|
|
|
|
<li>Modified <a
|
|
href="javadoc/org/xml/sax/helpers/XMLReaderAdapter.html">XMLReaderAdapter</a>,
|
|
<a
|
|
href="javadoc/org/xml/sax/helpers/ParserAdapter.html">ParserAdapter</a>,
|
|
and <a
|
|
href="javadoc/org/xml/sax/helpers/XMLFilterImpl.html">XMLFilterImpl</a>
|
|
so that <var>parse(String)</var> actually invokes
|
|
<var>parse(InputSource)</var>: this way, only
|
|
<var>parse(InputSource)</var> needs to be overridden in
|
|
subclasses.</li>
|
|
|
|
<li>Added <var>getPrefix(String)</var> and
|
|
<var>getPrefixes(String)</var> methods to <a
|
|
href="javadoc/org/xml/sax/helpers/NamespaceSupport.html">NamespaceSupport</a>
|
|
to look up currently-mapped prefixes.</li>
|
|
|
|
</ul>
|
|
|
|
<!-- end of "Changes from SAX2.0beta2 to SAX2.0prerelease" -->
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<h2>Changes from SAX 2.0beta to SAX 2.0beta2</h2>
|
|
|
|
<ul>
|
|
|
|
<li>Corrected "raw-names" to "namespace-prefixes" throughout.</li>
|
|
|
|
<li>Removed a JDK 1.2 dependency in <a
|
|
href="javadoc/org/xml/sax/helpers/NamespaceSupport.html"
|
|
>org.xml.sax.helpers.NamespaceSupport</a>.</li>
|
|
|
|
<li>Fixed <a href="javadoc/org/xml/sax/helpers/ParserAdapter.html"
|
|
>org.xml.sax.helpers.ParserAdapter</a> so that the object can be
|
|
reused after a previous parse has thrown an exception.</li>
|
|
|
|
<li>Added <a href="javadoc/org/xml/sax/helpers/XMLReaderFactory.html"
|
|
>org.xml.sax.helpers.XMLReaderFactory</a>.</li>
|
|
|
|
<li>Documented limitations of start/endEntity in
|
|
<var>org.xml.sax.ext.LexicalHandler</var>, and added documentation
|
|
that LexicalHandler applies to the whole document and that all events
|
|
must appear between start/endDocument (including start/endDTD).</li>
|
|
|
|
<li><a href="javadoc/org/xml/sax/helpers/ParserAdapter.html"
|
|
>org.xml.sax.helpers.ParserAdapter</a> and
|
|
<a href="javadoc/org/xml/sax/helpers/XMLReaderAdapter.html"
|
|
>org.xml.sax.helpers.XMLReaderAdapter</a> now have a default
|
|
constructors that use the "org.xml.sax.parser" and
|
|
"org.xml.sax.driver" properties to locate the embedded SAX1 and
|
|
SAX2 drivers respectively.</li>
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<h2>Changes from SAX 1.0 to SAX 2.0beta</h2>
|
|
|
|
<p>The following interfaces and classes have been deprecated, and will
|
|
be removed from a future version of SAX; they should be used only for
|
|
interaction with SAX1 drivers or applications:</p>
|
|
|
|
<ul>
|
|
<li><a
|
|
href="javadoc/org/xml/sax/Parser.html">org.xml.sax.Parser</a></li>
|
|
<li><a href="javadoc/org/xml/sax/DocumentHandler.html"
|
|
>org.xml.sax.DocumentHandler</a></li>
|
|
<li><a href="javadoc/org/xml/sax/AttributeList.html"
|
|
>org.xml.sax.AttributeList</a></li>
|
|
<li><a href="javadoc/org/xml/sax/HandlerBase.html"
|
|
>org.xml.sax.HandlerBase</a></li>
|
|
<li><a href="javadoc/org/xml/sax/helpers/ParserFactory.html"
|
|
>org.xml.sax.helpers.ParserFactory</a></li>
|
|
<li><a href="javadoc/org/xml/sax/helpers/AttributeListImpl.html"
|
|
>org.xml.sax.helpers.AttributeListImpl</a></li>
|
|
</ul>
|
|
|
|
<p>The following interfaces and classes have been added to SAX2:</p>
|
|
|
|
<ul>
|
|
<li><a href="javadoc/org/xml/sax/XMLReader.html"
|
|
>org.xml.sax.XMLReader</a> (replaces <a
|
|
href="javadoc/org/xml/sax/Parser.html">Parser</a>)</li>
|
|
<li><a href="javadoc/org/xml/sax/XMLFilter.html"
|
|
>org.xml.sax.XMLFilter</a></li>
|
|
<li><a href="javadoc/org/xml/sax/ContentHandler.html">org.xml.sax.ContentHandler</a> (replaces <a
|
|
href="javadoc/org/xml/sax/DocumentHandler.html"
|
|
>DocumentHandler</a>)</li>
|
|
<li><a href="javadoc/org/xml/sax/Attributes.html"
|
|
>org.xml.sax.Attributes</a> (replaces <a
|
|
href="javadoc/org/xml/sax/AttributeList.html">AttributeList</a>)</li>
|
|
<li><a href="javadoc/org/xml/sax/SAXNotSupportedException.html"
|
|
>org.xml.sax.SAXNotSupportedException</a></li>
|
|
<li><a href="javadoc/org/xml/sax/SAXNotRecognizedException.html"
|
|
>org.xml.sax.SAXNotRecognizedException</a></li>
|
|
<li><a href="javadoc/org/xml/sax/helpers/AttributesImpl.html"
|
|
>org.xml.sax.helpers.AttributesImpl</a> (replaces
|
|
AttributeListImpl)</li>
|
|
<li><a href="javadoc/org/xml/sax/helpers/NamespaceSupport.html"
|
|
>org.xml.sax.helpers.NamespaceSupport</a></li>
|
|
<li><a href="javadoc/org/xml/sax/helpers/XMLFilterImpl.html"
|
|
>org.xml.sax.helpers.XMLFilterImpl</a></li>
|
|
<li><a href="javadoc/org/xml/sax/helpers/ParserAdapter.html"
|
|
>org.xml.sax.helpers.ParserAdapter</a></li>
|
|
<li><a href="javadoc/org/xml/sax/helpers/XMLReaderAdapter.html"
|
|
>org.xml.sax.helpers.XMLReaderAdapter</a></li>
|
|
<li><a href="javadoc/org/xml/sax/helpers/DefaultHandler.html"
|
|
>org.xml.sax.helpers.DefaultHandler</a> (replaces <a
|
|
href="javadoc/org/xml/sax/HandlerBase.html">HandlerBase</a>)</li>
|
|
<li><var>org.xml.sax.ext.LexicalHandler</var> (since removed)</li>
|
|
<li><var>org.xml.sax.ext.DeclHandler</var> (since removed)</li>
|
|
</ul>
|
|
|
|
<p>SAX2 contains complete Namespace support, which is available by
|
|
default from any <a
|
|
href="javadoc/org/xml/sax/XMLReader.html">XMLReader</a>. An XML
|
|
reader can also optionally supply raw XML 1.0 names. See <a
|
|
href="namespaces.html">SAX2: Namespaces</a> for more details.</p>
|
|
|
|
<p>An XML reader is fully configurable: it is possible to attempt to
|
|
query or change the current value of any feature or property.
|
|
Features and properties are identified by fully-qualified URIs, and
|
|
parties are free to invent their own names for new extensions. See <a
|
|
href="features.html">SAX2: Features and Properties</a> for more
|
|
details.</p>
|
|
|
|
<p>The <a href="javadoc/org/xml/sax/ContentHandler.html"
|
|
shape="rect">ContentHandler</a> and <a
|
|
href="javadoc/org/xml/sax/Attributes.html">Attributes</a> interfaces
|
|
are similar to the deprecated <a
|
|
href="javadoc/org/xml/sax/DocumentHandler.html">DocumentHandler</a>
|
|
and <a href="javadoc/org/xml/sax/AttributeList.html">AttributeList</a>
|
|
interfaces, but they add support for Namespace-related information.
|
|
ContentHandler also adds a callback for skipped entities, and
|
|
Attributes adds the ability to look up an attribute's index by
|
|
name.</p>
|
|
|
|
<p>The <a
|
|
href="javadoc/org/xml/sax/helpers/ParserAdapter.html">ParserAdapter</a>
|
|
class makes a SAX1 <a
|
|
href="javadoc/org/xml/sax/Parser.html">Parser</a> behave as a SAX2 <a
|
|
href="javadoc/org/xml/sax/XMLReader.html">XMLReader</a>. The <a
|
|
href="javadoc/org/xml/sax/helpers/XMLReaderAdapter.html">XMLReaderAdapter</a>
|
|
class makes a SAX2 XML reader behave as a SAX1 parser. These two
|
|
classes should ease the transition from SAX1 to SAX2 by allowing SAX1
|
|
drivers and clients to co-exist with SAX2 drivers and clients in the
|
|
same application.</p>
|
|
|
|
|
|
<div>
|
|
<h3>SAX1 Bugs Fixed</h3>
|
|
|
|
<dl>
|
|
<dt><a href="javadoc/org/xml/sax/SAXException.html">SAXException</a></dt>
|
|
<dd>Overrode java.lang.Object.toString so that an embedded exception
|
|
will give a proper String representation for debugging.</dd>
|
|
|
|
<dt><a href="javadoc/org/xml/sax/helpers/ParserFactory.html"
|
|
>ParserFactory</a></dt>
|
|
<dd>Added missing closing comment so that private constructor is not
|
|
commented out.</dd>
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr />
|
|
|
|
<address>$Id$</address>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|