blob: 6197e6e35ec4e390b63d18df83312e7e14aee9f4 [file] [log] [blame]
Kelly O'Hair13c4ad82012-03-04 11:55:34 -08001/*
2 * reserved comment block
3 * DO NOT REMOVE OR ALTER!
4 */
5/*
Christoph Langer75d947d2016-11-23 08:58:15 +01006 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements. See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080012 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
Christoph Langer75d947d2016-11-23 08:58:15 +010021
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080022package com.sun.org.apache.xml.internal.serializer;
23
David Li38fdd082014-06-11 22:26:30 -070024import java.util.ArrayList;
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080025
26/**
27 * This interface has methods associated with the XSLT xsl:output attribues
28 * specified in the stylesheet that effect the format of the document output.
29 *
30 * In an XSLT stylesheet these attributes appear for example as:
31 * <pre>
32 * <xsl:output method="xml" omit-xml-declaration="no" indent="yes"/>
33 * </pre>
34 * The xsl:output attributes covered in this interface are:
35 * <pre>
36 * version
37 * encoding
38 * omit-xml-declarations
39 * standalone
40 * doctype-public
41 * doctype-system
42 * cdata-section-elements
43 * indent
44 * media-type
45 * </pre>
46 *
47 * The one attribute not covered in this interface is <code>method</code> as
48 * this value is implicitly chosen by the serializer that is created, for
49 * example ToXMLStream vs. ToHTMLStream or another one.
50 *
51 * This interface is only used internally within Xalan.
52 *
53 * @xsl.usage internal
54 */
Christoph Langer75d947d2016-11-23 08:58:15 +010055interface XSLOutputAttributes {
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080056 /**
57 * Returns the previously set value of the value to be used as the public
58 * identifier in the document type declaration (DTD).
59 *
60 *@return the public identifier to be used in the DOCTYPE declaration in the
61 * output document.
62 */
63 public String getDoctypePublic();
Christoph Langer75d947d2016-11-23 08:58:15 +010064
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080065 /**
66 * Returns the previously set value of the value to be used
67 * as the system identifier in the document type declaration (DTD).
68 * @return the system identifier to be used in the DOCTYPE declaration in
69 * the output document.
70 *
71 */
72 public String getDoctypeSystem();
Christoph Langer75d947d2016-11-23 08:58:15 +010073
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080074 /**
75 * @return the character encoding to be used in the output document.
76 */
77 public String getEncoding();
Christoph Langer75d947d2016-11-23 08:58:15 +010078
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080079 /**
Christoph Langer75d947d2016-11-23 08:58:15 +010080 * @return true if the output document should be indented to visually
81 * indicate its structure.
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080082 */
83 public boolean getIndent();
84
85 /**
86 * @return the number of spaces to indent for each indentation level.
87 */
88 public int getIndentAmount();
Christoph Langer75d947d2016-11-23 08:58:15 +010089
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080090 /**
91 * @return the mediatype the media-type or MIME type associated with the
92 * output document.
93 */
94 public String getMediaType();
Christoph Langer75d947d2016-11-23 08:58:15 +010095
Kelly O'Hair13c4ad82012-03-04 11:55:34 -080096 /**
97 * @return true if the XML declaration is to be omitted from the output
98 * document.
99 */
100 public boolean getOmitXMLDeclaration();
Christoph Langer75d947d2016-11-23 08:58:15 +0100101
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800102 /**
Christoph Langer75d947d2016-11-23 08:58:15 +0100103 * @return a value of "yes" if the <code>standalone</code> delaration is to
104 * be included in the output document.
105 */
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800106 public String getStandalone();
Christoph Langer75d947d2016-11-23 08:58:15 +0100107
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800108 /**
109 * @return the version of the output format.
110 */
111 public String getVersion();
112
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800113 /**
114 * Sets the value coming from the xsl:output cdata-section-elements
115 * stylesheet property.
116 *
117 * This sets the elements whose text elements are to be output as CDATA
118 * sections.
119 * @param URI_and_localNames pairs of namespace URI and local names that
120 * identify elements whose text elements are to be output as CDATA sections.
121 * The namespace of the local element must be the given URI to match. The
122 * qName is not given because the prefix does not matter, only the namespace
123 * URI to which that prefix would map matters, so the prefix itself is not
124 * relevant in specifying which elements have their text to be output as
125 * CDATA sections.
126 */
David Li38fdd082014-06-11 22:26:30 -0700127 public void setCdataSectionElements(ArrayList<String> URI_and_localNames);
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800128
129 /** Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties
130 * @param system the system identifier to be used in the DOCTYPE declaration
131 * in the output document.
132 * @param pub the public identifier to be used in the DOCTYPE declaration in
133 * the output document.
134 */
135 public void setDoctype(String system, String pub);
136
137 /** Set the value coming from the xsl:output doctype-public stylesheet attribute.
Christoph Langer75d947d2016-11-23 08:58:15 +0100138 * @param doctype the public identifier to be used in the DOCTYPE
139 * declaration in the output document.
140 */
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800141 public void setDoctypePublic(String doctype);
Christoph Langer75d947d2016-11-23 08:58:15 +0100142
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800143 /** Set the value coming from the xsl:output doctype-system stylesheet attribute.
Christoph Langer75d947d2016-11-23 08:58:15 +0100144 * @param doctype the system identifier to be used in the DOCTYPE
145 * declaration in the output document.
146 */
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800147 public void setDoctypeSystem(String doctype);
Christoph Langer75d947d2016-11-23 08:58:15 +0100148
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800149 /**
150 * Sets the character encoding coming from the xsl:output encoding stylesheet attribute.
151 * @param encoding the character encoding
152 */
153 public void setEncoding(String encoding);
Christoph Langer75d947d2016-11-23 08:58:15 +0100154
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800155 /**
156 * Sets the value coming from the xsl:output indent stylesheet
157 * attribute.
158 * @param indent true if the output document should be indented to visually
159 * indicate its structure.
160 */
161 public void setIndent(boolean indent);
Christoph Langer75d947d2016-11-23 08:58:15 +0100162
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800163 /**
164 * Sets the value coming from the xsl:output media-type stylesheet attribute.
165 * @param mediatype the media-type or MIME type associated with the output
166 * document.
167 */
168 public void setMediaType(String mediatype);
Christoph Langer75d947d2016-11-23 08:58:15 +0100169
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800170 /**
171 * Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute
172 * @param b true if the XML declaration is to be omitted from the output
173 * document.
174 */
175 public void setOmitXMLDeclaration(boolean b);
Christoph Langer75d947d2016-11-23 08:58:15 +0100176
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800177 /**
178 * Sets the value coming from the xsl:output standalone stylesheet attribute.
179 * @param standalone a value of "yes" indicates that the
180 * <code>standalone</code> delaration is to be included in the output
181 * document.
182 */
183 public void setStandalone(String standalone);
Christoph Langer75d947d2016-11-23 08:58:15 +0100184
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800185 /**
186 * Sets the value coming from the xsl:output version attribute.
187 * @param version the version of the output format.
188 */
189 public void setVersion(String version);
190
David Li38fdd082014-06-11 22:26:30 -0700191 /**
192 * Get the value for a property that affects seraialization,
193 * if a property was set return that value, otherwise return
194 * the default value, otherwise return null.
195 * @param name The name of the property, which is just the local name
196 * if it is in no namespace, but is the URI in curly braces followed by
197 * the local name if it is in a namespace, for example:
198 * <ul>
199 * <li> "encoding"
200 * <li> "method"
201 * <li> "{http://xml.apache.org/xalan}indent-amount"
202 * <li> "{http://xml.apache.org/xalan}line-separator"
203 * </ul>
204 * @return The value of the parameter
205 */
206 public String getOutputProperty(String name);
Christoph Langer75d947d2016-11-23 08:58:15 +0100207
David Li38fdd082014-06-11 22:26:30 -0700208 /**
209 * Get the default value for a property that affects seraialization,
210 * or null if there is none. It is possible that a non-default value
211 * was set for the property, however the value returned by this method
212 * is unaffected by any non-default settings.
213 * @param name The name of the property.
214 * @return The default value of the parameter, or null if there is no default value.
215 */
216 public String getOutputPropertyDefault(String name);
Christoph Langer75d947d2016-11-23 08:58:15 +0100217
David Li38fdd082014-06-11 22:26:30 -0700218 /**
219 * Set the non-default value for a property that affects seraialization.
220 * @param name The name of the property, which is just the local name
221 * if it is in no namespace, but is the URI in curly braces followed by
222 * the local name if it is in a namespace, for example:
223 * <ul>
224 * <li> "encoding"
225 * <li> "method"
226 * <li> "{http://xml.apache.org/xalan}indent-amount"
227 * <li> "{http://xml.apache.org/xalan}line-separator"
228 * </ul>
229 * @val The non-default value of the parameter
230 */
Christoph Langer75d947d2016-11-23 08:58:15 +0100231 public void setOutputProperty(String name, String val);
David Li38fdd082014-06-11 22:26:30 -0700232
233 /**
234 * Set the default value for a property that affects seraialization.
235 * @param name The name of the property, which is just the local name
236 * if it is in no namespace, but is the URI in curly braces followed by
237 * the local name if it is in a namespace, for example:
238 * <ul>
239 * <li> "encoding"
240 * <li> "method"
241 * <li> "{http://xml.apache.org/xalan}indent-amount"
242 * <li> "{http://xml.apache.org/xalan}line-separator"
243 * </ul>
244 * @val The default value of the parameter
245 */
Christoph Langer75d947d2016-11-23 08:58:15 +0100246 public void setOutputPropertyDefault(String name, String val);
Kelly O'Hair13c4ad82012-03-04 11:55:34 -0800247}