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