1. /*
  2. * @(#)OutputKeys.java 1.15 04/07/26
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.xml.transform;
  8. /**
  9. * Provides string constants that can be used to set
  10. * output properties for a Transformer, or to retrieve
  11. * output properties from a Transformer or Templates object.
  12. * <p>All the fields in this class are read-only.</p>
  13. *
  14. * @see <a href="http://www.w3.org/TR/xslt#output">
  15. * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  16. */
  17. public class OutputKeys {
  18. /**
  19. * Default constructor is private on purpose. This class is
  20. * only for static variable access, and should never be constructed.
  21. */
  22. private OutputKeys() { }
  23. /**
  24. * method = "xml" | "html" | "text" | <var>expanded name</var>.
  25. *
  26. * <p>The value of the method property identifies the overall method that
  27. * should be used for outputting the result tree. Other non-namespaced
  28. * values may be used, such as "xhtml", but, if accepted, the handling
  29. * of such values is implementation defined. If any of the method values
  30. * are not accepted and are not namespace qualified,
  31. * then {@link javax.xml.transform.Transformer#setOutputProperty}
  32. * or {@link javax.xml.transform.Transformer#setOutputProperties} will
  33. * throw a {@link java.lang.IllegalArgumentException}.</p>
  34. *
  35. * @see <a href="http://www.w3.org/TR/xslt#output">
  36. * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  37. */
  38. public static final String METHOD = "method";
  39. /**
  40. * version = <var>nmtoken</var>.
  41. *
  42. * <p><code>version</code> specifies the version of the output
  43. * method.</p>
  44. * <p>When the output method is "xml", the version value specifies the
  45. * version of XML to be used for outputting the result tree. The default
  46. * value for the xml output method is 1.0. When the output method is
  47. * "html", the version value indicates the version of the HTML.
  48. * The default value for the xml output method is 4.0, which specifies
  49. * that the result should be output as HTML conforming to the HTML 4.0
  50. * Recommendation [HTML]. If the output method is "text", the version
  51. * property is ignored.</p>
  52. * @see <a href="http://www.w3.org/TR/xslt#output">
  53. * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  54. */
  55. public static final String VERSION = "version";
  56. /**
  57. * encoding = <var>string</var>.
  58. *
  59. * <p><code>encoding</code> specifies the preferred character
  60. * encoding that the Transformer should use to encode sequences of
  61. * characters as sequences of bytes. The value of the encoding property should be
  62. * treated case-insensitively. The value must only contain characters in
  63. * the range #x21 to #x7E (i.e., printable ASCII characters). The value
  64. * should either be a <code>charset</code> registered with the Internet
  65. * Assigned Numbers Authority <a href="#IANA">[IANA]</a>,
  66. * <a href="#RFC2278">[RFC2278]</a> or start with <code>X-</code>.</p>
  67. * @see <a href="http://www.w3.org/TR/xslt#output">
  68. * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  69. */
  70. public static final String ENCODING = "encoding";
  71. /**
  72. * omit-xml-declaration = "yes" | "no".
  73. *
  74. * <p><code>omit-xml-declaration</code> specifies whether the XSLT
  75. * processor should output an XML declaration; the value must be
  76. * <code>yes</code> or <code>no</code>.</p>
  77. * @see <a href="http://www.w3.org/TR/xslt#output">
  78. * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  79. */
  80. public static final String OMIT_XML_DECLARATION = "omit-xml-declaration";
  81. /**
  82. * standalone = "yes" | "no".
  83. *
  84. * <p><code>standalone</code> specifies whether the Transformer
  85. * should output a standalone document declaration; the value must be
  86. * <code>yes</code> or <code>no</code>.</p>
  87. * @see <a href="http://www.w3.org/TR/xslt#output">
  88. * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  89. */
  90. public static final String STANDALONE = "standalone";
  91. /**
  92. * doctype-public = <var>string</var>.
  93. * <p>See the documentation for the {@link #DOCTYPE_SYSTEM} property
  94. * for a description of what the value of the key should be.</p>
  95. *
  96. * @see <a href="http://www.w3.org/TR/xslt#output">
  97. * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  98. */
  99. public static final String DOCTYPE_PUBLIC = "doctype-public";
  100. /**
  101. * doctype-system = <var>string</var>.
  102. * <p><code>doctype-system</code> specifies the system identifier
  103. * to be used in the document type declaration.</p>
  104. * <p>If the doctype-system property is specified, the xml output method
  105. * should output a document type declaration immediately before the first
  106. * element. The name following <!DOCTYPE should be the name of the first
  107. * element. If doctype-public property is also specified, then the xml
  108. * output method should output PUBLIC followed by the public identifier
  109. * and then the system identifier; otherwise, it should output SYSTEM
  110. * followed by the system identifier. The internal subset should be empty.
  111. * The value of the doctype-public property should be ignored unless the doctype-system
  112. * property is specified.</p>
  113. * <p>If the doctype-public or doctype-system properties are specified,
  114. * then the html output method should output a document type declaration
  115. * immediately before the first element. The name following <!DOCTYPE
  116. * should be HTML or html. If the doctype-public property is specified,
  117. * then the output method should output PUBLIC followed by the specified
  118. * public identifier; if the doctype-system property is also specified,
  119. * it should also output the specified system identifier following the
  120. * public identifier. If the doctype-system property is specified but
  121. * the doctype-public property is not specified, then the output method
  122. * should output SYSTEM followed by the specified system identifier.</p>
  123. *
  124. * <p><code>doctype-system</code> specifies the system identifier
  125. * to be used in the document type declaration.</p>
  126. * @see <a href="http://www.w3.org/TR/xslt#output">
  127. * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  128. */
  129. public static final String DOCTYPE_SYSTEM = "doctype-system";
  130. /**
  131. * cdata-section-elements = <var>expanded names</var>.
  132. *
  133. * <p><code>cdata-section-elements</code> specifies a whitespace delimited
  134. * list of the names of elements whose text node children should be output
  135. * using CDATA sections. Note that these names must use the format
  136. * described in the section Qualfied Name Representation in
  137. * {@link javax.xml.transform}.</p>
  138. *
  139. * @see <a href="http://www.w3.org/TR/xslt#output">
  140. * section 16 of the XSL Transformations (XSLT) W3C Recommendation.</a>
  141. */
  142. public static final String CDATA_SECTION_ELEMENTS =
  143. "cdata-section-elements";
  144. /**
  145. * indent = "yes" | "no".
  146. *
  147. * <p><code>indent</code> specifies whether the Transformer may
  148. * add additional whitespace when outputting the result tree; the value
  149. * must be <code>yes</code> or <code>no</code>. </p>
  150. * @see <a href="http://www.w3.org/TR/xslt#output">
  151. * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  152. */
  153. public static final String INDENT = "indent";
  154. /**
  155. * media-type = <var>string</var>.
  156. *
  157. * <p><code>media-type</code> specifies the media type (MIME
  158. * content type) of the data that results from outputting the result
  159. * tree. The <code>charset</code> parameter should not be specified
  160. * explicitly; instead, when the top-level media type is
  161. * <code>text</code>, a <code>charset</code> parameter should be added
  162. * according to the character encoding actually used by the output
  163. * method. </p>
  164. * @see <a href="http://www.w3.org/TR/xslt#output">s
  165. * ection 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
  166. */
  167. public static final String MEDIA_TYPE = "media-type";
  168. }