/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html * or packager/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at packager/legal/LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ /* * $Id: Templates.java,v 1.5 2010-11-01 04:36:11 joehw Exp $ * %W% %E% */ package mf.javax.xml.transform; import java.util.Properties; /** * An object that implements this interface is the runtime representation of processed * transformation instructions. * * <p>Templates must be threadsafe for a given instance * over multiple threads running concurrently, and may * be used multiple times in a given session.</p> */ public interface Templates { /** * Create a new transformation context for this Templates object. * * @return A valid non-null instance of a Transformer. * * @throws TransformerConfigurationException if a Transformer can not be created. */ Transformer newTransformer() throws TransformerConfigurationException; /** * Get the properties corresponding to the effective xsl:output element. * The object returned will * be a clone of the internal values. Accordingly, it can be mutated * without mutating the Templates object, and then handed in to * {@link javax.xml.transform.Transformer#setOutputProperties}. * * <p>The properties returned should contain properties set by the stylesheet, * and these properties are "defaulted" by default properties specified by * <a href="http://www.w3.org/TR/xslt#output">section 16 of the * XSL Transformations (XSLT) W3C Recommendation</a>. The properties that * were specifically set by the stylesheet should be in the base * Properties list, while the XSLT default properties that were not * specifically set should be in the "default" Properties list. Thus, * getOutputProperties().getProperty(String key) will obtain any * property in that was set by the stylesheet, <em>or</em> the default * properties, while * getOutputProperties().get(String key) will only retrieve properties * that were explicitly set in the stylesheet.</p> * * <p>For XSLT, * <a href="http://www.w3.org/TR/xslt#attribute-value-templates">Attribute * Value Templates</a> attribute values will * be returned unexpanded (since there is no context at this point). The * namespace prefixes inside Attribute Value Templates will be unexpanded, * so that they remain valid XPath values.</p> * * @return A Properties object, never null. */ Properties getOutputProperties(); }