1 /* 2 * reserved comment block 3 * DO NOT REMOVE OR ALTER! 4 */ 5 /* 6 * Licensed to the Apache Software Foundation (ASF) under one 7 * or more contributor license agreements. See the NOTICE file 8 * distributed with this work for additional information 9 * regarding copyright ownership. The ASF licenses this file 10 * to you under the Apache License, Version 2.0 (the "License"); 11 * you may not use this file except in compliance with the License. 12 * You may obtain a copy of the License at 13 * 14 * http://www.apache.org/licenses/LICENSE-2.0 15 * 16 * Unless required by applicable law or agreed to in writing, software 17 * distributed under the License is distributed on an "AS IS" BASIS, 18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 * See the License for the specific language governing permissions and 20 * limitations under the License. 21 */ 22 /* 23 * $Id: XSLOutputAttributes.java,v 1.2.4.1 2005/09/15 08:15:32 suresh_emailid Exp $ 24 */ 25 package com.sun.org.apache.xml.internal.serializer; 26 27 import java.util.ArrayList; 28 29 /** 30 * This interface has methods associated with the XSLT xsl:output attribues 31 * specified in the stylesheet that effect the format of the document output. 32 * 33 * In an XSLT stylesheet these attributes appear for example as: 34 * <pre> 35 * <xsl:output method="xml" omit-xml-declaration="no" indent="yes"/> 36 * </pre> 37 * The xsl:output attributes covered in this interface are: 38 * <pre> 39 * version 40 * encoding 41 * omit-xml-declarations 42 * standalone 43 * doctype-public 44 * doctype-system 45 * cdata-section-elements 46 * indent 47 * media-type 48 * </pre> 49 * 50 * The one attribute not covered in this interface is <code>method</code> as 51 * this value is implicitly chosen by the serializer that is created, for 52 * example ToXMLStream vs. ToHTMLStream or another one. 53 * 54 * This interface is only used internally within Xalan. 55 * 56 * @xsl.usage internal 57 */ 58 interface XSLOutputAttributes 59 { 60 /** 61 * Returns the previously set value of the value to be used as the public 62 * identifier in the document type declaration (DTD). 63 * 64 *@return the public identifier to be used in the DOCTYPE declaration in the 65 * output document. 66 */ 67 public String getDoctypePublic(); 68 /** 69 * Returns the previously set value of the value to be used 70 * as the system identifier in the document type declaration (DTD). 71 * @return the system identifier to be used in the DOCTYPE declaration in 72 * the output document. 73 * 74 */ 75 public String getDoctypeSystem(); 76 /** 77 * @return the character encoding to be used in the output document. 78 */ 79 public String getEncoding(); 80 /** 81 * @return true if the output document should be indented to visually 82 * indicate its structure. 83 */ 84 public boolean getIndent(); 85 86 /** 87 * @return the number of spaces to indent for each indentation level. 88 */ 89 public int getIndentAmount(); 90 /** 91 * @return the mediatype the media-type or MIME type associated with the 92 * output document. 93 */ 94 public String getMediaType(); 95 /** 96 * @return true if the XML declaration is to be omitted from the output 97 * document. 98 */ 99 public boolean getOmitXMLDeclaration(); 100 /** 101 * @return a value of "yes" if the <code>standalone</code> delaration is to 102 * be included in the output document. 103 */ 104 public String getStandalone(); 105 /** 106 * @return the version of the output format. 107 */ 108 public String getVersion(); 109 110 /** 111 * Sets the value coming from the xsl:output cdata-section-elements 112 * stylesheet property. 113 * 114 * This sets the elements whose text elements are to be output as CDATA 115 * sections. 116 * @param URI_and_localNames pairs of namespace URI and local names that 117 * identify elements whose text elements are to be output as CDATA sections. 118 * The namespace of the local element must be the given URI to match. The 119 * qName is not given because the prefix does not matter, only the namespace 120 * URI to which that prefix would map matters, so the prefix itself is not 121 * relevant in specifying which elements have their text to be output as 122 * CDATA sections. 123 */ 124 public void setCdataSectionElements(ArrayList<String> URI_and_localNames); 125 126 /** Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties 127 * @param system the system identifier to be used in the DOCTYPE declaration 128 * in the output document. 129 * @param pub the public identifier to be used in the DOCTYPE declaration in 130 * the output document. 131 */ 132 public void setDoctype(String system, String pub); 133 134 /** Set the value coming from the xsl:output doctype-public stylesheet attribute. 135 * @param doctype the public identifier to be used in the DOCTYPE 136 * declaration in the output document. 137 */ 138 public void setDoctypePublic(String doctype); 139 /** Set the value coming from the xsl:output doctype-system stylesheet attribute. 140 * @param doctype the system identifier to be used in the DOCTYPE 141 * declaration in the output document. 142 */ 143 public void setDoctypeSystem(String doctype); 144 /** 145 * Sets the character encoding coming from the xsl:output encoding stylesheet attribute. 146 * @param encoding the character encoding 147 */ 148 public void setEncoding(String encoding); 149 /** 150 * Sets the value coming from the xsl:output indent stylesheet 151 * attribute. 152 * @param indent true if the output document should be indented to visually 153 * indicate its structure. 154 */ 155 public void setIndent(boolean indent); 156 /** 157 * Sets the value coming from the xsl:output media-type stylesheet attribute. 158 * @param mediatype the media-type or MIME type associated with the output 159 * document. 160 */ 161 public void setMediaType(String mediatype); 162 /** 163 * Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute 164 * @param b true if the XML declaration is to be omitted from the output 165 * document. 166 */ 167 public void setOmitXMLDeclaration(boolean b); 168 /** 169 * Sets the value coming from the xsl:output standalone stylesheet attribute. 170 * @param standalone a value of "yes" indicates that the 171 * <code>standalone</code> delaration is to be included in the output 172 * document. 173 */ 174 public void setStandalone(String standalone); 175 /** 176 * Sets the value coming from the xsl:output version attribute. 177 * @param version the version of the output format. 178 */ 179 public void setVersion(String version); 180 181 /** 182 * Get the value for a property that affects seraialization, 183 * if a property was set return that value, otherwise return 184 * the default value, otherwise return null. 185 * @param name The name of the property, which is just the local name 186 * if it is in no namespace, but is the URI in curly braces followed by 187 * the local name if it is in a namespace, for example: 188 * <ul> 189 * <li> "encoding" 190 * <li> "method" 191 * <li> "{http://xml.apache.org/xalan}indent-amount" 192 * <li> "{http://xml.apache.org/xalan}line-separator" 193 * </ul> 194 * @return The value of the parameter 195 */ 196 public String getOutputProperty(String name); 197 /** 198 * Get the default value for a property that affects seraialization, 199 * or null if there is none. It is possible that a non-default value 200 * was set for the property, however the value returned by this method 201 * is unaffected by any non-default settings. 202 * @param name The name of the property. 203 * @return The default value of the parameter, or null if there is no default value. 204 */ 205 public String getOutputPropertyDefault(String name); 206 /** 207 * Set the non-default value for a property that affects seraialization. 208 * @param name The name of the property, which is just the local name 209 * if it is in no namespace, but is the URI in curly braces followed by 210 * the local name if it is in a namespace, for example: 211 * <ul> 212 * <li> "encoding" 213 * <li> "method" 214 * <li> "{http://xml.apache.org/xalan}indent-amount" 215 * <li> "{http://xml.apache.org/xalan}line-separator" 216 * </ul> 217 * @val The non-default value of the parameter 218 */ 219 public void setOutputProperty(String name, String val); 220 221 /** 222 * Set the default value for a property that affects seraialization. 223 * @param name The name of the property, which is just the local name 224 * if it is in no namespace, but is the URI in curly braces followed by 225 * the local name if it is in a namespace, for example: 226 * <ul> 227 * <li> "encoding" 228 * <li> "method" 229 * <li> "{http://xml.apache.org/xalan}indent-amount" 230 * <li> "{http://xml.apache.org/xalan}line-separator" 231 * </ul> 232 * @val The default value of the parameter 233 */ 234 public void setOutputPropertyDefault(String name, String val); 235 }