Stay organized with collections
Save and categorize content based on your preferences.
OutputKeys
open class OutputKeys
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.
Summary
Constants |
static String |
cdata-section-elements = expanded names.
|
static String |
doctype-public = string.
|
static String |
doctype-system = string.
|
static String |
encoding = string.
|
static String |
indent = "yes" | "no".
|
static String |
media-type = string.
|
static String |
method = "xml" | "html" | "text" | expanded name.
|
static String |
omit-xml-declaration = "yes" | "no".
|
static String |
standalone = "yes" | "no".
|
static String |
version = nmtoken.
|
Constants
CDATA_SECTION_ELEMENTS
static val CDATA_SECTION_ELEMENTS: String
cdata-section-elements = expanded names.
cdata-section-elements
specifies 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 in javax.xml.transform
.
Value: "cdata-section-elements"
DOCTYPE_PUBLIC
static val DOCTYPE_PUBLIC: String
doctype-public = string.
See the documentation for the DOCTYPE_SYSTEM
property for a description of what the value of the key should be.
Value: "doctype-public"
DOCTYPE_SYSTEM
static val DOCTYPE_SYSTEM: String
doctype-system = string.
doctype-system
specifies 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-system
specifies the system identifier to be used in the document type declaration.
Value: "doctype-system"
ENCODING
static val ENCODING: String
encoding = string.
encoding
specifies 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 a charset
registered with the Internet Assigned Numbers Authority [IANA], [RFC2278] or start with X-
.
Value: "encoding"
INDENT
static val INDENT: String
indent = "yes" | "no".
indent
specifies whether the Transformer may add additional whitespace when outputting the result tree; the value must be yes
or no
.
Value: "indent"
static val MEDIA_TYPE: String
media-type = string.
media-type
specifies the media type (MIME content type) of the data that results from outputting the result tree. The charset
parameter should not be specified explicitly; instead, when the top-level media type is text
, a charset
parameter should be added according to the character encoding actually used by the output method.
Value: "media-type"
OMIT_XML_DECLARATION
static val OMIT_XML_DECLARATION: String
omit-xml-declaration = "yes" | "no".
omit-xml-declaration
specifies whether the XSLT processor should output an XML declaration; the value must be yes
or no
.
Value: "omit-xml-declaration"
STANDALONE
static val STANDALONE: String
standalone = "yes" | "no".
standalone
specifies whether the Transformer should output a standalone document declaration; the value must be yes
or no
.
Value: "standalone"
VERSION
static val VERSION: String
version = nmtoken.
version
specifies 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.
Value: "version"
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# OutputKeys\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOutputKeys\n==========\n\n```\nopen class OutputKeys\n```\n\n|---|-------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [javax.xml.transform.OutputKeys](#) |\n\nProvides string constants that can be used to set output properties for a Transformer, or to retrieve output properties from a Transformer or Templates object.\n\nAll the fields in this class are read-only.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CDATA_SECTION_ELEMENTS](#CDATA_SECTION_ELEMENTS:kotlin.String) cdata-section-elements = expanded names. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DOCTYPE_PUBLIC](#DOCTYPE_PUBLIC:kotlin.String) doctype-public = string. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DOCTYPE_SYSTEM](#DOCTYPE_SYSTEM:kotlin.String) doctype-system = string. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ENCODING](#ENCODING:kotlin.String) encoding = string. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [INDENT](#INDENT:kotlin.String) indent = \"yes\" \\| \"no\". |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MEDIA_TYPE](#MEDIA_TYPE:kotlin.String) media-type = string. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [METHOD](#METHOD:kotlin.String) method = \"xml\" \\| \"html\" \\| \"text\" \\| expanded name. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [OMIT_XML_DECLARATION](#OMIT_XML_DECLARATION:kotlin.String) omit-xml-declaration = \"yes\" \\| \"no\". |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [STANDALONE](#STANDALONE:kotlin.String) standalone = \"yes\" \\| \"no\". |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [VERSION](#VERSION:kotlin.String) version = nmtoken. |\n\nConstants\n---------\n\n### CDATA_SECTION_ELEMENTS\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CDATA_SECTION_ELEMENTS: String\n```\n\ncdata-section-elements = expanded names.\n\n`cdata-section-elements` specifies 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 in [javax.xml.transform](/reference/kotlin/javax/xml/transform/package-summary). \n\n Value: \"cdata-section-elements\"\n\n**See Also**\n\n### DOCTYPE_PUBLIC\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val DOCTYPE_PUBLIC: String\n```\n\ndoctype-public = string.\n\nSee the documentation for the [DOCTYPE_SYSTEM](#DOCTYPE_SYSTEM:kotlin.String) property for a description of what the value of the key should be. \n\n Value: \"doctype-public\"\n\n**See Also**\n\n### DOCTYPE_SYSTEM\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val DOCTYPE_SYSTEM: String\n```\n\ndoctype-system = string.\n\n`doctype-system` specifies the system identifier to be used in the document type declaration.\n\nIf the doctype-system property is specified, the xml output method should output a document type declaration immediately before the first element. The name following \\\u003c!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.\n\nIf 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 \\\u003c!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.\n\n`doctype-system` specifies the system identifier to be used in the document type declaration. \n\n Value: \"doctype-system\"\n\n**See Also**\n\n### ENCODING\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ENCODING: String\n```\n\nencoding = string.\n\n`encoding` specifies 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 a `charset` registered with the Internet Assigned Numbers Authority [\\[IANA\\]](#IANA), [\\[RFC2278\\]](#RFC2278) or start with `X-`. \n\n Value: \"encoding\"\n\n**See Also**\n\n### INDENT\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val INDENT: String\n```\n\nindent = \"yes\" \\| \"no\".\n\n`indent` specifies whether the Transformer may add additional whitespace when outputting the result tree; the value must be `yes` or `no`. \n\n Value: \"indent\"\n\n**See Also**\n\n### MEDIA_TYPE\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MEDIA_TYPE: String\n```\n\nmedia-type = string.\n\n`media-type` specifies the media type (MIME content type) of the data that results from outputting the result tree. The `charset` parameter should not be specified explicitly; instead, when the top-level media type is `text`, a `charset` parameter should be added according to the character encoding actually used by the output method. \n\n Value: \"media-type\"\n\n**See Also**\n\n### METHOD\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val METHOD: String\n```\n\nmethod = \"xml\" \\| \"html\" \\| \"text\" \\| expanded name.\n\nThe 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 [javax.xml.transform.Transformer#setOutputProperty](/reference/kotlin/javax/xml/transform/Transformer#setOutputProperty(kotlin.String,%20kotlin.String)) or [javax.xml.transform.Transformer#setOutputProperties](/reference/kotlin/javax/xml/transform/Transformer#setOutputProperties(java.util.Properties)) will throw a [java.lang.IllegalArgumentException](../../../java/lang/IllegalArgumentException.html#). \n\n Value: \"method\"\n\n**See Also**\n\n### OMIT_XML_DECLARATION\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val OMIT_XML_DECLARATION: String\n```\n\nomit-xml-declaration = \"yes\" \\| \"no\".\n\n`omit-xml-declaration` specifies whether the XSLT processor should output an XML declaration; the value must be `yes` or `no`. \n\n Value: \"omit-xml-declaration\"\n\n**See Also**\n\n### STANDALONE\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val STANDALONE: String\n```\n\nstandalone = \"yes\" \\| \"no\".\n\n`standalone` specifies whether the Transformer should output a standalone document declaration; the value must be `yes` or `no`. \n\n Value: \"standalone\"\n\n**See Also**\n\n### VERSION\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val VERSION: String\n```\n\nversion = nmtoken.\n\n`version` specifies the version of the output method.\n\nWhen 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. \n\n Value: \"version\"\n\n**See Also**"]]