src/java.xml/share/classes/javax/xml/transform/package-info.java
author thartmann
Fri, 24 Aug 2018 08:17:23 +0200
changeset 51514 1e332d63bd96
parent 49508 8f041818aca9
child 58022 12885822f0c5
permissions -rw-r--r--
8209833: C2 compilation fails with "assert(ex_map->jvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place" Summary: Deoptimize if exception is thrown in _clone intrinsic. Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45359
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
     1
/*
49508
8f041818aca9 8199176: Accessibility issues in java.base docs
joehw
parents: 47216
diff changeset
     2
 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
45359
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
     4
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    10
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    15
 * accompanied this code).
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    16
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    20
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    23
 * questions.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    24
 */
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    25
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    26
/**
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    27
 * Defines the generic APIs for processing transformation instructions,
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    28
 * and performing a transformation from source to result. These interfaces have no
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    29
 * dependencies on SAX or the DOM standard, and try to make as few assumptions as
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    30
 * possible about the details of the source and result of a transformation. It
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    31
 * achieves this by defining {@link javax.xml.transform.Source} and
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    32
 * {@link javax.xml.transform.Result} interfaces.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    33
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    34
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    35
 * To provide concrete classes for the user, the API defines specializations
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    36
 * of the interfaces found at the root level. These interfaces are found in
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    37
 * {@link javax.xml.transform.sax}, {@link javax.xml.transform.dom},
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    38
 * {@link javax.xml.transform.stax}, and {@link javax.xml.transform.stream}.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    39
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    40
 *
49508
8f041818aca9 8199176: Accessibility issues in java.base docs
joehw
parents: 47216
diff changeset
    41
 * <h2>Creating Objects</h2>
45359
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    42
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    43
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    44
 * The API allows a concrete {@link javax.xml.transform.TransformerFactory}
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    45
 * object to be created from the static function
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    46
 * {@link javax.xml.transform.TransformerFactory#newInstance}.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    47
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    48
 *
49508
8f041818aca9 8199176: Accessibility issues in java.base docs
joehw
parents: 47216
diff changeset
    49
 * <h2>Specification of Inputs and Outputs</h2>
45359
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    50
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    51
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    52
 * This API defines two interface objects called {@link javax.xml.transform.Source}
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    53
 * and {@link javax.xml.transform.Result}. In order to pass Source and Result
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    54
 * objects to the interfaces, concrete classes must be used. The following concrete
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    55
 * representations are defined for each of these objects:
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    56
 * {@link javax.xml.transform.stream.StreamSource} and
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    57
 * {@link javax.xml.transform.stream.StreamResult},
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    58
 * {@link javax.xml.transform.stax.StAXSource} and
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    59
 * {@link javax.xml.transform.stax.StAXResult}, and
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    60
 * {@link javax.xml.transform.sax.SAXSource} and
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    61
 * {@link javax.xml.transform.sax.SAXResult}, and
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    62
 * {@link javax.xml.transform.dom.DOMSource} and
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    63
 * {@link javax.xml.transform.dom.DOMResult}. Each of these objects defines a
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    64
 * FEATURE string (which is in the form of a URL), which can be passed into
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    65
 * {@link javax.xml.transform.TransformerFactory#getFeature} to see if the given
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    66
 * type of Source or Result object is supported. For instance, to test if a
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    67
 * DOMSource and a StreamResult is supported, you can apply the following test.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    68
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    69
 * <pre>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    70
 * <code>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    71
 * TransformerFactory tfactory = TransformerFactory.newInstance();
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    72
 * if (tfactory.getFeature(DOMSource.FEATURE) &amp;&amp;
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    73
 *     tfactory.getFeature(StreamResult.FEATURE)) {
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    74
 *     ...
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    75
 * }
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    76
 * </code>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    77
 * </pre>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    78
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    79
 *
49508
8f041818aca9 8199176: Accessibility issues in java.base docs
joehw
parents: 47216
diff changeset
    80
 * <h2><a id="qname-delimiter">Qualified Name Representation</a></h2>
45359
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    81
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    82
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    83
 * <a href="http://www.w3.org/TR/REC-xml-names">Namespaces</a> present something
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    84
 * of a problem area when dealing with XML objects. Qualified Names appear in XML
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    85
 * markup as prefixed names. But the prefixes themselves do not hold identity.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    86
 * Rather, it is the URIs that they contextually map to that hold the identity.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    87
 * Therefore, when passing a Qualified Name like "xyz:foo" among Java programs,
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    88
 * one must provide a means to map "xyz" to a namespace.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    89
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    90
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    91
 * One solution has been to create a "QName" object that holds the namespace URI,
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    92
 * as well as the prefix and local name, but this is not always an optimal solution,
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    93
 * as when, for example, you want to use unique strings as keys in a dictionary
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    94
 * object. Not having a string representation also makes it difficult to specify
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    95
 * a namespaced identity outside the context of an XML document.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    96
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    97
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    98
 * In order to pass namespaced values to transformations, for instance when setting
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
    99
 * a property or a parameter on a {@link javax.xml.transform.Transformer} object,
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   100
 * this specification defines that a String "qname" object parameter be passed as
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   101
 * two-part string, the namespace URI enclosed in curly braces ({}), followed by
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   102
 * the local name. If the qname has a null URI, then the String object only
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   103
 * contains the local name. An application can safely check for a non-null URI by
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   104
 * testing to see if the first character of the name is a '{' character.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   105
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   106
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   107
 * For example, if a URI and local name were obtained from an element defined with
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   108
 * &lt;xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/&gt;, then the
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   109
 * Qualified Name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that the
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   110
 * prefix is lost.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   111
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   112
 *
49508
8f041818aca9 8199176: Accessibility issues in java.base docs
joehw
parents: 47216
diff changeset
   113
 * <h2>Result Tree Serialization</h2>
45359
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   114
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   115
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   116
 * Serialization of the result tree to a stream can be controlled with the
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   117
 * {@link javax.xml.transform.Transformer#setOutputProperties} and the
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   118
 * {@link javax.xml.transform.Transformer#setOutputProperty} methods.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   119
 * These properties only apply to stream results, they have no effect when
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   120
 * the result is a DOM tree or SAX event stream.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   121
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   122
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   123
 * Strings that match the <a href="http://www.w3.org/TR/xslt#output">XSLT
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   124
 * specification for xsl:output attributes</a> can be referenced from the
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   125
 * {@link javax.xml.transform.OutputKeys} class. Other strings can be
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   126
 * specified as well.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   127
 * If the transformer does not recognize an output key, a
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   128
 * {@link java.lang.IllegalArgumentException} is thrown, unless the key name
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   129
 * is <a href="#qname-delimiter">namespace qualified</a>. Output key names
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   130
 * that are namespace qualified are always allowed, although they may be
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   131
 * ignored by some implementations.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   132
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   133
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   134
 * If all that is desired is the simple identity transformation of a
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   135
 * source to a result, then {@link javax.xml.transform.TransformerFactory}
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   136
 * provides a
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   137
 * {@link javax.xml.transform.TransformerFactory#newTransformer()} method
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   138
 * with no arguments. This method creates a Transformer that effectively copies
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   139
 * the source to the result. This method may be used to create a DOM from SAX
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   140
 * events or to create an XML or HTML stream from a DOM or SAX events.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   141
 *
49508
8f041818aca9 8199176: Accessibility issues in java.base docs
joehw
parents: 47216
diff changeset
   142
 * <h2>Exceptions and Error Reporting</h2>
45359
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   143
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   144
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   145
 * The transformation API throw three types of specialized exceptions. A
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   146
 * {@link javax.xml.transform.TransformerFactoryConfigurationError} is parallel to
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   147
 * the {@link javax.xml.parsers.FactoryConfigurationError}, and is thrown
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   148
 * when a configuration problem with the TransformerFactory exists. This error
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   149
 * will typically be thrown when the transformation factory class specified with
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   150
 * the "javax.xml.transform.TransformerFactory" system property cannot be found or
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   151
 * instantiated.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   152
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   153
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   154
 * A {@link javax.xml.transform.TransformerConfigurationException}
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   155
 * may be thrown if for any reason a Transformer can not be created. A
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   156
 * TransformerConfigurationException may be thrown if there is a syntax error in
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   157
 * the transformation instructions, for example when
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   158
 * {@link javax.xml.transform.TransformerFactory#newTransformer} is
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   159
 * called.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   160
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   161
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   162
 * {@link javax.xml.transform.TransformerException} is a general
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   163
 * exception that occurs during the course of a transformation. A transformer
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   164
 * exception may wrap another exception, and if any of the
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   165
 * {@link javax.xml.transform.TransformerException#printStackTrace()}
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   166
 * methods are called on it, it will produce a list of stack dumps, starting from
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   167
 * the most recent. The transformer exception also provides a
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   168
 * {@link javax.xml.transform.SourceLocator} object which indicates where
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   169
 * in the source tree or transformation instructions the error occurred.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   170
 * {@link javax.xml.transform.TransformerException#getMessageAndLocation()}
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   171
 * may be called to get an error message with location info, and
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   172
 * {@link javax.xml.transform.TransformerException#getLocationAsString()}
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   173
 * may be called to get just the location string.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   174
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   175
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   176
 * Transformation warnings and errors are sent to an
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   177
 * {@link javax.xml.transform.ErrorListener}, at which point the application may
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   178
 * decide to report the error or warning, and may decide to throw an
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   179
 * <code>Exception</code> for a non-fatal error. The <code>ErrorListener</code>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   180
 * may be set via {@link javax.xml.transform.TransformerFactory#setErrorListener}
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   181
 * for reporting errors that have to do with syntax errors in the transformation
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   182
 * instructions, or via {@link javax.xml.transform.Transformer#setErrorListener}
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   183
 * to report errors that occur during the transformation. The <code>ErrorListener</code>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   184
 * on both objects will always be valid and non-<code>null</code>, whether set by
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   185
 * the application or a default implementation provided by the processor.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   186
 * The default implementation provided by the processor will report all warnings
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   187
 * and errors to <code>System.err</code> and does not throw any <code>Exception</code>s.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   188
 * Applications are <em>strongly</em> encouraged to register and use
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   189
 * <code>ErrorListener</code>s that insure proper behavior for warnings and
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   190
 * errors.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   191
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   192
 *
49508
8f041818aca9 8199176: Accessibility issues in java.base docs
joehw
parents: 47216
diff changeset
   193
 * <h2>Resolution of URIs within a transformation</h2>
45359
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   194
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   195
 * <p>
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   196
 * The API provides a way for URIs referenced from within the stylesheet
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   197
 * instructions or within the transformation to be resolved by the calling
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   198
 * application. This can be done by creating a class that implements the
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   199
 * {@link javax.xml.transform.URIResolver} interface, with its one method,
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   200
 * {@link javax.xml.transform.URIResolver#resolve}, and use this class to
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   201
 * set the URI resolution for the transformation instructions or transformation
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   202
 * with {@link javax.xml.transform.TransformerFactory#setURIResolver} or
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   203
 * {@link javax.xml.transform.Transformer#setURIResolver}. The
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   204
 * <code>URIResolver.resolve</code> method takes two String arguments, the URI
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   205
 * found in the stylesheet instructions or built as part of the transformation
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   206
 * process, and the base URI against which the first argument will be made absolute
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   207
 * if the absolute URI is required.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   208
 * The returned {@link javax.xml.transform.Source} object must be usable by
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   209
 * the transformer, as specified in its implemented features.
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   210
 *
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   211
 * @since 1.5
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   212
 */
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   213
a55c79938b9c 8180349: Review JAXP Java SE 9 API javadocs
joehw
parents:
diff changeset
   214
package javax.xml.transform;