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