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