- java.lang.Object
-
- javax.xml.transform.OutputKeys
-
public class OutputKeys extends Object
Provides string constants that can be used to set output properties for a Transformer, or to retrieve output properties from a Transformer or Templates object.All the fields in this class are read-only.
-
-
Field Summary
Fields Modifier and Type Field and Description static StringCDATA_SECTION_ELEMENTScdata-section-elements = expanded names.static StringDOCTYPE_PUBLICdoctype-public = string.static StringDOCTYPE_SYSTEMdoctype-system = string.static StringENCODINGencoding = string.static StringINDENTindent = "yes" | "no".static StringMEDIA_TYPEmedia-type = string.static StringMETHODmethod = "xml" | "html" | "text" | expanded name.static StringOMIT_XML_DECLARATIONomit-xml-declaration = "yes" | "no".static StringSTANDALONEstandalone = "yes" | "no".static StringVERSIONversion = nmtoken.
-
-
-
Field Detail
-
METHOD
public static final String METHOD
method = "xml" | "html" | "text" | expanded name.The value of the method property identifies the overall method that should be used for outputting the result tree. Other non-namespaced values may be used, such as "xhtml", but, if accepted, the handling of such values is implementation defined. If any of the method values are not accepted and are not namespace qualified, then
Transformer.setOutputProperty(java.lang.String, java.lang.String)orTransformer.setOutputProperties(java.util.Properties)will throw aIllegalArgumentException.
-
VERSION
public static final String VERSION
version = nmtoken.versionspecifies the version of the output method.When the output method is "xml", the version value specifies the version of XML to be used for outputting the result tree. The default value for the xml output method is 1.0. When the output method is "html", the version value indicates the version of the HTML. The default value for the xml output method is 4.0, which specifies that the result should be output as HTML conforming to the HTML 4.0 Recommendation [HTML]. If the output method is "text", the version property is ignored.
-
ENCODING
public static final String ENCODING
encoding = string.encodingspecifies the preferred character encoding that the Transformer should use to encode sequences of characters as sequences of bytes. The value of the encoding property should be treated case-insensitively. The value must only contain characters in the range #x21 to #x7E (i.e., printable ASCII characters). The value should either be acharsetregistered with the Internet Assigned Numbers Authority [IANA], [RFC2278] or start withX-.
-
OMIT_XML_DECLARATION
public static final String OMIT_XML_DECLARATION
omit-xml-declaration = "yes" | "no".omit-xml-declarationspecifies whether the XSLT processor should output an XML declaration; the value must beyesorno.
-
STANDALONE
public static final String STANDALONE
standalone = "yes" | "no".standalonespecifies whether the Transformer should output a standalone document declaration; the value must beyesorno.
-
DOCTYPE_PUBLIC
public static final String DOCTYPE_PUBLIC
doctype-public = string.See the documentation for the
DOCTYPE_SYSTEMproperty for a description of what the value of the key should be.
-
DOCTYPE_SYSTEM
public static final String DOCTYPE_SYSTEM
doctype-system = string.doctype-systemspecifies the system identifier to be used in the document type declaration.If the doctype-system property is specified, the xml output method should output a document type declaration immediately before the first element. The name following <!DOCTYPE should be the name of the first element. If doctype-public property is also specified, then the xml output method should output PUBLIC followed by the public identifier and then the system identifier; otherwise, it should output SYSTEM followed by the system identifier. The internal subset should be empty. The value of the doctype-public property should be ignored unless the doctype-system property is specified.
If the doctype-public or doctype-system properties are specified, then the html output method should output a document type declaration immediately before the first element. The name following <!DOCTYPE should be HTML or html. If the doctype-public property is specified, then the output method should output PUBLIC followed by the specified public identifier; if the doctype-system property is also specified, it should also output the specified system identifier following the public identifier. If the doctype-system property is specified but the doctype-public property is not specified, then the output method should output SYSTEM followed by the specified system identifier.
doctype-systemspecifies the system identifier to be used in the document type declaration.
-
CDATA_SECTION_ELEMENTS
public static final String CDATA_SECTION_ELEMENTS
cdata-section-elements = expanded names.cdata-section-elementsspecifies a whitespace delimited list of the names of elements whose text node children should be output using CDATA sections. Note that these names must use the format described in the section Qualfied Name Representation injavax.xml.transform.
-
INDENT
public static final String INDENT
indent = "yes" | "no".indentspecifies whether the Transformer may add additional whitespace when outputting the result tree; the value must beyesorno.
-
MEDIA_TYPE
public static final String MEDIA_TYPE
media-type = string.media-typespecifies the media type (MIME content type) of the data that results from outputting the result tree. Thecharsetparameter should not be specified explicitly; instead, when the top-level media type istext, acharsetparameter should be added according to the character encoding actually used by the output method.
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/xml/transform/outputkeys.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.