| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
|
| <!--NewPage-->
|
| <HTML>
|
| <HEAD>
|
| <!-- Generated by javadoc on Thu Nov 22 17:12:57 EST 2007 -->
|
| <TITLE>
|
| Xalan-Java 2.7.1: Interface DOM3Serializer
|
| </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/DOM3Serializer.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">
|
| PREV CLASS
|
| <A HREF="../../../../org/apache/xml/serializer/DOMSerializer.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="DOM3Serializer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: INNER | 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>
|
| <!-- =========== END OF NAVBAR =========== -->
|
|
|
| <HR>
|
| <!-- ======== START OF CLASS DATA ======== -->
|
| <H2>
|
| <FONT SIZE="-1">
|
| org.apache.xml.serializer</FONT>
|
| <BR>
|
| Interface DOM3Serializer</H2>
|
| <DL>
|
| <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/xml/serializer/dom3/DOM3SerializerImpl.html">DOM3SerializerImpl</A></DD>
|
| </DL>
|
| <HR>
|
| <DL>
|
| <DT>public interface <B>DOM3Serializer</B></DL>
|
|
|
| <P>
|
| This interface is not intended to be used |
| by an end user, but rather by an XML parser that is implementing the DOM |
| Level 3 Load and Save APIs. |
| <p> |
| |
| See the DOM Level 3 Load and Save interface at <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer">LSSeializer</a>. |
| |
| For a list of configuration parameters for DOM Level 3 see <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMConfiguration">DOMConfiguration</a>. |
| For additional configuration parameters available with the DOM Level 3 Load and Save API LSSerializer see |
| <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config">LSerializer config</a>. |
| <p> |
| The following example uses a DOM3Serializer indirectly, through an an XML |
| parser that uses this class as part of its implementation of the DOM Level 3 |
| Load and Save APIs, and is the prefered way to serialize with DOM Level 3 APIs. |
| <p> |
| Example: |
| <pre> |
| public class TestDOM3 { |
| |
| public static void main(String args[]) throws Exception { |
| // Get document to serialize |
| TestDOM3 test = new TestDOM3(); |
| |
| // Serialize using standard DOM Level 3 Load/Save APIs |
| System.out.println(test.testDOM3LS()); |
| } |
| |
| public org.w3c.dom.Document getDocument() throws Exception { |
| // Create a simple DOM Document. |
| javax.xml.parsers.DocumentBuilderFactory factory = |
| javax.xml.parsers.DocumentBuilderFactory.newInstance(); |
| javax.xml.parsers.DocumentBuilder builder = factory.newDocumentBuilder(); |
| byte[] bytes = "<parent><child/></parent>".getBytes(); |
| java.io.InputStream is = new java.io.ByteArrayInputStream(bytes); |
| org.w3c.dom.Document doc = builder.parse(is); |
| return doc; |
| } |
| |
| // |
| // This method uses standard DOM Level 3 Load Save APIs: |
| // org.w3c.dom.bootstrap.DOMImplementationRegistry |
| // org.w3c.dom.ls.DOMImplementationLS |
| // org.w3c.dom.ls.DOMImplementationLS |
| // org.w3c.dom.ls.LSSerializer |
| // org.w3c.dom.DOMConfiguration |
| // |
| // The only thing non-standard in this method is the value set for the |
| // name of the class implementing the DOM Level 3 Load Save APIs, |
| // which in this case is: |
| // org.apache.xerces.dom.DOMImplementationSourceImpl |
| // |
| |
| public String testDOM3LS() throws Exception { |
| |
| // Get a simple DOM Document that will be serialized. |
| org.w3c.dom.Document docToSerialize = getDocument(); |
| |
| // Get a factory (DOMImplementationLS) for creating a Load and Save object. |
| org.w3c.dom.ls.DOMImplementationLS impl = |
| (org.w3c.dom.ls.DOMImplementationLS) |
| org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance().getDOMImplementation("LS"); |
| |
| // Use the factory to create an object (LSSerializer) used to |
| // write out or save the document. |
| org.w3c.dom.ls.LSSerializer writer = impl.createLSSerializer(); |
| org.w3c.dom.DOMConfiguration config = writer.getDomConfig(); |
| config.setParameter("format-pretty-print", Boolean.TRUE); |
| |
| // Use the LSSerializer to write out or serialize the document to a String. |
| String serializedXML = writer.writeToString(docToSerialize); |
| return serializedXML; |
| } |
| |
| } // end of class TestDOM3 |
| </pre>
|
| <P>
|
| <DL>
|
| <DT><B>See Also: </B><DD><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMConfiguration">DOMConfiguration</a>,
|
| <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config">LSSerializer</a>,
|
| <A HREF="../../../../org/apache/xml/serializer/Serializer.html"><CODE>Serializer</CODE></A>,
|
| <A HREF="../../../../org/apache/xml/serializer/DOMSerializer.html"><CODE>DOMSerializer</CODE></A><DT><B>Usage:</B><DD><i><font size="-1" color="#00FF00"> **For advanced use only**</font></i></DD> |
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <P>
|
| <!-- ======== INNER CLASS SUMMARY ======== -->
|
|
|
|
|
| <!-- =========== FIELD SUMMARY =========== -->
|
|
|
|
|
| <!-- ======== 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> <A HREF="../../../../org/w3c/dom/DOMErrorHandler.html">DOMErrorHandler</A></CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xml/serializer/DOM3Serializer.html#getErrorHandler()">getErrorHandler</A></B>()</CODE>
|
|
|
| <BR>
|
| Returns a DOMErrorHandler set on the DOM Level 3 Serializer.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> <A HREF="../../../../org/w3c/dom/ls/LSSerializerFilter.html">LSSerializerFilter</A></CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../org/apache/xml/serializer/DOM3Serializer.html#getNodeFilter()">getNodeFilter</A></B>()</CODE>
|
|
|
| <BR>
|
| Returns a LSSerializerFilter set on the DOM Level 3 Serializer to filter nodes |
| during serialization.</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/apache/xml/serializer/DOM3Serializer.html#serializeDOM3(org.w3c.dom.Node)">serializeDOM3</A></B>(<A HREF="../../../../org/w3c/dom/Node.html">Node</A> node)</CODE>
|
|
|
| <BR>
|
| Serializes the Level 3 DOM node.</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/apache/xml/serializer/DOM3Serializer.html#setErrorHandler(org.w3c.dom.DOMErrorHandler)">setErrorHandler</A></B>(<A HREF="../../../../org/w3c/dom/DOMErrorHandler.html">DOMErrorHandler</A> handler)</CODE>
|
|
|
| <BR>
|
| Sets a DOMErrorHandler on the DOM Level 3 Serializer.</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/apache/xml/serializer/DOM3Serializer.html#setNewLine(char[])">setNewLine</A></B>(char[] newLine)</CODE>
|
|
|
| <BR>
|
| Sets the end-of-line sequence of characters to be used during serialization</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/apache/xml/serializer/DOM3Serializer.html#setNodeFilter(org.w3c.dom.ls.LSSerializerFilter)">setNodeFilter</A></B>(<A HREF="../../../../org/w3c/dom/ls/LSSerializerFilter.html">LSSerializerFilter</A> filter)</CODE>
|
|
|
| <BR>
|
| Sets a LSSerializerFilter on the DOM Level 3 Serializer to filter nodes |
| during serialization.</TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <P>
|
|
|
| <!-- ============ FIELD DETAIL =========== -->
|
|
|
|
|
| <!-- ========= 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="serializeDOM3(org.w3c.dom.Node)"><!-- --></A><H3>
|
| serializeDOM3</H3>
|
| <PRE>
|
| public void <B>serializeDOM3</B>(<A HREF="../../../../org/w3c/dom/Node.html">Node</A> node) |
| throws java.io.IOException</PRE>
|
| <DL>
|
| <DD>Serializes the Level 3 DOM node. Throws an exception only if an I/O |
| exception occured while serializing. |
| |
| This interface is a public API.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>node</CODE> - the Level 3 DOM node to serialize<DT><B>Throws:</B><DD>java.io.IOException - if an I/O exception occured while serializing</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setErrorHandler(org.w3c.dom.DOMErrorHandler)"><!-- --></A><H3>
|
| setErrorHandler</H3>
|
| <PRE>
|
| public void <B>setErrorHandler</B>(<A HREF="../../../../org/w3c/dom/DOMErrorHandler.html">DOMErrorHandler</A> handler)</PRE>
|
| <DL>
|
| <DD>Sets a DOMErrorHandler on the DOM Level 3 Serializer. |
| |
| This interface is a public API.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>handler</CODE> - the Level 3 DOMErrorHandler</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getErrorHandler()"><!-- --></A><H3>
|
| getErrorHandler</H3>
|
| <PRE>
|
| public <A HREF="../../../../org/w3c/dom/DOMErrorHandler.html">DOMErrorHandler</A> <B>getErrorHandler</B>()</PRE>
|
| <DL>
|
| <DD>Returns a DOMErrorHandler set on the DOM Level 3 Serializer. |
| |
| This interface is a public API.<DD><DL>
|
| <DT><B>Returns:</B><DD>A Level 3 DOMErrorHandler</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setNodeFilter(org.w3c.dom.ls.LSSerializerFilter)"><!-- --></A><H3>
|
| setNodeFilter</H3>
|
| <PRE>
|
| public void <B>setNodeFilter</B>(<A HREF="../../../../org/w3c/dom/ls/LSSerializerFilter.html">LSSerializerFilter</A> filter)</PRE>
|
| <DL>
|
| <DD>Sets a LSSerializerFilter on the DOM Level 3 Serializer to filter nodes |
| during serialization. |
| |
| This interface is a public API.<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>filter</CODE> - the Level 3 LSSerializerFilter</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getNodeFilter()"><!-- --></A><H3>
|
| getNodeFilter</H3>
|
| <PRE>
|
| public <A HREF="../../../../org/w3c/dom/ls/LSSerializerFilter.html">LSSerializerFilter</A> <B>getNodeFilter</B>()</PRE>
|
| <DL>
|
| <DD>Returns a LSSerializerFilter set on the DOM Level 3 Serializer to filter nodes |
| during serialization. |
| |
| This interface is a public API.<DD><DL>
|
| <DT><B>Returns:</B><DD>The Level 3 LSSerializerFilter</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setNewLine(char[])"><!-- --></A><H3>
|
| setNewLine</H3>
|
| <PRE>
|
| public void <B>setNewLine</B>(char[] newLine)</PRE>
|
| <DL>
|
| <DD>Sets the end-of-line sequence of characters to be used during serialization<DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>newLine</CODE> - The end-of-line sequence of characters to be used during serialization</DL>
|
| </DD>
|
| </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/DOM3Serializer.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">
|
| PREV CLASS
|
| <A HREF="../../../../org/apache/xml/serializer/DOMSerializer.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="DOM3Serializer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: INNER | 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>
|
| <!-- =========== END OF NAVBAR =========== -->
|
|
|
| <HR>
|
| Copyright © 2006 Apache XML Project. All Rights Reserved.
|
| </BODY>
|
| </HTML>
|