001: /*
002: * Copyright 2003-2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: /*
017: * $Id: XSLOutputAttributes.java,v 1.3 2004/08/31 05:10:51 minchau Exp $
018: */
019: package org.apache.xml.serializer;
020:
021: import java.util.Vector;
022:
023: /**
024: * This interface has methods associated with the XSLT xsl:output attribues
025: * specified in the stylesheet that effect the format of the document output.
026: *
027: * In an XSLT stylesheet these attributes appear for example as:
028: * <pre>
029: * <xsl:output method="xml" omit-xml-declaration="no" indent="yes"/>
030: * </pre>
031: * The xsl:output attributes covered in this interface are:
032: * <pre>
033: * version
034: * encoding
035: * omit-xml-declarations
036: * standalone
037: * doctype-public
038: * doctype-system
039: * cdata-section-elements
040: * indent
041: * media-type
042: * </pre>
043: *
044: * The one attribute not covered in this interface is <code>method</code> as
045: * this value is implicitly chosen by the serializer that is created, for
046: * example ToXMLStream vs. ToHTMLStream or another one.
047: *
048: * This interface is only used internally within Xalan.
049: *
050: * @xsl.usage internal
051: */
052: interface XSLOutputAttributes {
053: /**
054: * Returns the previously set value of the value to be used as the public
055: * identifier in the document type declaration (DTD).
056: *
057: *@return the public identifier to be used in the DOCTYPE declaration in the
058: * output document.
059: */
060: public String getDoctypePublic();
061:
062: /**
063: * Returns the previously set value of the value to be used
064: * as the system identifier in the document type declaration (DTD).
065: * @return the system identifier to be used in the DOCTYPE declaration in
066: * the output document.
067: *
068: */
069: public String getDoctypeSystem();
070:
071: /**
072: * @return the character encoding to be used in the output document.
073: */
074: public String getEncoding();
075:
076: /**
077: * @return true if the output document should be indented to visually
078: * indicate its structure.
079: */
080: public boolean getIndent();
081:
082: /**
083: * @return the number of spaces to indent for each indentation level.
084: */
085: public int getIndentAmount();
086:
087: /**
088: * @return the mediatype the media-type or MIME type associated with the
089: * output document.
090: */
091: public String getMediaType();
092:
093: /**
094: * @return true if the XML declaration is to be omitted from the output
095: * document.
096: */
097: public boolean getOmitXMLDeclaration();
098:
099: /**
100: * @return a value of "yes" if the <code>standalone</code> delaration is to
101: * be included in the output document.
102: */
103: public String getStandalone();
104:
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(Vector 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:
140: /** Set the value coming from the xsl:output doctype-system stylesheet attribute.
141: * @param doctype the system identifier to be used in the DOCTYPE
142: * declaration in the output document.
143: */
144: public void setDoctypeSystem(String doctype);
145:
146: /**
147: * Sets the character encoding coming from the xsl:output encoding stylesheet attribute.
148: * @param encoding the character encoding
149: */
150: public void setEncoding(String encoding);
151:
152: /**
153: * Sets the value coming from the xsl:output indent stylesheet
154: * attribute.
155: * @param indent true if the output document should be indented to visually
156: * indicate its structure.
157: */
158: public void setIndent(boolean indent);
159:
160: /**
161: * Sets the value coming from the xsl:output media-type stylesheet attribute.
162: * @param mediatype the media-type or MIME type associated with the output
163: * document.
164: */
165: public void setMediaType(String mediatype);
166:
167: /**
168: * Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute
169: * @param b true if the XML declaration is to be omitted from the output
170: * document.
171: */
172: public void setOmitXMLDeclaration(boolean b);
173:
174: /**
175: * Sets the value coming from the xsl:output standalone stylesheet attribute.
176: * @param standalone a value of "yes" indicates that the
177: * <code>standalone</code> delaration is to be included in the output
178: * document.
179: */
180: public void setStandalone(String standalone);
181:
182: /**
183: * Sets the value coming from the xsl:output version attribute.
184: * @param version the version of the output format.
185: */
186: public void setVersion(String version);
187:
188: }
|