1 /* |
1 /* |
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
36 * of the interfaces found at the root level. These interfaces are found in |
36 * of the interfaces found at the root level. These interfaces are found in |
37 * {@link javax.xml.transform.sax}, {@link javax.xml.transform.dom}, |
37 * {@link javax.xml.transform.sax}, {@link javax.xml.transform.dom}, |
38 * {@link javax.xml.transform.stax}, and {@link javax.xml.transform.stream}. |
38 * {@link javax.xml.transform.stax}, and {@link javax.xml.transform.stream}. |
39 * |
39 * |
40 * |
40 * |
41 * <h3>Creating Objects</h3> |
41 * <h2>Creating Objects</h2> |
42 * |
42 * |
43 * <p> |
43 * <p> |
44 * The API allows a concrete {@link javax.xml.transform.TransformerFactory} |
44 * The API allows a concrete {@link javax.xml.transform.TransformerFactory} |
45 * object to be created from the static function |
45 * object to be created from the static function |
46 * {@link javax.xml.transform.TransformerFactory#newInstance}. |
46 * {@link javax.xml.transform.TransformerFactory#newInstance}. |
47 * |
47 * |
48 * |
48 * |
49 * <h3>Specification of Inputs and Outputs</h3> |
49 * <h2>Specification of Inputs and Outputs</h2> |
50 * |
50 * |
51 * <p> |
51 * <p> |
52 * This API defines two interface objects called {@link javax.xml.transform.Source} |
52 * This API defines two interface objects called {@link javax.xml.transform.Source} |
53 * and {@link javax.xml.transform.Result}. In order to pass Source and Result |
53 * and {@link javax.xml.transform.Result}. In order to pass Source and Result |
54 * objects to the interfaces, concrete classes must be used. The following concrete |
54 * objects to the interfaces, concrete classes must be used. The following concrete |
75 * } |
75 * } |
76 * </code> |
76 * </code> |
77 * </pre> |
77 * </pre> |
78 * |
78 * |
79 * |
79 * |
80 * <h3> |
80 * <h2><a id="qname-delimiter">Qualified Name Representation</a></h2> |
81 * <a id="qname-delimiter">Qualified Name Representation</a> |
|
82 * </h3> |
|
83 * |
81 * |
84 * <p> |
82 * <p> |
85 * <a href="http://www.w3.org/TR/REC-xml-names">Namespaces</a> present something |
83 * <a href="http://www.w3.org/TR/REC-xml-names">Namespaces</a> present something |
86 * of a problem area when dealing with XML objects. Qualified Names appear in XML |
84 * of a problem area when dealing with XML objects. Qualified Names appear in XML |
87 * markup as prefixed names. But the prefixes themselves do not hold identity. |
85 * markup as prefixed names. But the prefixes themselves do not hold identity. |
110 * <xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/>, then the |
108 * <xyz:foo xmlns:xyz="http://xyz.foo.com/yada/baz.html"/>, then the |
111 * Qualified Name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that the |
109 * Qualified Name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that the |
112 * prefix is lost. |
110 * prefix is lost. |
113 * |
111 * |
114 * |
112 * |
115 * <h3>Result Tree Serialization</h3> |
113 * <h2>Result Tree Serialization</h2> |
116 * |
114 * |
117 * <p> |
115 * <p> |
118 * Serialization of the result tree to a stream can be controlled with the |
116 * Serialization of the result tree to a stream can be controlled with the |
119 * {@link javax.xml.transform.Transformer#setOutputProperties} and the |
117 * {@link javax.xml.transform.Transformer#setOutputProperties} and the |
120 * {@link javax.xml.transform.Transformer#setOutputProperty} methods. |
118 * {@link javax.xml.transform.Transformer#setOutputProperty} methods. |
139 * {@link javax.xml.transform.TransformerFactory#newTransformer()} method |
137 * {@link javax.xml.transform.TransformerFactory#newTransformer()} method |
140 * with no arguments. This method creates a Transformer that effectively copies |
138 * with no arguments. This method creates a Transformer that effectively copies |
141 * the source to the result. This method may be used to create a DOM from SAX |
139 * the source to the result. This method may be used to create a DOM from SAX |
142 * events or to create an XML or HTML stream from a DOM or SAX events. |
140 * events or to create an XML or HTML stream from a DOM or SAX events. |
143 * |
141 * |
144 * <h3>Exceptions and Error Reporting</h3> |
142 * <h2>Exceptions and Error Reporting</h2> |
145 * |
143 * |
146 * <p> |
144 * <p> |
147 * The transformation API throw three types of specialized exceptions. A |
145 * The transformation API throw three types of specialized exceptions. A |
148 * {@link javax.xml.transform.TransformerFactoryConfigurationError} is parallel to |
146 * {@link javax.xml.transform.TransformerFactoryConfigurationError} is parallel to |
149 * the {@link javax.xml.parsers.FactoryConfigurationError}, and is thrown |
147 * the {@link javax.xml.parsers.FactoryConfigurationError}, and is thrown |
190 * Applications are <em>strongly</em> encouraged to register and use |
188 * Applications are <em>strongly</em> encouraged to register and use |
191 * <code>ErrorListener</code>s that insure proper behavior for warnings and |
189 * <code>ErrorListener</code>s that insure proper behavior for warnings and |
192 * errors. |
190 * errors. |
193 * |
191 * |
194 * |
192 * |
195 * <h3>Resolution of URIs within a transformation</h3> |
193 * <h2>Resolution of URIs within a transformation</h2> |
196 * |
194 * |
197 * <p> |
195 * <p> |
198 * The API provides a way for URIs referenced from within the stylesheet |
196 * The API provides a way for URIs referenced from within the stylesheet |
199 * instructions or within the transformation to be resolved by the calling |
197 * instructions or within the transformation to be resolved by the calling |
200 * application. This can be done by creating a class that implements the |
198 * application. This can be done by creating a class that implements the |