2
* Copyright 2003-2004 The Apache Software Foundation.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
// $Id: Templates.java 226183 2005-04-08 10:39:14Z neeraj $
19
package javax.xml.transform;
21
import java.util.Properties;
27
* An object that implements this interface is the runtime representation of processed
28
* transformation instructions.
30
* <p>Templates must be threadsafe for a given instance
31
* over multiple threads running concurrently, and may
32
* be used multiple times in a given session.</p>
34
public interface Templates {
37
* Create a new transformation context for this Templates object.
39
* @return A valid non-null instance of a Transformer.
41
* @throws TransformerConfigurationException if a Transformer can not be created.
43
Transformer newTransformer() throws TransformerConfigurationException;
46
* Get the properties corresponding to the effective xsl:output element.
47
* The object returned will
48
* be a clone of the internal values. Accordingly, it can be mutated
49
* without mutating the Templates object, and then handed in to
50
* {@link javax.xml.transform.Transformer#setOutputProperties}.
52
* <p>The properties returned should contain properties set by the stylesheet,
53
* and these properties are "defaulted" by default properties specified by
54
* <a href="http://www.w3.org/TR/xslt#output">section 16 of the
55
* XSL Transformations (XSLT) W3C Recommendation</a>. The properties that
56
* were specifically set by the stylesheet should be in the base
57
* Properties list, while the XSLT default properties that were not
58
* specifically set should be in the "default" Properties list. Thus,
59
* getOutputProperties().getProperty(String key) will obtain any
60
* property in that was set by the stylesheet, <em>or</em> the default
62
* getOutputProperties().get(String key) will only retrieve properties
63
* that were explicitly set in the stylesheet.</p>
66
* <a href="http://www.w3.org/TR/xslt#attribute-value-templates">Attribute
67
* Value Templates</a> attribute values will
68
* be returned unexpanded (since there is no context at this point). The
69
* namespace prefixes inside Attribute Value Templates will be unexpanded,
70
* so that they remain valid XPath values.</p>
72
* @return A Properties object, never null.
74
Properties getOutputProperties();