com.ibm.xml.xapi

Interface XOutputParameters

All Superinterfaces:
java.util.Map<java.lang.String,java.lang.Object>

  1. public interface XOutputParameters
  2. extends java.util.Map<java.lang.String,java.lang.Object>
Interface for output parameter settings. Used when exporting sequences and items to a 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
  1. static
  2. java.lang.String
METHOD_HTML
Predefined string for the html output method.
  1. static
  2. java.lang.String
METHOD_TEXT
Predefined string for the text output method.
  1. static
  2. java.lang.String
METHOD_XHTML
Predefined string for the xhtml output method.
  1. static
  2. java.lang.String
METHOD_XML
Predefined string for the xml output method.
  1. static
  2. java.lang.String
NORMALIZATION_FORM_C
Predefined string for the normalization form NFC setting.
  1. static
  2. java.lang.String
NORMALIZATION_FORM_D
Predefined string for the normalization form NFD setting.
  1. static
  2. java.lang.String
NORMALIZATION_FORM_FULLY_NORMALIZED
Predefined string for the normalization form fully-normalized setting.
  1. static
  2. java.lang.String
NORMALIZATION_FORM_KC
Predefined string for the normalization form NFKC setting.
  1. static
  2. java.lang.String
NORMALIZATION_FORM_KD
Predefined string for the normalization form NFKD setting.
  1. static
  2. java.lang.String
NORMALIZATION_FORM_NONE
Predefined string for the normalization form none setting.
  1. static
  2. java.lang.String
STANDALONE_NO
Predefined string for the standalone no setting.
  1. static
  2. java.lang.String
STANDALONE_OMIT
Predefined string for the standalone omit setting.
  1. static
  2. java.lang.String
STANDALONE_YES
Predefined string for the standalone yes setting.

Method Summary

Modifier and Type Method and Description
  1. boolean
getBackwardsCompatible()
Get the backwards compatible setting.
  1. boolean
getByteOrderMark()
Get the byte order mark setting.
  1. java.lang.String
getCDataSectionElements()
Get the comma separated list of CDATA section element names.
  1. java.util.List<java.lang.String>
getCharacterMaps()
Get the character mappings.
  1. java.lang.String
getDoctypePublic()
Get the public identifier to be used in the document type declaration.
  1. java.lang.String
getDoctypeSystem()
Get the system identifier to be used in the document type declaration.
  1. java.lang.String
getEncoding()
Get the character encoding.
  1. boolean
getEscapeURIAttributes()
Get the escape URI attributes setting.
  1. boolean
getIncludeContentType()
Get the include content type setting.
  1. boolean
getIndent()
Get the indent setting.
  1. int
getIndentAmount()
Get the indent amount.
  1. java.lang.String
getMediaType()
Get the media type.
  1. java.lang.String
getMethod()
Get the output method.
  1. java.lang.String
getNormalizationForm()
Get the normalization form.
  1. boolean
getOmitXMLDeclaration()
Get the omit XML declaration setting.
  1. java.lang.String
getStandalone()
Get the standalone setting.
  1. boolean
getUndeclarePrefixes()
Get the undeclare prefixes setting.
  1. java.lang.String
getVersion()
Get the output method version.
  1. void
setBackwardsCompatible(boolean setting)
Specify whether backwards compatible mode is enabled or not.
  1. void
setByteOrderMark(boolean setting)
Specifiy whether a byte order mark should be written at the start of the serialized output.
  1. 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.
  1. void
setCharacterMaps(java.util.List<java.lang.String> characterMaps)
Specify character mappings.
  1. void
setDoctypePublic(java.lang.String id)
Specify the public identifier to be used in the document type declaration.
  1. void
setDoctypeSystem(java.lang.String id)
Specify the system identifier to be used in the document type declaration.
  1. void
setEncoding(java.lang.String encoding)
Specify the preferred character encoding to use when encoding sequences of characters as sequences of bytes.
  1. void
setEscapeURIAttributes(boolean setting)
Specify whether to escape URI attributes.
  1. 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.
  1. void
setIndent(boolean setting)
Specify whether additional whitespace may be added during serialization.
  1. void
setIndentAmount(int amount)
Set the indent amount (number of spaces to use when indenting).
  1. void
setMediaType(java.lang.String mediaType)
Specify the media type (MIME content type).
  1. void
setMethod(java.lang.String method)
Specify the output method to be used by the serializer.
  1. void
setNormalizationForm(java.lang.String normalizationForm)
Specify whether Unicode normalization should be applied.
  1. void
