com.ibm.xml.xapi
Interface XOutputParameters
All Superinterfaces:
java.util.Map<java.lang.String,java.lang.Object>
- public interface XOutputParameters
- extends java.util.Map<java.lang.String,java.lang.Object>
StreamResult
. New output
parameters objects can be created through the
XFactory.newOutputParameters
method.
These parameters correspond to the ones in the
XSLT 2.0 and XQuery 1.0 Serialization
specification.
See Also:
XFactory.newOutputParameters()
,
XItemView.exportItem(javax.xml.transform.Result, XOutputParameters)
,
XSequenceCursor.exportSequence(javax.xml.transform.Result, XOutputParameters)
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary
Modifier and Type | Field and Description |
---|---|
|
METHOD_HTML
Predefined string for the
html output method.
|
|
METHOD_TEXT
Predefined string for the
text output method.
|
|
METHOD_XHTML
Predefined string for the
xhtml output method.
|
|
METHOD_XML
Predefined string for the
xml output method.
|
|
NORMALIZATION_FORM_C
Predefined string for the normalization form
NFC setting.
|
|
NORMALIZATION_FORM_D
Predefined string for the normalization form
NFD setting.
|
|
NORMALIZATION_FORM_FULLY_NORMALIZED
Predefined string for the normalization form
fully-normalized
setting.
|
|
NORMALIZATION_FORM_KC
Predefined string for the normalization form
NFKC setting.
|
|
NORMALIZATION_FORM_KD
Predefined string for the normalization form
NFKD setting.
|
|
NORMALIZATION_FORM_NONE
Predefined string for the normalization form
none
setting.
|
|
STANDALONE_NO
Predefined string for the standalone
no setting.
|
|
STANDALONE_OMIT
Predefined string for the standalone
omit setting.
|
|
STANDALONE_YES
Predefined string for the standalone
yes setting.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
getBackwardsCompatible()
Get the backwards compatible setting.
|
|
getByteOrderMark()
Get the byte order mark setting.
|
|
getCDataSectionElements()
Get the comma separated list of CDATA section element names.
|
|
getCharacterMaps()
Get the character mappings.
|
|
getDoctypePublic()
Get the public identifier to be used in the document type
declaration.
|
|
getDoctypeSystem()
Get the system identifier to be used in the document type
declaration.
|
|
getEncoding()
Get the character encoding.
|
|
getEscapeURIAttributes()
Get the escape URI attributes setting.
|
|
getIncludeContentType()
Get the include content type setting.
|
|
getIndent()
Get the indent setting.
|
|
getIndentAmount()
Get the indent amount.
|
|
getMediaType()
Get the media type.
|
|
getMethod()
Get the output method.
|
|
getNormalizationForm()
Get the normalization form.
|
|
getOmitXMLDeclaration()
Get the omit XML declaration setting.
|
|
getStandalone()
Get the standalone setting.
|
|
getUndeclarePrefixes()
Get the undeclare prefixes setting.
|
|
getVersion()
Get the output method version.
|
|
setBackwardsCompatible(boolean setting)
Specify whether backwards compatible mode is enabled or not.
|
|
setByteOrderMark(boolean setting)
Specifiy whether a byte order mark should be written at the start
of the serialized output.
|
|
setCDataSectionElements(java.lang.String elements)
Specify a comma separated list of the names of elements whose
text node children should be serialized using CDATA sections.
|
|
setCharacterMaps(java.util.List<java.lang.String> characterMaps)
Specify character mappings.
|
|
setDoctypePublic(java.lang.String id)
Specify the public identifier to be used in the document
type declaration.
|
|
setDoctypeSystem(java.lang.String id)
Specify the system identifier to be used in the document
type declaration.
|
|
setEncoding(java.lang.String encoding)
Specify the preferred character encoding to use when encoding
sequences of characters as sequences of bytes.
|
|
setEscapeURIAttributes(boolean setting)
Specify whether to escape URI attributes.
|
|
setIncludeContentType(boolean setting)
Specify whether a
meta element is to be added as
the first child of the html element specifying the
character encoding used.
|
|
setIndent(boolean setting)
Specify whether additional whitespace may be added during
serialization.
|
|
setIndentAmount(int amount)
Set the indent amount (number of spaces to use when indenting).
|
|
setMediaType(java.lang.String mediaType)
Specify the media type (MIME content type).
|
|
setMethod(java.lang.String method)
Specify the output method to be used by the serializer.
|
|
setNormalizationForm(java.lang.String normalizationForm)
Specify whether Unicode normalization should be applied.
|
|
setOmitXMLDeclaration(boolean setting)
Specify whether to omit the XML declaration.
|
|
setStandalone(java.lang.String standalone)
Specify whether to output a standalone document declaration.
|
|
setUndeclarePrefixes(boolean setting)
Specify whether namespace undeclarations (of the
form xmlns:foo="") should be output when a child element
has no namespace node with the same name (that is,
namespace prefix) as a namespace node of its parent element.
|
|
setVersion(java.lang.String version)
Set the version for the output method.
|
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Field Detail
METHOD_XML
- static final java.lang.String METHOD_XML
See Also:
METHOD_HTML
- static final java.lang.String METHOD_HTML
Predefined string for the
html
output method.
See Also:
METHOD_XHTML
- static final java.lang.String METHOD_XHTML
Predefined string for the
xhtml
output method.
See Also:
METHOD_TEXT
- static final java.lang.String METHOD_TEXT
Predefined string for the
text
output method.
See Also:
STANDALONE_OMIT
- static final java.lang.String STANDALONE_OMIT
Predefined string for the standalone
omit
setting.
See Also:
STANDALONE_YES
- static final java.lang.String STANDALONE_YES
Predefined string for the standalone
yes
setting.
See Also:
STANDALONE_NO
- static final java.lang.String STANDALONE_NO
Predefined string for the standalone
no
setting.
See Also:
NORMALIZATION_FORM_C
- static final java.lang.String NORMALIZATION_FORM_C
Predefined string for the normalization form
NFC
setting.
NORMALIZATION_FORM_D
- static final java.lang.String NORMALIZATION_FORM_D
Predefined string for the normalization form
NFD
setting.
NORMALIZATION_FORM_KC
- static final java.lang.String NORMALIZATION_FORM_KC
Predefined string for the normalization form
NFKC
setting.
NORMALIZATION_FORM_KD
- static final java.lang.String NORMALIZATION_FORM_KD
Predefined string for the normalization form
NFKD
setting.
NORMALIZATION_FORM_FULLY_NORMALIZED
- static final java.lang.String NORMALIZATION_FORM_FULLY_NORMALIZED
Predefined string for the normalization form
fully-normalized
setting.
NORMALIZATION_FORM_NONE
- static final java.lang.String NORMALIZATION_FORM_NONE
Predefined string for the normalization form
none
setting.
Method Detail
setBackwardsCompatible
- void setBackwardsCompatible(boolean setting)
Specify whether backwards compatible mode is enabled or not.
If enabled and no ouptut method is specified, xml will be used as
a default. If disabled, the rules of XSLT 2.0 will be followed
when no output method is specified.
Parameters:
setting
- The setting, either true
to enable backwards
compatibility or false
to disable it. The default is
false
. getBackwardsCompatible
- boolean getBackwardsCompatible( )
Get the backwards compatible setting.
Returns:
The backwards compatible setting,
true
if enabled,
false
if disabled. setByteOrderMark
- void setByteOrderMark(boolean setting)
Specifiy whether a byte order mark should be written at the start
of the serialized output.
Parameters:
setting
- The setting. The default is false
. getByteOrderMark
- boolean getByteOrderMark()
Get the byte order mark setting.
Returns:
The setting.
setCDataSectionElements
- void setCDataSectionElements(java.lang.String elements)
Specify a comma separated list of the names of elements whose
text node children should be serialized using CDATA sections.
Names are specified as lexical QNames (
{<namespace>}<localname>
or
<localname>
if there is no namespace). For example:
{http://my.org}myelem
.
Parameters:
elements
- The list of element names or null
to reset. getCDataSectionElements
- java.lang.String getCDataSectionElements( )
Get the comma separated list of CDATA section element names.
Returns:
The list of CDATA section element names.
setDoctypePublic
- void setDoctypePublic(java.lang.String id)
Specify the public identifier to be used in the document
type declaration.
Parameters:
id
- The public identifier or null
to reset. getDoctypePublic
- java.lang.String getDoctypePublic( )
Get the public identifier to be used in the document type
declaration.
Returns:
The public identifier or
null
if not set. setDoctypeSystem
- void setDoctypeSystem(java.lang.String id)
Specify the system identifier to be used in the document
type declaration.
Parameters:
id
- The system identifier or null
to reset. getDoctypeSystem
- java.lang.String getDoctypeSystem( )
Get the system identifier to be used in the document type
declaration.
Returns:
The system identifier or
null
if not set. setEncoding
- void setEncoding(java.lang.String encoding)
Specify the preferred character encoding to use when encoding
sequences of characters as sequences of bytes. If no encoding
is specified then
utf-8
is assumed.
Parameters:
encoding
- The encoding to use or null
to reset.
Case will be ignored.
Must only contain characters between #x21 and #x7E (printable
ASCII characters). The value must be a charset registered
with the Internet Assigned Numbers Authority
( IANA Charset ). getEncoding
- java.lang.String getEncoding()
Get the character encoding.
Returns:
The character encoding or
null
if not set. setEscapeURIAttributes
- void setEscapeURIAttributes(boolean setting)
Specify whether to escape URI attributes. This setting
only affects the html and xhtml output methods.
Parameters:
setting
- The escape URI attributes setting, true
to enable URI escaping, false
to disable it.
The default is false
. getEscapeURIAttributes
- boolean getEscapeURIAttributes( )
Get the escape URI attributes setting.
Returns:
The escape URI attributes setting.
setIncludeContentType
- void setIncludeContentType(boolean setting)
Specify whether a
meta
element is to be added as
the first child of the html
element specifying the
character encoding used. This setting only affects the html
and xhtml output methods.
Parameters:
setting
- The setting, either true
to add
the meta
element or false
to not add it.
The default is false
. getIncludeContentType
- boolean getIncludeContentType()
Get the include content type setting.
Returns:
The include content type setting.
setIndent
- void setIndent(boolean setting)
Specify whether additional whitespace may be added during
serialization. For xml
output this whitespace will only be added
where it would be considered strippable by an XML parser.
The amount of indentation is controlled by the setIndentAmount
method. The default indentation is 2 spaces.
Parameters:
setting
- The setting, true
to enable
indentation, false
to disable it. The default
is false
for xml
output method and true
for the html
and xhtml
output methods. The indent setting
is ignored for the text
output method. See Also:
getIndent
- boolean getIndent()
Get the indent setting.
Returns:
The indent setting.
setMediaType
- void setMediaType(java.lang.String mediaType)
Specify the media type (MIME content type).
Parameters:
mediaType
- The media type or null
to reset.
The default is text/xml
for the xml
output method, text/html
for
the html
and xhtml
output methods, and
text/plain
for the text
output method. getMediaType
- java.lang.String getMediaType()
Get the media type.
Returns:
The media type or
null
if not set. setMethod
- void setMethod(java.lang.String method)
Specify the output method to be used by the serializer.
If no output method is specified then the xml
output method is assumed.
Parameters:
method
- The output method as one of xml
,
html
, xhtml
or text
or as a lexical QName
({<namespace>}<localname>
or <localname>
if there is no namespace), or null
to reset.
Predefined strings are available for the 4 basic methods:
- METHOD_XML
- METHOD_HTML
- METHOD_XHTML
- METHOD_XML
See Also:
getMethod
- java.lang.String getMethod()
Get the output method.
Returns:
The output method or
null
if not set. setNormalizationForm
- void setNormalizationForm(java.lang.String normalizationForm)
Specify whether Unicode normalization should be applied. Predefined
strings are available for the six standard settings of the
normalization-form
serialization parameter:
NORMALIZATION_FORM_C
, NORMALIZATION_FORM_D
,
NORMALIZATION_FORM_KC
, NORMALIZATION_FORM_KD
,
NORMALIZATION_FORM_FULLY_NORMALIZED
and
NORMALIZATION_FORM_NONE
Parameters:
normalizationForm
- The requested normalization form - one of the
strings NFC
, NFD
, NFKC
, NFKD
,
fully-normalized
or none
. The default is
none
. getNormalizationForm
- java.lang.String getNormalizationForm( )
Get the normalization form.
Returns:
The normalization form or the string
none
if not set. setOmitXMLDeclaration
- void setOmitXMLDeclaration(boolean setting)
Specify whether to omit the XML declaration.
Parameters:
setting
- The setting, true
to omit the
XML declaration, false
otherwise. The default is
false
. getOmitXMLDeclaration
- boolean getOmitXMLDeclaration()
Get the omit XML declaration setting.
Returns:
The omit XML declaration setting.
setStandalone
- void setStandalone(java.lang.String standalone)
Specify whether to output a standalone document declaration.
Parameters:
standalone
- Must be one of omit
to omit
the standalone declaration, yes
to include
the standalone declaration with the value yes
, or
no
to include the standalone declaration with the
value no
. The default is omit
.
Predefined strings are available for the 3 choices:
- STANDALONE_OMIT
- STANDALONE_YES
- STANDALONE_NO
Throws:
java.lang.IllegalArgumentException
- if the value of the standalone
parameter is invalid. See Also:
getStandalone
- java.lang.String getStandalone( )
Get the standalone setting.
Returns:
The standalone setting or
null
if not set. setCharacterMaps
- void setCharacterMaps(java.util.List<java.lang.String> characterMaps)
Specify character mappings.
Parameters:
characterMaps
- A List
of String
pairs
where the first String
of each pair is a single
unicode character and the second String
of each pair
is the unicode characters to which the first character will be
mapped. Pass in null
to reset. getCharacterMaps
- java.util.List<java.lang.String> getCharacterMaps( )
Get the character mappings.
Returns:
The character mappings or
null
if not set. setUndeclarePrefixes
- void setUndeclarePrefixes(boolean setting)
Specify whether namespace undeclarations (of the
form xmlns:foo="") should be output when a child element
has no namespace node with the same name (that is,
namespace prefix) as a namespace node of its parent element.
This setting is relevant only when the output method is
set to
xml
and the version is set to
"1.1" or higher.
Parameters:
setting
- The setting, true
to enable
undeclaring of prefixes, false
to disable
this feature.
The default is false
. getUndeclarePrefixes
- boolean getUndeclarePrefixes()
Get the undeclare prefixes setting.
Returns:
The undeclare prefixes setting.
setVersion
- void setVersion(java.lang.String version)
Set the version for the output method. The value of this parameter
specifies the version of the output method to use. For XML output
the default value is "1.0". For HTML output the default value is
"4.01".
Parameters:
version
- The version as a String
. getVersion
- java.lang.String getVersion()
Get the output method version.
Returns:
The output method version.
setIndentAmount
- void setIndentAmount(int amount)
Set the indent amount (number of spaces to use when indenting). This
parameter will only take effect if indentation is enabled (see the
setIndent
method).
Parameters:
amount
- The indent amount. Must be a positive integer.
The default is 2. Throws:
java.lang.IllegalArgumentException
- if the amount
is not a positive integer. See Also:
getIndentAmount
- int getIndentAmount()
Get the indent amount.
Returns:
The indent amount.
xml
output method.