1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
|
<!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.4.2_06) on Thu Nov 24 12:17:49 GMT 2005 -->
<TITLE>
javax.xml.transform.sax
</TITLE>
<META NAME="keywords" CONTENT="javax.xml.transform.sax package">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="javax.xml.transform.sax";
}
</SCRIPT>
</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=3 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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</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="../../../../javax/xml/transform/dom/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../javax/xml/transform/stream/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-summary.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>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<H2>
Package javax.xml.transform.sax
</H2>
This package implements SAX2-specific transformation APIs.
<P>
<B>See:</B>
<BR>
<A HREF="#package_description"><B>Description</B></A>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Interface Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../javax/xml/transform/sax/TemplatesHandler.html" title="interface in javax.xml.transform.sax">TemplatesHandler</A></B></TD>
<TD>A SAX ContentHandler that may be used to process SAX
parse events (parsing transformation instructions) into a Templates object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../javax/xml/transform/sax/TransformerHandler.html" title="interface in javax.xml.transform.sax">TransformerHandler</A></B></TD>
<TD>A TransformerHandler
listens for SAX ContentHandler parse events and transforms
them to a Result.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../javax/xml/transform/sax/SAXResult.html" title="class in javax.xml.transform.sax">SAXResult</A></B></TD>
<TD>Acts as an holder for a transformation Result.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../javax/xml/transform/sax/SAXSource.html" title="class in javax.xml.transform.sax">SAXSource</A></B></TD>
<TD>Acts as an holder for SAX-style Source.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../javax/xml/transform/sax/SAXTransformerFactory.html" title="class in javax.xml.transform.sax">SAXTransformerFactory</A></B></TD>
<TD>This class extends TransformerFactory to provide SAX-specific
factory methods.</TD>
</TR>
</TABLE>
<P>
<A NAME="package_description"><!-- --></A><H2>
Package javax.xml.transform.sax Description
</H2>
<P>
<p>This package implements SAX2-specific transformation APIs. It provides
classes which allow input from <CODE>ContentHandler</CODE>
events, and also classes that produce org.xml.sax.ContentHandler events. It
also provides methods to set the input source as an
<CODE>XMLReader</CODE>, or to use a
<CODE>InputSource</CODE> as the source. It also allows the
creation of a <CODE>XMLFilter</CODE>, which enables
transformations to "pull" from other transformations, and lets the transformer
to be used polymorphically as an <CODE>XMLReader</CODE>.</p>
<p>The <A HREF="../../../../javax/xml/transform/sax/SAXSource.html" title="class in javax.xml.transform.sax"><CODE>SAXSource</CODE></A> class allows the
setting of an <CODE>XMLReader</CODE> to be used for "pulling"
parse events, and an <CODE>InputSource</CODE> that may be used to
specify the SAX source.</p>
<p>The <A HREF="../../../../javax/xml/transform/sax/SAXResult.html" title="class in javax.xml.transform.sax"><CODE>SAXResult</CODE></A> class allows the
setting of a <CODE>ContentHandler</CODE> to be the receiver of
SAX2 events from the transformation.
<p>The <A HREF="../../../../javax/xml/transform/sax/SAXTransformerFactory.html" title="class in javax.xml.transform.sax"><CODE>SAXTransformerFactory</CODE></A> extends
<A HREF="../../../../javax/xml/transform/TransformerFactory.html" title="class in javax.xml.transform"><CODE>TransformerFactory</CODE></A> to provide factory
methods for creating <A HREF="../../../../javax/xml/transform/sax/TemplatesHandler.html" title="interface in javax.xml.transform.sax"><CODE>TemplatesHandler</CODE></A>,
<A HREF="../../../../javax/xml/transform/sax/TransformerHandler.html" title="interface in javax.xml.transform.sax"><CODE>TransformerHandler</CODE></A>, and
<CODE>XMLReader</CODE> instances.</p>
<p>To obtain a <A HREF="../../../../javax/xml/transform/sax/SAXTransformerFactory.html" title="class in javax.xml.transform.sax"><CODE>SAXTransformerFactory</CODE></A>,
the caller must cast the <A HREF="../../../../javax/xml/transform/TransformerFactory.html" title="class in javax.xml.transform"><CODE>TransformerFactory</CODE></A>
instance returned from
<A HREF="../../../../javax/xml/transform/TransformerFactory.html#newInstance()"><CODE>TransformerFactory.newInstance()</CODE></A>.
<p>The <A HREF="../../../../javax/xml/transform/sax/TransformerHandler.html" title="interface in javax.xml.transform.sax"><CODE>TransformerHandler</CODE></A> interface
allows a transformation to be created from SAX2 parse events, which is a "push"
model rather than the "pull" model that normally occurs for a transformation.
Normal parse events are received through the
<CODE>ContentHandler</CODE> interface, lexical events such as
startCDATA and endCDATA are received through the
<CODE>LexicalHandler</CODE> interface, and events that signal
the start or end of disabling output escaping are received via
<CODE>ContentHandler.processingInstruction(java.lang.String, java.lang.String)</CODE>, with the
target parameter being
<A HREF="../../../../javax/xml/transform/Result.html#PI_DISABLE_OUTPUT_ESCAPING"><CODE>Result.PI_DISABLE_OUTPUT_ESCAPING</CODE></A> and
<A HREF="../../../../javax/xml/transform/Result.html#PI_ENABLE_OUTPUT_ESCAPING"><CODE>Result.PI_ENABLE_OUTPUT_ESCAPING</CODE></A>. If
parameters, output properties, or other features need to be set on the
Transformer handler, a <A HREF="../../../../javax/xml/transform/Transformer.html" title="class in javax.xml.transform"><CODE>Transformer</CODE></A> reference
will need to be obtained from
<A HREF="../../../../javax/xml/transform/sax/TransformerHandler.html#getTransformer()"><CODE>TransformerHandler.getTransformer()</CODE></A>, and
the methods invoked from that reference.
<p>The <A HREF="../../../../javax/xml/transform/sax/TemplatesHandler.html" title="interface in javax.xml.transform.sax"><CODE>TemplatesHandler</CODE></A> interface
allows the creation of <A HREF="../../../../javax/xml/transform/Templates.html" title="interface in javax.xml.transform"><CODE>Templates</CODE></A> objects
from SAX2 parse events. Once the <CODE>ContentHandler</CODE>
events are complete, the Templates object may be obtained from
<A HREF="../../../../javax/xml/transform/sax/TemplatesHandler.html#getTemplates()"><CODE>TemplatesHandler.getTemplates()</CODE></A>. Note that
<A HREF="../../../../javax/xml/transform/sax/TemplatesHandler.html#setSystemId(java.lang.String)"><CODE>TemplatesHandler.setSystemId(java.lang.String)</CODE></A> should
normally be called in order to establish a base system ID from which relative
URLs may be resolved.
<p>The
<A HREF="../../../../javax/xml/transform/sax/SAXTransformerFactory.html#newXMLFilter(javax.xml.transform.Source)"><CODE>SAXTransformerFactory.newXMLFilter(javax.xml.transform.Source)</CODE></A>
method allows the creation of a <CODE>XMLFilter</CODE>, which
encapsulates the SAX2 notion of a "pull" transformation. The following
illustrates several transformations chained together. Each filter points to a
parent <CODE>XMLReader</CODE>, and the final transformation is
caused by invoking <CODE>XMLReader.parse(java.lang.String)</CODE> on the final
reader in the chain.</p>
<P>
<P>
<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=3 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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</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="../../../../javax/xml/transform/dom/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../javax/xml/transform/stream/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-summary.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>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|