Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 1 | /* |
| 2 | * reserved comment block |
| 3 | * DO NOT REMOVE OR ALTER! |
| 4 | */ |
| 5 | /* |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 6 | * 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'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 12 | * |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 21 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 22 | package com.sun.org.apache.xml.internal.serializer; |
| 23 | |
David Li | 38fdd08 | 2014-06-11 22:26:30 -0700 | [diff] [blame] | 24 | import java.util.ArrayList; |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 25 | |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 55 | interface XSLOutputAttributes { |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 56 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 64 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 65 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 73 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 74 | /** |
| 75 | * @return the character encoding to be used in the output document. |
| 76 | */ |
| 77 | public String getEncoding(); |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 78 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 79 | /** |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 80 | * @return true if the output document should be indented to visually |
| 81 | * indicate its structure. |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 82 | */ |
| 83 | public boolean getIndent(); |
| 84 | |
| 85 | /** |
| 86 | * @return the number of spaces to indent for each indentation level. |
| 87 | */ |
| 88 | public int getIndentAmount(); |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 89 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 90 | /** |
| 91 | * @return the mediatype the media-type or MIME type associated with the |
| 92 | * output document. |
| 93 | */ |
| 94 | public String getMediaType(); |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 95 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 96 | /** |
| 97 | * @return true if the XML declaration is to be omitted from the output |
| 98 | * document. |
| 99 | */ |
| 100 | public boolean getOmitXMLDeclaration(); |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 101 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 102 | /** |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 103 | * @return a value of "yes" if the <code>standalone</code> delaration is to |
| 104 | * be included in the output document. |
| 105 | */ |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 106 | public String getStandalone(); |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 107 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 108 | /** |
| 109 | * @return the version of the output format. |
| 110 | */ |
| 111 | public String getVersion(); |
| 112 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 113 | /** |
| 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 Li | 38fdd08 | 2014-06-11 22:26:30 -0700 | [diff] [blame] | 127 | public void setCdataSectionElements(ArrayList<String> URI_and_localNames); |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 128 | |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 138 | * @param doctype the public identifier to be used in the DOCTYPE |
| 139 | * declaration in the output document. |
| 140 | */ |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 141 | public void setDoctypePublic(String doctype); |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 142 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 143 | /** Set the value coming from the xsl:output doctype-system stylesheet attribute. |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 144 | * @param doctype the system identifier to be used in the DOCTYPE |
| 145 | * declaration in the output document. |
| 146 | */ |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 147 | public void setDoctypeSystem(String doctype); |
Christoph Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 148 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 149 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 154 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 155 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 162 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 163 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 169 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 170 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 176 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 177 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 184 | |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 185 | /** |
| 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 Li | 38fdd08 | 2014-06-11 22:26:30 -0700 | [diff] [blame] | 191 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 207 | |
David Li | 38fdd08 | 2014-06-11 22:26:30 -0700 | [diff] [blame] | 208 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 217 | |
David Li | 38fdd08 | 2014-06-11 22:26:30 -0700 | [diff] [blame] | 218 | /** |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 231 | public void setOutputProperty(String name, String val); |
David Li | 38fdd08 | 2014-06-11 22:26:30 -0700 | [diff] [blame] | 232 | |
| 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 Langer | 75d947d | 2016-11-23 08:58:15 +0100 | [diff] [blame] | 246 | public void setOutputPropertyDefault(String name, String val); |
Kelly O'Hair | 13c4ad8 | 2012-03-04 11:55:34 -0800 | [diff] [blame] | 247 | } |