| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
| <!--NewPage-->
|
| <HTML>
|
| <HEAD>
|
| <!-- Generated by javadoc on Thu Nov 22 17:13:00 EST 2007 -->
|
| <TITLE>
|
| Xalan-Java 2.7.1: Interface LSParserFilter
|
| </TITLE>
|
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
|
| </HEAD>
|
| <BODY BGCOLOR="white">
|
|
|
| <!-- ========== START OF NAVBAR ========== -->
|
| <A NAME="navbar_top"><!-- --></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
|
| <TR>
|
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
|
| <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="class-use/LSParserFilter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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/w3c/dom/ls/LSParser.html"><B>PREV CLASS</B></A>
|
| <A HREF="../../../../org/w3c/dom/ls/LSProgressEvent.html"><B>NEXT CLASS</B></A></FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
|
| <A HREF="LSParserFilter.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
| </TR>
|
| </TABLE>
|
| <!-- =========== END OF NAVBAR =========== -->
|
|
|
| <HR>
|
| <!-- ======== START OF CLASS DATA ======== -->
|
| <H2>
|
| <FONT SIZE="-1">
|
| org.w3c.dom.ls</FONT>
|
| <BR>
|
| Interface LSParserFilter</H2>
|
| <HR>
|
| <DL>
|
| <DT>public interface <B>LSParserFilter</B></DL>
|
|
|
| <P>
|
| <code>LSParserFilter</code>s provide applications the ability to examine |
| nodes as they are being constructed while parsing. As each node is |
| examined, it may be modified or removed, or the entire parse may be |
| terminated early. |
| <p> At the time any of the filter methods are called by the parser, the |
| owner Document and DOMImplementation objects exist and are accessible. |
| The document element is never passed to the <code>LSParserFilter</code> |
| methods, i.e. it is not possible to filter out the document element. |
| <code>Document</code>, <code>DocumentType</code>, <code>Notation</code>, |
| <code>Entity</code>, and <code>Attr</code> nodes are never passed to the |
| <code>acceptNode</code> method on the filter. The child nodes of an |
| <code>EntityReference</code> node are passed to the filter if the |
| parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'> |
| entities</a>" is set to <code>false</code>. Note that, as described by the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'> |
| entities</a>", unexpanded entity reference nodes are never discarded and are always |
| passed to the filter. |
| <p> All validity checking while parsing a document occurs on the source |
| document as it appears on the input stream, not on the DOM document as it |
| is built in memory. With filters, the document in memory may be a subset |
| of the document on the stream, and its validity may have been affected by |
| the filtering. |
| <p> All default attributes must be present on elements when the elements |
| are passed to the filter methods. All other default content must be |
| passed to the filter methods. |
| <p> DOM applications must not raise exceptions in a filter. The effect of |
| throwing exceptions from a filter is DOM implementation dependent. |
| <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load |
| and Save Specification</a>.
|
| <P>
|
| <HR>
|
|
|
| <P>
|
| <!-- ======== INNER CLASS SUMMARY ======== -->
|
|
|
|
|
| <!-- =========== FIELD SUMMARY =========== -->
|
|
|
| <A NAME="field_summary"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Field Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>static short</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/w3c/dom/ls/LSParserFilter.html#FILTER_ACCEPT">FILTER_ACCEPT</A></B></CODE>
|
|
|
| <BR>
|
| Accept the node.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>static short</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/w3c/dom/ls/LSParserFilter.html#FILTER_INTERRUPT">FILTER_INTERRUPT</A></B></CODE>
|
|
|
| <BR>
|
| Interrupt the normal processing of the document.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>static short</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/w3c/dom/ls/LSParserFilter.html#FILTER_REJECT">FILTER_REJECT</A></B></CODE>
|
|
|
| <BR>
|
| Reject the node and its children.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>static short</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/w3c/dom/ls/LSParserFilter.html#FILTER_SKIP">FILTER_SKIP</A></B></CODE>
|
|
|
| <BR>
|
| Skip this single node.</TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
|
|
|
| <!-- ========== METHOD SUMMARY =========== -->
|
|
|
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Method Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> short</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/w3c/dom/ls/LSParserFilter.html#acceptNode(org.w3c.dom.Node)">acceptNode</A></B>(<A HREF="../../../../org/w3c/dom/Node.html">Node</A> nodeArg)</CODE>
|
|
|
| <BR>
|
| This method will be called by the parser at the completion of the |
| parsing of each node.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> int</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/w3c/dom/ls/LSParserFilter.html#getWhatToShow()">getWhatToShow</A></B>()</CODE>
|
|
|
| <BR>
|
| Tells the <code>LSParser</code> what types of nodes to show to the |
| method <code>LSParserFilter.acceptNode</code>.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> short</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/w3c/dom/ls/LSParserFilter.html#startElement(org.w3c.dom.Element)">startElement</A></B>(<A HREF="../../../../org/w3c/dom/Element.html">Element</A> elementArg)</CODE>
|
|
|
| <BR>
|
| The parser will call this method after each <code>Element</code> start |
| tag has been scanned, but before the remainder of the |
| <code>Element</code> is processed.</TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <P>
|
|
|
| <!-- ============ FIELD DETAIL =========== -->
|
|
|
| <A NAME="field_detail"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Field Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <A NAME="FILTER_ACCEPT"><!-- --></A><H3>
|
| FILTER_ACCEPT</H3>
|
| <PRE>
|
| public static final short <B>FILTER_ACCEPT</B></PRE>
|
| <DL>
|
| <DD>Accept the node.</DL>
|
| <HR>
|
|
|
| <A NAME="FILTER_REJECT"><!-- --></A><H3>
|
| FILTER_REJECT</H3>
|
| <PRE>
|
| public static final short <B>FILTER_REJECT</B></PRE>
|
| <DL>
|
| <DD>Reject the node and its children.</DL>
|
| <HR>
|
|
|
| <A NAME="FILTER_SKIP"><!-- --></A><H3>
|
| FILTER_SKIP</H3>
|
| <PRE>
|
| public static final short <B>FILTER_SKIP</B></PRE>
|
| <DL>
|
| <DD>Skip this single node. The children of this node will still be |
| considered.</DL>
|
| <HR>
|
|
|
| <A NAME="FILTER_INTERRUPT"><!-- --></A><H3>
|
| FILTER_INTERRUPT</H3>
|
| <PRE>
|
| public static final short <B>FILTER_INTERRUPT</B></PRE>
|
| <DL>
|
| <DD>Interrupt the normal processing of the document.</DL>
|
|
|
| <!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
|
|
|
| <!-- ============ METHOD DETAIL ========== -->
|
|
|
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Method Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <A NAME="startElement(org.w3c.dom.Element)"><!-- --></A><H3>
|
| startElement</H3>
|
| <PRE>
|
| public short <B>startElement</B>(<A HREF="../../../../org/w3c/dom/Element.html">Element</A> elementArg)</PRE>
|
| <DL>
|
| <DD>The parser will call this method after each <code>Element</code> start |
| tag has been scanned, but before the remainder of the |
| <code>Element</code> is processed. The intent is to allow the |
| element, including any children, to be efficiently skipped. Note that |
| only element nodes are passed to the <code>startElement</code> |
| function. |
| <br>The element node passed to <code>startElement</code> for filtering |
| will include all of the Element's attributes, but none of the |
| children nodes. The Element may not yet be in place in the document |
| being constructed (it may not have a parent node.) |
| <br>A <code>startElement</code> filter function may access or change |
| the attributes for the Element. Changing Namespace declarations will |
| have no effect on namespace resolution by the parser. |
| <br>For efficiency, the Element node passed to the filter may not be |
| the same one as is actually placed in the tree if the node is |
| accepted. And the actual node (node object identity) may be reused |
| during the process of reading in and filtering a document.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>elementArg</CODE> - The newly encountered element. At the time this |
| method is called, the element is incomplete - it will have its |
| attributes, but no children.<DT><B>Returns:</B><DD><ul> |
| <li> <code>FILTER_ACCEPT</code> if the <code>Element</code> should |
| be included in the DOM document being built. |
| </li> |
| <li> |
| <code>FILTER_REJECT</code> if the <code>Element</code> and all of |
| its children should be rejected. |
| </li> |
| <li> <code>FILTER_SKIP</code> if the |
| <code>Element</code> should be skipped. All of its children are |
| inserted in place of the skipped <code>Element</code> node. |
| </li> |
| <li> |
| <code>FILTER_INTERRUPT</code> if the filter wants to stop the |
| processing of the document. Interrupting the processing of the |
| document does no longer guarantee that the resulting DOM tree is |
| XML well-formed. The <code>Element</code> is rejected. |
| </li> |
| </ul> Returning |
| any other values will result in unspecified behavior.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="acceptNode(org.w3c.dom.Node)"><!-- --></A><H3>
|
| acceptNode</H3>
|
| <PRE>
|
| public short <B>acceptNode</B>(<A HREF="../../../../org/w3c/dom/Node.html">Node</A> nodeArg)</PRE>
|
| <DL>
|
| <DD>This method will be called by the parser at the completion of the |
| parsing of each node. The node and all of its descendants will exist |
| and be complete. The parent node will also exist, although it may be |
| incomplete, i.e. it may have additional children that have not yet |
| been parsed. Attribute nodes are never passed to this function. |
| <br>From within this method, the new node may be freely modified - |
| children may be added or removed, text nodes modified, etc. The state |
| of the rest of the document outside this node is not defined, and the |
| affect of any attempt to navigate to, or to modify any other part of |
| the document is undefined. |
| <br>For validating parsers, the checks are made on the original |
| document, before any modification by the filter. No validity checks |
| are made on any document modifications made by the filter. |
| <br>If this new node is rejected, the parser might reuse the new node |
| and any of its descendants.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>nodeArg</CODE> - The newly constructed element. At the time this method |
| is called, the element is complete - it has all of its children |
| (and their children, recursively) and attributes, and is attached |
| as a child to its parent.<DT><B>Returns:</B><DD><ul> |
| <li> <code>FILTER_ACCEPT</code> if this <code>Node</code> should |
| be included in the DOM document being built. |
| </li> |
| <li> |
| <code>FILTER_REJECT</code> if the <code>Node</code> and all of its |
| children should be rejected. |
| </li> |
| <li> <code>FILTER_SKIP</code> if the |
| <code>Node</code> should be skipped and the <code>Node</code> |
| should be replaced by all the children of the <code>Node</code>. |
| </li> |
| <li> |
| <code>FILTER_INTERRUPT</code> if the filter wants to stop the |
| processing of the document. Interrupting the processing of the |
| document does no longer guarantee that the resulting DOM tree is |
| XML well-formed. The <code>Node</code> is accepted and will be the |
| last completely parsed node. |
| </li> |
| </ul></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getWhatToShow()"><!-- --></A><H3>
|
| getWhatToShow</H3>
|
| <PRE>
|
| public int <B>getWhatToShow</B>()</PRE>
|
| <DL>
|
| <DD>Tells the <code>LSParser</code> what types of nodes to show to the |
| method <code>LSParserFilter.acceptNode</code>. If a node is not shown |
| to the filter using this attribute, it is automatically included in |
| the DOM document being built. See <code>NodeFilter</code> for |
| definition of the constants. The constants <code>SHOW_ATTRIBUTE</code> |
| , <code>SHOW_DOCUMENT</code>, <code>SHOW_DOCUMENT_TYPE</code>, |
| <code>SHOW_NOTATION</code>, <code>SHOW_ENTITY</code>, and |
| <code>SHOW_DOCUMENT_FRAGMENT</code> are meaningless here. Those nodes |
| will never be passed to <code>LSParserFilter.acceptNode</code>. |
| <br> The constants used here are defined in [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>] |
| .</DL>
|
| <!-- ========= END OF CLASS DATA ========= -->
|
| <HR>
|
|
|
| <!-- ========== START OF NAVBAR ========== -->
|
| <A NAME="navbar_bottom"><!-- --></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
|
| <TR>
|
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
|
| <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="class-use/LSParserFilter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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/w3c/dom/ls/LSParser.html"><B>PREV CLASS</B></A>
|
| <A HREF="../../../../org/w3c/dom/ls/LSProgressEvent.html"><B>NEXT CLASS</B></A></FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
|
| <A HREF="LSParserFilter.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
| </TR>
|
| </TABLE>
|
| <!-- =========== END OF NAVBAR =========== -->
|
|
|
| <HR>
|
| Copyright © 2006 Apache XML Project. All Rights Reserved.
|
| </BODY>
|
| </HTML>
|