1 /* 2 * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.xml.transform; 27 28 /** 29 * Provides string constants that can be used to set 30 * output properties for a Transformer, or to retrieve 31 * output properties from a Transformer or Templates object. 32 * <p>All the fields in this class are read-only.</p> 33 * 34 * @see <a href="http://www.w3.org/TR/xslt#output"> 35 * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 36 */ 37 public class OutputKeys { 38 39 /** 40 * Default constructor is private on purpose. This class is 41 * only for static variable access, and should never be constructed. 42 */ 43 private OutputKeys() { } 44 45 /** 46 * method = "xml" | "html" | "text" | <var>expanded name</var>. 47 * 48 * <p>The value of the method property identifies the overall method that 49 * should be used for outputting the result tree. Other non-namespaced 50 * values may be used, such as "xhtml", but, if accepted, the handling 51 * of such values is implementation defined. If any of the method values 52 * are not accepted and are not namespace qualified, 53 * then {@link javax.xml.transform.Transformer#setOutputProperty} 54 * or {@link javax.xml.transform.Transformer#setOutputProperties} will 55 * throw a {@link java.lang.IllegalArgumentException}.</p> 56 * 57 * @see <a href="http://www.w3.org/TR/xslt#output"> 58 * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 59 */ 60 public static final String METHOD = "method"; 61 62 /** 63 * version = <var>nmtoken</var>. 64 * 65 * <p><code>version</code> specifies the version of the output 66 * method.</p> 67 * <p>When the output method is "xml", the version value specifies the 68 * version of XML to be used for outputting the result tree. The default 69 * value for the xml output method is 1.0. When the output method is 70 * "html", the version value indicates the version of the HTML. 71 * The default value for the xml output method is 4.0, which specifies 72 * that the result should be output as HTML conforming to the HTML 4.0 73 * Recommendation [HTML]. If the output method is "text", the version 74 * property is ignored.</p> 75 * @see <a href="http://www.w3.org/TR/xslt#output"> 76 * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 77 */ 78 public static final String VERSION = "version"; 79 80 /** 81 * encoding = <var>string</var>. 82 * 83 * <p><code>encoding</code> specifies the preferred character 84 * encoding that the Transformer should use to encode sequences of 85 * characters as sequences of bytes. The value of the encoding property should be 86 * treated case-insensitively. The value must only contain characters in 87 * the range #x21 to #x7E (i.e., printable ASCII characters). The value 88 * should either be a <code>charset</code> registered with the Internet 89 * Assigned Numbers Authority <a href="http://www.iana.org/">[IANA]</a>, 90 * <a href="http://www.ietf.org/rfc/rfc2278.txt">[RFC2278]</a> 91 * or start with <code>X-</code>.</p> 92 * @see <a href="http://www.w3.org/TR/xslt#output"> 93 * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 94 */ 95 public static final String ENCODING = "encoding"; 96 97 /** 98 * omit-xml-declaration = "yes" | "no". 99 * 100 * <p><code>omit-xml-declaration</code> specifies whether the XSLT 101 * processor should output an XML declaration; the value must be 102 * <code>yes</code> or <code>no</code>.</p> 103 * @see <a href="http://www.w3.org/TR/xslt#output"> 104 * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 105 */ 106 public static final String OMIT_XML_DECLARATION = "omit-xml-declaration"; 107 108 /** 109 * standalone = "yes" | "no". 110 * 111 * <p><code>standalone</code> specifies whether the Transformer 112 * should output a standalone document declaration; the value must be 113 * <code>yes</code> or <code>no</code>.</p> 114 * @see <a href="http://www.w3.org/TR/xslt#output"> 115 * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 116 */ 117 public static final String STANDALONE = "standalone"; 118 119 /** 120 * doctype-public = <var>string</var>. 121 * <p>See the documentation for the {@link #DOCTYPE_SYSTEM} property 122 * for a description of what the value of the key should be.</p> 123 * 124 * @see <a href="http://www.w3.org/TR/xslt#output"> 125 * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 126 */ 127 public static final String DOCTYPE_PUBLIC = "doctype-public"; 128 129 /** 130 * doctype-system = <var>string</var>. 131 * <p><code>doctype-system</code> specifies the system identifier 132 * to be used in the document type declaration.</p> 133 * <p>If the doctype-system property is specified, the xml output method 134 * should output a document type declaration immediately before the first 135 * element. The name following <!DOCTYPE should be the name of the first 136 * element. If doctype-public property is also specified, then the xml 137 * output method should output PUBLIC followed by the public identifier 138 * and then the system identifier; otherwise, it should output SYSTEM 139 * followed by the system identifier. The internal subset should be empty. 140 * The value of the doctype-public property should be ignored unless the doctype-system 141 * property is specified.</p> 142 * <p>If the doctype-public or doctype-system properties are specified, 143 * then the html output method should output a document type declaration 144 * immediately before the first element. The name following <!DOCTYPE 145 * should be HTML or html. If the doctype-public property is specified, 146 * then the output method should output PUBLIC followed by the specified 147 * public identifier; if the doctype-system property is also specified, 148 * it should also output the specified system identifier following the 149 * public identifier. If the doctype-system property is specified but 150 * the doctype-public property is not specified, then the output method 151 * should output SYSTEM followed by the specified system identifier.</p> 152 * 153 * <p><code>doctype-system</code> specifies the system identifier 154 * to be used in the document type declaration.</p> 155 * @see <a href="http://www.w3.org/TR/xslt#output"> 156 * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 157 */ 158 public static final String DOCTYPE_SYSTEM = "doctype-system"; 159 160 /** 161 * cdata-section-elements = <var>expanded names</var>. 162 * 163 * <p><code>cdata-section-elements</code> specifies a whitespace delimited 164 * list of the names of elements whose text node children should be output 165 * using CDATA sections. Note that these names must use the format 166 * described in the section Qualfied Name Representation in 167 * {@link javax.xml.transform}.</p> 168 * 169 * @see <a href="http://www.w3.org/TR/xslt#output"> 170 * section 16 of the XSL Transformations (XSLT) W3C Recommendation.</a> 171 */ 172 public static final String CDATA_SECTION_ELEMENTS = 173 "cdata-section-elements"; 174 175 /** 176 * indent = "yes" | "no". 177 * 178 * <p><code>indent</code> specifies whether the Transformer may 179 * add additional whitespace when outputting the result tree; the value 180 * must be <code>yes</code> or <code>no</code>. </p> 181 * @see <a href="http://www.w3.org/TR/xslt#output"> 182 * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 183 */ 184 public static final String INDENT = "indent"; 185 186 /** 187 * media-type = <var>string</var>. 188 * 189 * <p><code>media-type</code> specifies the media type (MIME 190 * content type) of the data that results from outputting the result 191 * tree. The <code>charset</code> parameter should not be specified 192 * explicitly; instead, when the top-level media type is 193 * <code>text</code>, a <code>charset</code> parameter should be added 194 * according to the character encoding actually used by the output 195 * method. </p> 196 * @see <a href="http://www.w3.org/TR/xslt#output">s 197 * ection 16 of the XSL Transformations (XSLT) W3C Recommendation</a> 198 */ 199 public static final String MEDIA_TYPE = "media-type"; 200 }