API

com.ibm.xml.xapi
Interface XOutputParameters

All Superinterfaces:
Map<String,Object>

public interface XOutputParameters
extends Map<String,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
Map.Entry<K,V>
 
Field Summary
static String METHOD_HTML
          Predefined string for the html output method.
static String METHOD_TEXT
          Predefined string for the text output method.
static String METHOD_XHTML
          Predefined string for the xhtml output method.
static String METHOD_XML
          Predefined string for the xml output method.
static String NORMALIZATION_FORM_C
          Predefined string for the normalization form NFC setting.
static String NORMALIZATION_FORM_D
          Predefined string for the normalization form NFD setting.
static String NORMALIZATION_FORM_FULLY_NORMALIZED
          Predefined string for the normalization form fully-normalized setting.
static String NORMALIZATION_FORM_KC
          Predefined string for the normalization form NFKC setting.
static String NORMALIZATION_FORM_KD
          Predefined string for the normalization form NFKD setting.
static String NORMALIZATION_FORM_NONE
          Predefined string for the normalization form none setting.
static String STANDALONE_NO
          Predefined string for the standalone no setting.
static String STANDALONE_OMIT
          Predefined string for the standalone omit setting.
static String STANDALONE_YES
          Predefined string for the standalone yes setting.
 
Method Summary
 boolean getBackwardsCompatible()
          Get the backwards compatible setting.
 boolean getByteOrderMark()
          Get the byte order mark setting.
 String getCDataSectionElements()
          Get the comma separated list of CDATA section element names.
 List<String> getCharacterMaps()
          Get the character mappings.
 String getDoctypePublic()
          Get the public identifier to be used in the document type declaration.
 String getDoctypeSystem()
          Get the system identifier to be used in the document type declaration.
 String getEncoding()
          Get the character encoding.
 boolean getEscapeURIAttributes()
          Get the escape URI attributes setting.
 boolean getIncludeContentType()
          Get the include content type setting.
 boolean getIndent()
          Get the indent setting.
 int getIndentAmount()
          Get the indent amount.
 String getMediaType()
          Get the media type.
 String getMethod()
          Get the output method.
 String getNormalizationForm()
          Get the normalization form.
 boolean getOmitXMLDeclaration()
          Get the omit XML declaration setting.
 String getStandalone()
          Get the standalone setting.
 boolean getUndeclarePrefixes()
          Get the undeclare prefixes setting.
 String getVersion()
          Get the output method version.
 void setBackwardsCompatible(boolean setting)
          Specify whether backwards compatible mode is enabled or not.
 void setByteOrderMark(boolean setting)
          Specifiy whether a byte order mark should be written at the start of the serialized output.
 void setCDataSectionElements(String elements)
          Specify a comma separated list of the names of elements whose text node children should be serialized using CDATA sections.
 void setCharacterMaps(List<String> characterMaps)
          Specify character mappings.
 void setDoctypePublic(String id)
          Specify the public identifier to be used in the document type declaration.
 void setDoctypeSystem(String id)
          Specify the system identifier to be used in the document type declaration.
 void setEncoding(String encoding)
          Specify the preferred character encoding to use when encoding sequences of characters as sequences of bytes.
 void setEscapeURIAttributes(boolean setting)
          Specify whether to escape URI attributes.
 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.
 void setIndent(boolean setting)
           Specify whether additional whitespace may be added during serialization.
 void setIndentAmount(int amount)
          Set the indent amount (number of spaces to use when indenting).
 void setMediaType(String mediaType)
          Specify the media type (MIME content type).
 void setMethod(String method)
          Specify the output method to be used by the serializer.
 void setNormalizationForm(String normalizationForm)
          Specify whether Unicode normalization should be applied.
 void setOmitXMLDeclaration(boolean setting)
          Specify whether to omit the XML declaration.
 void setStandalone(String standalone)
          Specify whether to output a standalone document declaration.
 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.
 void setVersion(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 String METHOD_XML
Predefined string for the xml output method.

See Also:
setMethod(String), Constant Field Values

METHOD_HTML

static final String METHOD_HTML
Predefined string for the html output method.

See Also:
setMethod(String), Constant Field Values

METHOD_XHTML

static final String METHOD_XHTML
Predefined string for the xhtml output method.

See Also:
setMethod(String), Constant Field Values

METHOD_TEXT

static final String METHOD_TEXT
Predefined string for the text output method.

See Also:
setMethod(String), Constant Field Values

STANDALONE_OMIT

static final String STANDALONE_OMIT
Predefined string for the standalone omit setting.

See Also:
setStandalone(String), Constant Field Values

STANDALONE_YES

static final String STANDALONE_YES
Predefined string for the standalone yes setting.

See Also:
setStandalone(String), Constant Field Values

STANDALONE_NO

static final String STANDALONE_NO
Predefined string for the standalone no setting.

See Also:
setStandalone(String), Constant Field Values

NORMALIZATION_FORM_C

static final String NORMALIZATION_FORM_C
Predefined string for the normalization form NFC setting.

See Also:
setNormalizationForm(String), Constant Field Values

NORMALIZATION_FORM_D

static final String NORMALIZATION_FORM_D
Predefined string for the normalization form NFD setting.

See Also:
setNormalizationForm(String), Constant Field Values

NORMALIZATION_FORM_KC

static final String NORMALIZATION_FORM_KC
Predefined string for the normalization form NFKC setting.

See Also:
setNormalizationForm(String), Constant Field Values

NORMALIZATION_FORM_KD

static final String NORMALIZATION_FORM_KD
Predefined string for the normalization form NFKD setting.

See Also:
setNormalizationForm(String), Constant Field Values

NORMALIZATION_FORM_FULLY_NORMALIZED

static final String NORMALIZATION_FORM_FULLY_NORMALIZED
Predefined string for the normalization form fully-normalized setting.

See Also:
setNormalizationForm(String), Constant Field Values

NORMALIZATION_FORM_NONE

static final String NORMALIZATION_FORM_NONE
Predefined string for the normalization form none setting.

See Also:
setNormalizationForm(String), Constant Field Values
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(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

String getCDataSectionElements()
Get the comma separated list of CDATA section element names.

Returns:
The list of CDATA section element names.

setDoctypePublic

void setDoctypePublic(String id)
Specify the public identifier to be used in the document type declaration.

Parameters:
id - The public identifier or null to reset.

getDoctypePublic

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(String id)
Specify the system identifier to be used in the document type declaration.

Parameters:
id - The system identifier or null to reset.

getDoctypeSystem

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(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

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:
setIndentAmount(int)

getIndent

boolean getIndent()
Get the indent setting.

Returns:
The indent setting.

setMediaType

void setMediaType(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

String getMediaType()
Get the media type.

Returns:
The media type or null if not set.

setMethod

void setMethod(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:
METHOD_XML, METHOD_HTML, METHOD_XHTML, METHOD_TEXT

getMethod

String getMethod()
Get the output method.

Returns:
The output method or null if not set.

setNormalizationForm

void setNormalizationForm(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

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(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:
IllegalArgumentException - if the value of the standalone parameter is invalid.
See Also:
STANDALONE_OMIT, STANDALONE_YES, STANDALONE_NO

getStandalone

String getStandalone()
Get the standalone setting.

Returns:
The standalone setting or null if not set.

setCharacterMaps

void setCharacterMaps(List<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

List<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(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

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:
IllegalArgumentException - if the amount is not a positive integer.
See Also:
setIndent(boolean)

getIndentAmount

int getIndentAmount()
Get the indent amount.

Returns:
The indent amount.

IBM Copyright 2004-2008