1. /*
  2. * Copyright 2003-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*
  17. * $Id: XSLOutputAttributes.java,v 1.2 2004/02/17 04:18:18 minchau Exp $
  18. */
  19. package com.sun.org.apache.xml.internal.serializer;
  20. import java.util.Vector;
  21. /**
  22. * This interface has methods associated with the XSLT xsl:output attribues
  23. * specified in the stylesheet that effect the format of the document output.
  24. *
  25. * In an XSLT stylesheet these attributes appear for example as:
  26. * <pre>
  27. * <xsl:output method="xml" omit-xml-declaration="no" indent="yes"/>
  28. * </pre>
  29. * The xsl:output attributes covered in this interface are:
  30. * <pre>
  31. * version
  32. * encoding
  33. * omit-xml-declarations
  34. * standalone
  35. * doctype-public
  36. * doctype-system
  37. * cdata-section-elements
  38. * indent
  39. * media-type
  40. * </pre>
  41. *
  42. * The one attribute not covered in this interface is <code>method</code> as
  43. * this value is implicitly chosen by the serializer that is created, for
  44. * example ToXMLStream vs. ToHTMLStream or another one.
  45. */
  46. public interface XSLOutputAttributes
  47. {
  48. /**
  49. * Returns the previously set value of the value to be used as the public
  50. * identifier in the document type declaration (DTD).
  51. *
  52. *@return the public identifier to be used in the DOCTYPE declaration in the
  53. * output document.
  54. */
  55. public String getDoctypePublic();
  56. /**
  57. * Returns the previously set value of the value to be used
  58. * as the system identifier in the document type declaration (DTD).
  59. * @return the system identifier to be used in the DOCTYPE declaration in
  60. * the output document.
  61. *
  62. */
  63. public String getDoctypeSystem();
  64. /**
  65. * @return the character encoding to be used in the output document.
  66. */
  67. public String getEncoding();
  68. /**
  69. * @return true if the output document should be indented to visually
  70. * indicate its structure.
  71. */
  72. public boolean getIndent();
  73. /**
  74. * @return the number of spaces to indent for each indentation level.
  75. */
  76. public int getIndentAmount();
  77. /**
  78. * @return the mediatype the media-type or MIME type associated with the
  79. * output document.
  80. */
  81. public String getMediaType();
  82. /**
  83. * @return true if the XML declaration is to be omitted from the output
  84. * document.
  85. */
  86. public boolean getOmitXMLDeclaration();
  87. /**
  88. * @return a value of "yes" if the <code>standalone</code> delaration is to
  89. * be included in the output document.
  90. */
  91. public String getStandalone();
  92. /**
  93. * @return the version of the output format.
  94. */
  95. public String getVersion();
  96. /**
  97. * Sets the value coming from the xsl:output cdata-section-elements
  98. * stylesheet property.
  99. *
  100. * This sets the elements whose text elements are to be output as CDATA
  101. * sections.
  102. * @param URI_and_localNames pairs of namespace URI and local names that
  103. * identify elements whose text elements are to be output as CDATA sections.
  104. * The namespace of the local element must be the given URI to match. The
  105. * qName is not given because the prefix does not matter, only the namespace
  106. * URI to which that prefix would map matters, so the prefix itself is not
  107. * relevant in specifying which elements have their text to be output as
  108. * CDATA sections.
  109. */
  110. public void setCdataSectionElements(Vector URI_and_localNames);
  111. /** Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties
  112. * @param system the system identifier to be used in the DOCTYPE declaration
  113. * in the output document.
  114. * @param pub the public identifier to be used in the DOCTYPE declaration in
  115. * the output document.
  116. */
  117. public void setDoctype(String system, String pub);
  118. /** Set the value coming from the xsl:output doctype-public stylesheet attribute.
  119. * @param doctype the public identifier to be used in the DOCTYPE
  120. * declaration in the output document.
  121. */
  122. public void setDoctypePublic(String doctype);
  123. /** Set the value coming from the xsl:output doctype-system stylesheet attribute.
  124. * @param doctype the system identifier to be used in the DOCTYPE
  125. * declaration in the output document.
  126. */
  127. public void setDoctypeSystem(String doctype);
  128. /**
  129. * Sets the character encoding coming from the xsl:output encoding stylesheet attribute.
  130. * @param encoding the character encoding
  131. */
  132. public void setEncoding(String encoding);
  133. /**
  134. * Sets the value coming from the xsl:output indent stylesheet
  135. * attribute.
  136. * @param indent true if the output document should be indented to visually
  137. * indicate its structure.
  138. */
  139. public void setIndent(boolean indent);
  140. /**
  141. * Sets the value coming from the xsl:output media-type stylesheet attribute.
  142. * @param mediatype the media-type or MIME type associated with the output
  143. * document.
  144. */
  145. public void setMediaType(String mediatype);
  146. /**
  147. * Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute
  148. * @param b true if the XML declaration is to be omitted from the output
  149. * document.
  150. */
  151. public void setOmitXMLDeclaration(boolean b);
  152. /**
  153. * Sets the value coming from the xsl:output standalone stylesheet attribute.
  154. * @param standalone a value of "yes" indicates that the
  155. * <code>standalone</code> delaration is to be included in the output
  156. * document.
  157. */
  158. public void setStandalone(String standalone);
  159. /**
  160. * Sets the value coming from the xsl:output version attribute.
  161. * @param version the version of the output format.
  162. */
  163. public void setVersion(String version);
  164. }