jaxp/src/java.xml/share/classes/javax/xml/transform/sax/package.html
changeset 45359 a55c79938b9c
parent 45358 0f6f055948f1
child 45360 71093c519b3e
equal deleted inserted replaced
45358:0f6f055948f1 45359:a55c79938b9c
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!--
       
     3 Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
       
     4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     5 
       
     6 This code is free software; you can redistribute it and/or modify it
       
     7 under the terms of the GNU General Public License version 2 only, as
       
     8 published by the Free Software Foundation.  Oracle designates this
       
     9 particular file as subject to the "Classpath" exception as provided
       
    10 by Oracle in the LICENSE file that accompanied this code.
       
    11 
       
    12 This code is distributed in the hope that it will be useful, but WITHOUT
       
    13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    15 version 2 for more details (a copy is included in the LICENSE file that
       
    16 accompanied this code).
       
    17 
       
    18 You should have received a copy of the GNU General Public License version
       
    19 2 along with this work; if not, write to the Free Software Foundation,
       
    20 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    21 
       
    22 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    23 or visit www.oracle.com if you need additional information or have any
       
    24 questions. 
       
    25 -->
       
    26 
       
    27 <!DOCTYPE html
       
    28      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       
    29      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
       
    30 
       
    31 <html xmlns="http://www.w3.org/1999/xhtml">
       
    32 
       
    33 <head>
       
    34   <title>javax.xml.transform.sax</title>
       
    35 
       
    36   <meta name="CVS"
       
    37         content="$Id: package.html,v 1.2 2005/06/10 03:50:41 jeffsuttor Exp $" />
       
    38   <meta name="AUTHOR"
       
    39         content="Jeff.Suttor@Sun.com" />
       
    40 </head>
       
    41 
       
    42 <body>
       
    43 <p>This package implements SAX2-specific transformation APIs. It provides
       
    44   classes which allow input from {@link org.xml.sax.ContentHandler}
       
    45   events, and also classes that produce org.xml.sax.ContentHandler events. It
       
    46   also provides methods to set the input source as an
       
    47   {@link org.xml.sax.XMLReader}, or to use a
       
    48   {@link org.xml.sax.InputSource} as the source. It also allows the
       
    49   creation of a {@link org.xml.sax.XMLFilter}, which enables
       
    50   transformations to "pull" from other transformations, and lets the transformer
       
    51   to be used polymorphically as an {@link org.xml.sax.XMLReader}.</p>
       
    52 <p>The {@link javax.xml.transform.sax.SAXSource} class allows the
       
    53   setting of an {@link org.xml.sax.XMLReader} to be used for "pulling"
       
    54   parse events, and an {@link org.xml.sax.InputSource} that may be used to
       
    55   specify the SAX source.</p>
       
    56 <p>The {@link javax.xml.transform.sax.SAXResult} class allows the
       
    57   setting of a {@link org.xml.sax.ContentHandler} to be the receiver of
       
    58   SAX2 events from the transformation. 
       
    59 <p>The {@link javax.xml.transform.sax.SAXTransformerFactory} extends
       
    60   {@link javax.xml.transform.TransformerFactory} to provide factory
       
    61   methods for creating {@link javax.xml.transform.sax.TemplatesHandler},
       
    62   {@link javax.xml.transform.sax.TransformerHandler}, and
       
    63   {@link org.xml.sax.XMLReader} instances.</p>
       
    64 <p>To obtain a {@link javax.xml.transform.sax.SAXTransformerFactory},
       
    65   the caller must cast the {@link javax.xml.transform.TransformerFactory}
       
    66   instance returned from
       
    67   {@link javax.xml.transform.TransformerFactory#newInstance}. 
       
    68 
       
    69 <p>The {@link javax.xml.transform.sax.TransformerHandler} interface
       
    70   allows a transformation to be created from SAX2 parse events, which is a "push"
       
    71   model rather than the "pull" model that normally occurs for a transformation.
       
    72   Normal parse events are received through the
       
    73   {@link org.xml.sax.ContentHandler} interface, lexical events such as
       
    74   startCDATA and endCDATA are received through the
       
    75   {@link org.xml.sax.ext.LexicalHandler} interface, and events that signal
       
    76   the start or end of disabling output escaping are received via
       
    77   {@link org.xml.sax.ContentHandler#processingInstruction}, with the
       
    78   target parameter being
       
    79   {@link javax.xml.transform.Result#PI_DISABLE_OUTPUT_ESCAPING} and
       
    80   {@link javax.xml.transform.Result#PI_ENABLE_OUTPUT_ESCAPING}. If
       
    81   parameters, output properties, or other features need to be set on the
       
    82   Transformer handler, a {@link javax.xml.transform.Transformer} reference
       
    83   will need to be obtained from
       
    84   {@link javax.xml.transform.sax.TransformerHandler#getTransformer}, and
       
    85   the methods invoked from that reference. 
       
    86 
       
    87 <p>The {@link javax.xml.transform.sax.TemplatesHandler} interface
       
    88   allows the creation of {@link javax.xml.transform.Templates} objects
       
    89   from SAX2 parse events. Once the {@link org.xml.sax.ContentHandler}
       
    90   events are complete, the Templates object may be obtained from
       
    91   {@link javax.xml.transform.sax.TemplatesHandler#getTemplates}. Note that
       
    92   {@link javax.xml.transform.sax.TemplatesHandler#setSystemId} should
       
    93   normally be called in order to establish a base system ID from which relative
       
    94   URLs may be resolved. 
       
    95 <p>The
       
    96   {@link javax.xml.transform.sax.SAXTransformerFactory#newXMLFilter}
       
    97   method allows the creation of a {@link org.xml.sax.XMLFilter}, which
       
    98   encapsulates the SAX2 notion of a "pull" transformation. The following
       
    99   illustrates several transformations chained together. Each filter points to a
       
   100   parent {@link org.xml.sax.XMLReader}, and the final transformation is
       
   101   caused by invoking {@link org.xml.sax.XMLReader#parse} on the final
       
   102   reader in the chain.</p>
       
   103 </body>
       
   104 </html>