blob: 0ce2c1a20a6ee0b7b459ca92c87207755cdbe793 [file] [log] [blame]
<!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.5.0_18) on Sun Apr 01 21:18:35 PDT 2012 -->
<TITLE>
DOMSerializer
</TITLE>
<META NAME="keywords" CONTENT="org.apache.xml.serializer.DOMSerializer interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="DOMSerializer";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= 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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DOMSerializer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/xml/serializer/DOM3Serializer.html" title="interface in org.apache.xml.serializer"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/xml/serializer/ElemContext.html" title="class in org.apache.xml.serializer"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/xml/serializer/DOMSerializer.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DOMSerializer.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<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.apache.xml.serializer</FONT>
<BR>
Interface DOMSerializer</H2>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../org/apache/xalan/serialize/DOMSerializer.html" title="interface in org.apache.xalan.serialize">DOMSerializer</A>, <A HREF="../../../../org/apache/xml/serializer/SerializationHandler.html" title="interface in org.apache.xml.serializer">SerializationHandler</A></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.html" title="class in org.apache.xalan.xsltc.dom">AdaptiveResultTreeImpl</A>, <A HREF="../../../../org/apache/xml/serializer/EmptySerializer.html" title="class in org.apache.xml.serializer">EmptySerializer</A>, <A HREF="../../../../org/apache/xml/serializer/SerializerBase.html" title="class in org.apache.xml.serializer">SerializerBase</A>, <A HREF="../../../../org/apache/xalan/serialize/SerializerFactory.DOMSerializerWrapper.html" title="class in org.apache.xalan.serialize">SerializerFactory.DOMSerializerWrapper</A>, <A HREF="../../../../org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.html" title="class in org.apache.xalan.xsltc.dom">SimpleResultTreeImpl</A>, <A HREF="../../../../org/apache/xalan/xsltc/runtime/StringValueHandler.html" title="class in org.apache.xalan.xsltc.runtime">StringValueHandler</A>, <A HREF="../../../../org/apache/xml/serializer/ToHTMLSAXHandler.html" title="class in org.apache.xml.serializer">ToHTMLSAXHandler</A>, <A HREF="../../../../org/apache/xml/serializer/ToHTMLStream.html" title="class in org.apache.xml.serializer">ToHTMLStream</A>, <A HREF="../../../../org/apache/xml/serializer/ToSAXHandler.html" title="class in org.apache.xml.serializer">ToSAXHandler</A>, <A HREF="../../../../org/apache/xml/serializer/ToStream.html" title="class in org.apache.xml.serializer">ToStream</A>, <A HREF="../../../../org/apache/xml/serializer/ToTextSAXHandler.html" title="class in org.apache.xml.serializer">ToTextSAXHandler</A>, <A HREF="../../../../org/apache/xml/serializer/ToTextStream.html" title="class in org.apache.xml.serializer">ToTextStream</A>, <A HREF="../../../../org/apache/xml/serializer/ToUnknownStream.html" title="class in org.apache.xml.serializer">ToUnknownStream</A>, <A HREF="../../../../org/apache/xml/serializer/ToXMLSAXHandler.html" title="class in org.apache.xml.serializer">ToXMLSAXHandler</A>, <A HREF="../../../../org/apache/xml/serializer/ToXMLStream.html" title="class in org.apache.xml.serializer">ToXMLStream</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <A HREF="../../../../src-html/org/apache/xml/serializer/DOMSerializer.html#line.62"><B>DOMSerializer</B></A></DL>
</PRE>
<P>
Interface for a DOM serializer implementation.
<p>
The DOMSerializer is a facet of a serializer and is obtained from the
asDOMSerializer() method of the (<A HREF="../../../../org/apache/xml/serializer/Serializer.html" title="interface in org.apache.xml.serializer"><CODE>Serializer</CODE></A>) interface.
A serializer may or may not support a DOM serializer, if it does not then the
return value from asDOMSerializer() is null.
<p>
Example:
<pre>
// Create a document to be serialized
org.w3c.dom.Document doc = ...;
// Create a Serializer that will be used
// to serialize the document
org.apache.xml.serializer.Serializer ser = ...;
// Set the Writer to write output to, and
// serialize the DOM using that Serializer
java.io.StringWriter sw = new java.io.StringWriter();
ser.setWriter(sw);
DOMSerialzier dser = ser.asDOMSerializer();
dser.serialize(doc);
// Write out the serialized XML in the String.
System.out.println(sw.toString());
</pre>
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/xml/serializer/OutputPropertiesFactory.html" title="class in org.apache.xml.serializer"><CODE>OutputPropertiesFactory</CODE></A>,
<A HREF="../../../../org/apache/xml/serializer/SerializerFactory.html" title="class in org.apache.xml.serializer"><CODE>SerializerFactory</CODE></A>,
<A HREF="../../../../org/apache/xml/serializer/Serializer.html" title="interface in org.apache.xml.serializer"><CODE>Serializer</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>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/xml/serializer/DOMSerializer.html#serialize(org.w3c.dom.Node)">serialize</A></B>(org.w3c.dom.Node&nbsp;node)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Serializes the DOM node.</TD>
</TR>
</TABLE>
&nbsp;
<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="serialize(org.w3c.dom.Node)"><!-- --></A><H3>
serialize</H3>
<PRE>
void <A HREF="../../../../src-html/org/apache/xml/serializer/DOMSerializer.html#line.73"><B>serialize</B></A>(org.w3c.dom.Node&nbsp;node)
throws java.io.IOException</PRE>
<DL>
<DD>Serializes the DOM node. Throws an exception only if an I/O
exception occured while serializing.
This interface is a public API.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the DOM node to serialize
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - if an I/O exception occured while serializing</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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DOMSerializer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/xml/serializer/DOM3Serializer.html" title="interface in org.apache.xml.serializer"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/xml/serializer/ElemContext.html" title="class in org.apache.xml.serializer"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/xml/serializer/DOMSerializer.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DOMSerializer.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>