setOmitXMLDeclaration(boolean setting)
Specify whether to omit the XML declaration.
  1. void
setStandalone(java.lang.String standalone)
Specify whether to output a standalone document declaration.
  1. 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.
  1. void
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

  1. static final java.lang.String METHOD_XML
Predefined string for the xml output method.
See Also:

METHOD_HTML

  1. static final java.lang.String METHOD_HTML
Predefined string for the html output method.
See Also:

METHOD_XHTML

  1. static final java.lang.String METHOD_XHTML
Predefined string for the xhtml output method.
See Also:

METHOD_TEXT

  1. static final java.lang.String METHOD_TEXT
Predefined string for the text output method.
See Also:

STANDALONE_OMIT

  1. static final java.lang.String STANDALONE_OMIT
Predefined string for the standalone omit setting.
See Also:

STANDALONE_YES

  1. static final java.lang.String STANDALONE_YES
Predefined string for the standalone yes setting.
See Also:

STANDALONE_NO

  1. static final java.lang.String STANDALONE_NO
Predefined string for the standalone no setting.
See Also:

NORMALIZATION_FORM_C

  1. static final java.lang.String NORMALIZATION_FORM_C
Predefined string for the normalization form NFC setting.
See Also:

NORMALIZATION_FORM_D

  1. static final java.lang.String NORMALIZATION_FORM_D
Predefined string for the normalization form NFD setting.
See Also:

NORMALIZATION_FORM_KC

  1. static final java.lang.String NORMALIZATION_FORM_KC
Predefined string for the normalization form NFKC setting.
See Also:

NORMALIZATION_FORM_KD

  1. static final java.lang.String NORMALIZATION_FORM_KD
Predefined string for the normalization form NFKD setting.
See Also:

NORMALIZATION_FORM_FULLY_NORMALIZED

  1. static final java.lang.String NORMALIZATION_FORM_FULLY_NORMALIZED
Predefined string for the normalization form fully-normalized setting.
See Also:

NORMALIZATION_FORM_NONE

  1. static final java.lang.String NORMALIZATION_FORM_NONE
Predefined string for the normalization form none setting.
See Also:

Method Detail

setBackwardsCompatible

  1. 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

  1. boolean getBackwardsCompatible( )
Get the backwards compatible setting.
Returns:
The backwards compatible setting, true if enabled, false if disabled.

setByteOrderMark

  1. 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

  1. boolean getByteOrderMark()
Get the byte order mark setting.
Returns:
The setting.

setCDataSectionElements

  1. 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

  1. java.lang.String getCDataSectionElements( )
Get the comma separated list of CDATA section element names.
Returns:
The list of CDATA section element names.

setDoctypePublic

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. java.lang.String getEncoding()
Get the character encoding.
Returns:
The character encoding or null if not set.

setEscapeURIAttributes

  1. 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

  1. boolean getEscapeURIAttributes( )
Get the escape URI attributes setting.
Returns:
The escape URI attributes setting.

setIncludeContentType

  1. 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

  1. boolean getIncludeContentType()
Get the include content type setting.
Returns:
The include content type setting.

setIndent

  1. 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

  1. boolean getIndent()
Get the indent setting.
Returns:
The indent setting.

setMediaType

  1. 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

  1. java.lang.String getMediaType()
Get the media type.
Returns:
The media type or null if not set.

setMethod

  1. 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

  1. java.lang.String getMethod()
Get the output method.
Returns:
The output method or null if not set.

setNormalizationForm

  1. 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

  1. java.lang.String getNormalizationForm( )
Get the normalization form.
Returns:
The normalization form or the string none if not set.

setOmitXMLDeclaration

  1. 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

  1. boolean getOmitXMLDeclaration()
Get the omit XML declaration setting.
Returns:
The omit XML declaration setting.

setStandalone

  1. 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

  1. java.lang.String getStandalone( )
Get the standalone setting.
Returns:
The standalone setting or null if not set.

setCharacterMaps

  1. 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

  1. java.util.List<java.lang.String> getCharacterMaps( )
Get the character mappings.
Returns:
The character mappings or null if not set.

setUndeclarePrefixes

  1. 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

  1. boolean getUndeclarePrefixes()
Get the undeclare prefixes setting.
Returns:
The undeclare prefixes setting.

setVersion

  1. 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

  1. java.lang.String getVersion()
Get the output method version.
Returns:
The output method version.

setIndentAmount

  1. 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

  1. int getIndentAmount()
Get the indent amount.
Returns:
The indent amount.