<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Sun Jun 12 19:55:32 JST 2011 --> <TITLE> ContentHandler (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3) </TITLE> <META NAME="date" CONTENT="2011-06-12"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ContentHandler (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/xml/sax/Attributes.html" title="interface in org.xml.sax"><B>PREV CLASS</B></A> <A HREF="../../../org/xml/sax/DocumentHandler.html" title="interface in org.xml.sax"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/xml/sax/ContentHandler.html" target="_top"><B>FRAMES</B></A> <A HREF="ContentHandler.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.xml.sax</FONT> <BR> Interface ContentHandler</H2> <DL> <DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../javax/xml/transform/sax/TemplatesHandler.html" title="interface in javax.xml.transform.sax">TemplatesHandler</A>, <A HREF="../../../javax/xml/transform/sax/TransformerHandler.html" title="interface in javax.xml.transform.sax">TransformerHandler</A></DD> </DL> <DL> <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../org/xml/sax/helpers/DefaultHandler.html" title="class in org.xml.sax.helpers">DefaultHandler</A>, <A HREF="../../../org/xml/sax/ext/DefaultHandler2.html" title="class in org.xml.sax.ext">DefaultHandler2</A>, <A HREF="../../../javax/xml/validation/ValidatorHandler.html" title="class in javax.xml.validation">ValidatorHandler</A>, <A HREF="../../../org/xml/sax/helpers/XMLFilterImpl.html" title="class in org.xml.sax.helpers">XMLFilterImpl</A>, <A HREF="../../../org/xml/sax/helpers/XMLReaderAdapter.html" title="class in org.xml.sax.helpers">XMLReaderAdapter</A></DD> </DL> <HR> <DL> <DT><PRE>public interface <B>ContentHandler</B></DL> </PRE> <P> Receive notification of the logical content of a document. <blockquote> <em>This module, both source code and documentation, is in the Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> See <a href='http://www.saxproject.org'>http://www.saxproject.org</a> for further information. </blockquote> <p>This is the main interface that most SAX applications implement: if the application needs to be informed of basic parsing events, it implements this interface and registers an instance with the SAX parser using the <A HREF="../../../org/xml/sax/XMLReader.html#setContentHandler(org.xml.sax.ContentHandler)"><CODE>setContentHandler</CODE></A> method. The parser uses the instance to report basic document-related events like the start and end of elements and character data.</p> <p>The order of events in this interface is very important, and mirrors the order of information in the document itself. For example, all of an element's content (character data, processing instructions, and/or subelements) will appear, in order, between the startElement event and the corresponding endElement event.</p> <p>This interface is similar to the now-deprecated SAX 1.0 DocumentHandler interface, but it adds support for Namespaces and for reporting skipped entities (in non-validating XML processors).</p> <p>Implementors should note that there is also a <code>ContentHandler</code> class in the <code>java.net</code> package; that means that it's probably a bad idea to do</p> <pre>import java.net.*; import org.xml.sax.*; </pre> <p>In fact, "import ...*" is usually a sign of sloppy programming anyway, so the user should consider this a feature rather than a bug.</p> <P> <P> <DL> <DT><B>Since:</B></DT> <DD>SAX 2.0</DD> <DT><B>Version:</B></DT> <DD>2.0.1+ (sax2r3pre1)</DD> <DT><B>Author:</B></DT> <DD>David Megginson</DD> <DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/XMLReader.html" title="interface in org.xml.sax"><CODE>XMLReader</CODE></A>, <A HREF="../../../org/xml/sax/DTDHandler.html" title="interface in org.xml.sax"><CODE>DTDHandler</CODE></A>, <A HREF="../../../org/xml/sax/ErrorHandler.html" title="interface in org.xml.sax"><CODE>ErrorHandler</CODE></A></DL> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#characters(char[], int, int)">characters</A></B>(char[] ch, int start, int length)</CODE> <BR> Receive notification of character data.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#endDocument()">endDocument</A></B>()</CODE> <BR> Receive notification of the end of a document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#endElement(java.lang.String, java.lang.String, java.lang.String)">endElement</A></B>(java.lang.String uri, java.lang.String localName, java.lang.String qName)</CODE> <BR> Receive notification of the end of an element.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#endPrefixMapping(java.lang.String)">endPrefixMapping</A></B>(java.lang.String prefix)</CODE> <BR> End the scope of a prefix-URI mapping.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#ignorableWhitespace(char[], int, int)">ignorableWhitespace</A></B>(char[] ch, int start, int length)</CODE> <BR> Receive notification of ignorable whitespace in element content.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#processingInstruction(java.lang.String, java.lang.String)">processingInstruction</A></B>(java.lang.String target, java.lang.String data)</CODE> <BR> Receive notification of a processing instruction.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#setDocumentLocator(org.xml.sax.Locator)">setDocumentLocator</A></B>(<A HREF="../../../org/xml/sax/Locator.html" title="interface in org.xml.sax">Locator</A> locator)</CODE> <BR> Receive an object for locating the origin of SAX document events.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#skippedEntity(java.lang.String)">skippedEntity</A></B>(java.lang.String name)</CODE> <BR> Receive notification of a skipped entity.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#startDocument()">startDocument</A></B>()</CODE> <BR> Receive notification of the beginning of a document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)">startElement</A></B>(java.lang.String uri, java.lang.String localName, java.lang.String qName, <A HREF="../../../org/xml/sax/Attributes.html" title="interface in org.xml.sax">Attributes</A> atts)</CODE> <BR> Receive notification of the beginning of an element.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/xml/sax/ContentHandler.html#startPrefixMapping(java.lang.String, java.lang.String)">startPrefixMapping</A></B>(java.lang.String prefix, java.lang.String uri)</CODE> <BR> Begin the scope of a prefix-URI Namespace mapping.</TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="setDocumentLocator(org.xml.sax.Locator)"><!-- --></A><H3> setDocumentLocator</H3> <PRE> void <B>setDocumentLocator</B>(<A HREF="../../../org/xml/sax/Locator.html" title="interface in org.xml.sax">Locator</A> locator)</PRE> <DL> <DD>Receive an object for locating the origin of SAX document events. <p>SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the ContentHandler interface.</p> <p>The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.</p> <p>Note that the locator will return correct information only during the invocation SAX event callbacks after <A HREF="../../../org/xml/sax/ContentHandler.html#startDocument()"><CODE>startDocument</CODE></A> returns and before <A HREF="../../../org/xml/sax/ContentHandler.html#endDocument()"><CODE>endDocument</CODE></A> is called. The application should not attempt to use it at any other time.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>locator</CODE> - an object that can return the location of any SAX document event<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/Locator.html" title="interface in org.xml.sax"><CODE>Locator</CODE></A></DL> </DD> </DL> <HR> <A NAME="startDocument()"><!-- --></A><H3> startDocument</H3> <PRE> void <B>startDocument</B>() throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>Receive notification of the beginning of a document. <p>The SAX parser will invoke this method only once, before any other event callbacks (except for <A HREF="../../../org/xml/sax/ContentHandler.html#setDocumentLocator(org.xml.sax.Locator)"><CODE>setDocumentLocator</CODE></A>).</p> <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - any SAX exception, possibly wrapping another exception<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/ContentHandler.html#endDocument()"><CODE>endDocument()</CODE></A></DL> </DD> </DL> <HR> <A NAME="endDocument()"><!-- --></A><H3> endDocument</H3> <PRE> void <B>endDocument</B>() throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>Receive notification of the end of a document. <p><strong>There is an apparent contradiction between the documentation for this method and the documentation for <A HREF="../../../org/xml/sax/ErrorHandler.html#fatalError(org.xml.sax.SAXParseException)"><CODE>ErrorHandler.fatalError(org.xml.sax.SAXParseException)</CODE></A>. Until this ambiguity is resolved in a future major release, clients should make no assumptions about whether endDocument() will or will not be invoked when the parser has reported a fatalError() or thrown an exception.</strong></p> <p>The SAX parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input.</p> <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - any SAX exception, possibly wrapping another exception<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/ContentHandler.html#startDocument()"><CODE>startDocument()</CODE></A></DL> </DD> </DL> <HR> <A NAME="startPrefixMapping(java.lang.String, java.lang.String)"><!-- --></A><H3> startPrefixMapping</H3> <PRE> void <B>startPrefixMapping</B>(java.lang.String prefix, java.lang.String uri) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>Begin the scope of a prefix-URI Namespace mapping. <p>The information from this event is not necessary for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the <code>http://xml.org/sax/features/namespaces</code> feature is <var>true</var> (the default).</p> <p>There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary.</p> <p>Note that start/endPrefixMapping events are not guaranteed to be properly nested relative to each other: all startPrefixMapping events will occur immediately before the corresponding <A HREF="../../../org/xml/sax/ContentHandler.html#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)"><CODE>startElement</CODE></A> event, and all <A HREF="../../../org/xml/sax/ContentHandler.html#endPrefixMapping(java.lang.String)"><CODE>endPrefixMapping</CODE></A> events will occur immediately after the corresponding <A HREF="../../../org/xml/sax/ContentHandler.html#endElement(java.lang.String, java.lang.String, java.lang.String)"><CODE>endElement</CODE></A> event, but their order is not otherwise guaranteed.</p> <p>There should never be start/endPrefixMapping events for the "xml" prefix, since it is predeclared and immutable.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>prefix</CODE> - the Namespace prefix being declared. An empty string is used for the default element namespace, which has no prefix.<DD><CODE>uri</CODE> - the Namespace URI the prefix is mapped to <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - the client may throw an exception during processing<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/ContentHandler.html#endPrefixMapping(java.lang.String)"><CODE>endPrefixMapping(java.lang.String)</CODE></A>, <A HREF="../../../org/xml/sax/ContentHandler.html#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)"><CODE>startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)</CODE></A></DL> </DD> </DL> <HR> <A NAME="endPrefixMapping(java.lang.String)"><!-- --></A><H3> endPrefixMapping</H3> <PRE> void <B>endPrefixMapping</B>(java.lang.String prefix) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>End the scope of a prefix-URI mapping. <p>See <A HREF="../../../org/xml/sax/ContentHandler.html#startPrefixMapping(java.lang.String, java.lang.String)"><CODE>startPrefixMapping</CODE></A> for details. These events will always occur immediately after the corresponding <A HREF="../../../org/xml/sax/ContentHandler.html#endElement(java.lang.String, java.lang.String, java.lang.String)"><CODE>endElement</CODE></A> event, but the order of <A HREF="../../../org/xml/sax/ContentHandler.html#endPrefixMapping(java.lang.String)"><CODE>endPrefixMapping</CODE></A> events is not otherwise guaranteed.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>prefix</CODE> - the prefix that was being mapped. This is the empty string when a default mapping scope ends. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - the client may throw an exception during processing<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/ContentHandler.html#startPrefixMapping(java.lang.String, java.lang.String)"><CODE>startPrefixMapping(java.lang.String, java.lang.String)</CODE></A>, <A HREF="../../../org/xml/sax/ContentHandler.html#endElement(java.lang.String, java.lang.String, java.lang.String)"><CODE>endElement(java.lang.String, java.lang.String, java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)"><!-- --></A><H3> startElement</H3> <PRE> void <B>startElement</B>(java.lang.String uri, java.lang.String localName, java.lang.String qName, <A HREF="../../../org/xml/sax/Attributes.html" title="interface in org.xml.sax">Attributes</A> atts) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>Receive notification of the beginning of an element. <p>The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding <A HREF="../../../org/xml/sax/ContentHandler.html#endElement(java.lang.String, java.lang.String, java.lang.String)"><CODE>endElement</CODE></A> event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.</p> <p>This event allows up to three name components for each element:</p> <ol> <li>the Namespace URI;</li> <li>the local name; and</li> <li>the qualified (prefixed) name.</li> </ol> <p>Any or all of these may be provided, depending on the values of the <var>http://xml.org/sax/features/namespaces</var> and the <var>http://xml.org/sax/features/namespace-prefixes</var> properties:</p> <ul> <li>the Namespace URI and local name are required when the namespaces property is <var>true</var> (the default), and are optional when the namespaces property is <var>false</var> (if one is specified, both must be);</li> <li>the qualified name is required when the namespace-prefixes property is <var>true</var>, and is optional when the namespace-prefixes property is <var>false</var> (the default).</li> </ul> <p>Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the <code>http://xml.org/sax/features/namespace-prefixes</code> property is true (it is false by default, and support for a true value is optional).</p> <p>Like <A HREF="../../../org/xml/sax/ContentHandler.html#characters(char[], int, int)"><CODE>characters()</CODE></A>, attribute values may have characters that need more than one <code>char</code> value. </p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>uri</CODE> - the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed<DD><CODE>localName</CODE> - the local name (without prefix), or the empty string if Namespace processing is not being performed<DD><CODE>qName</CODE> - the qualified name (with prefix), or the empty string if qualified names are not available<DD><CODE>atts</CODE> - the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - any SAX exception, possibly wrapping another exception<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/ContentHandler.html#endElement(java.lang.String, java.lang.String, java.lang.String)"><CODE>endElement(java.lang.String, java.lang.String, java.lang.String)</CODE></A>, <A HREF="../../../org/xml/sax/Attributes.html" title="interface in org.xml.sax"><CODE>Attributes</CODE></A>, <A HREF="../../../org/xml/sax/helpers/AttributesImpl.html" title="class in org.xml.sax.helpers"><CODE>AttributesImpl</CODE></A></DL> </DD> </DL> <HR> <A NAME="endElement(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3> endElement</H3> <PRE> void <B>endElement</B>(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>Receive notification of the end of an element. <p>The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding <A HREF="../../../org/xml/sax/ContentHandler.html#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)"><CODE>startElement</CODE></A> event for every endElement event (even when the element is empty).</p> <p>For information on the names, see startElement.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>uri</CODE> - the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed<DD><CODE>localName</CODE> - the local name (without prefix), or the empty string if Namespace processing is not being performed<DD><CODE>qName</CODE> - the qualified XML name (with prefix), or the empty string if qualified names are not available <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - any SAX exception, possibly wrapping another exception</DL> </DD> </DL> <HR> <A NAME="characters(char[], int, int)"><!-- --></A><H3> characters</H3> <PRE> void <B>characters</B>(char[] ch, int start, int length) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>Receive notification of character data. <p>The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.</p> <p>The application must not attempt to read from the array outside of the specified range.</p> <p>Individual characters may consist of more than one Java <code>char</code> value. There are two important cases where this happens, because characters can't be represented in just sixteen bits. In one case, characters are represented in a <em>Surrogate Pair</em>, using two special Unicode values. Such characters are in the so-called "Astral Planes", with a code point above U+FFFF. A second case involves composite characters, such as a base character combining with one or more accent characters. </p> <p> Your code should not assume that algorithms using <code>char</code>-at-a-time idioms will be working in character units; in some cases they will split characters. This is relevant wherever XML permits arbitrary characters, such as attribute values, processing instruction data, and comments as well as in data reported from this method. It's also generally relevant whenever Java code manipulates internationalized text; the issue isn't unique to XML.</p> <p>Note that some parsers will report whitespace in element content using the <A HREF="../../../org/xml/sax/ContentHandler.html#ignorableWhitespace(char[], int, int)"><CODE>ignorableWhitespace</CODE></A> method rather than this one (validating parsers <em>must</em> do so).</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>ch</CODE> - the characters from the XML document<DD><CODE>start</CODE> - the start position in the array<DD><CODE>length</CODE> - the number of characters to read from the array <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - any SAX exception, possibly wrapping another exception<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/ContentHandler.html#ignorableWhitespace(char[], int, int)"><CODE>ignorableWhitespace(char[], int, int)</CODE></A>, <A HREF="../../../org/xml/sax/Locator.html" title="interface in org.xml.sax"><CODE>Locator</CODE></A></DL> </DD> </DL> <HR> <A NAME="ignorableWhitespace(char[], int, int)"><!-- --></A><H3> ignorableWhitespace</H3> <PRE> void <B>ignorableWhitespace</B>(char[] ch, int start, int length) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>Receive notification of ignorable whitespace in element content. <p>Validating Parsers must use this method to report each chunk of whitespace in element content (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models.</p> <p>SAX parsers may return all contiguous whitespace in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information.</p> <p>The application must not attempt to read from the array outside of the specified range.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>ch</CODE> - the characters from the XML document<DD><CODE>start</CODE> - the start position in the array<DD><CODE>length</CODE> - the number of characters to read from the array <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - any SAX exception, possibly wrapping another exception<DT><B>See Also:</B><DD><A HREF="../../../org/xml/sax/ContentHandler.html#characters(char[], int, int)"><CODE>characters(char[], int, int)</CODE></A></DL> </DD> </DL> <HR> <A NAME="processingInstruction(java.lang.String, java.lang.String)"><!-- --></A><H3> processingInstruction</H3> <PRE> void <B>processingInstruction</B>(java.lang.String target, java.lang.String data) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>Receive notification of a processing instruction. <p>The Parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element.</p> <p>A SAX parser must never report an XML declaration (XML 1.0, section 2.8) or a text declaration (XML 1.0, section 4.3.1) using this method.</p> <p>Like <A HREF="../../../org/xml/sax/ContentHandler.html#characters(char[], int, int)"><CODE>characters()</CODE></A>, processing instruction data may have characters that need more than one <code>char</code> value. </p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>target</CODE> - the processing instruction target<DD><CODE>data</CODE> - the processing instruction data, or null if none was supplied. The data does not include any whitespace separating it from the target <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - any SAX exception, possibly wrapping another exception</DL> </DD> </DL> <HR> <A NAME="skippedEntity(java.lang.String)"><!-- --></A><H3> skippedEntity</H3> <PRE> void <B>skippedEntity</B>(java.lang.String name) throws <A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></PRE> <DL> <DD>Receive notification of a skipped entity. This is not called for entity references within markup constructs such as element start tags or markup declarations. (The XML recommendation requires reporting skipped external entities. SAX also reports internal entity expansion/non-expansion, except within markup constructs.) <p>The Parser will invoke this method each time the entity is skipped. Non-validating processors may skip entities if they have not seen the declarations (because, for example, the entity was declared in an external DTD subset). All processors may skip external entities, depending on the values of the <code>http://xml.org/sax/features/external-general-entities</code> and the <code>http://xml.org/sax/features/external-parameter-entities</code> properties.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the skipped entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be the string "[dtd]" <DT><B>Throws:</B> <DD><CODE><A HREF="../../../org/xml/sax/SAXException.html" title="class in org.xml.sax">SAXException</A></CODE> - any SAX exception, possibly wrapping another exception</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/xml/sax/Attributes.html" title="interface in org.xml.sax"><B>PREV CLASS</B></A> <A HREF="../../../org/xml/sax/DocumentHandler.html" title="interface in org.xml.sax"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/xml/sax/ContentHandler.html" target="_top"><B>FRAMES</B></A> <A HREF="ContentHandler.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>