Package com.tridion.util.xml
Class DOMWriter
java.lang.Object
com.tridion.util.xml.DOMWriter
This class traverses through a DOM tree in order to print a document that is parsed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final booleanDefault canonical output (false).protected static final booleanDefault namespaces support (true).protected static final booleanDefault Schema full checking support (false).protected static final booleanDefault Schema validation support (false).protected static final booleanDefault validation support (false).protected static final StringLexical handler property id (http://xml.org/sax/properties/lexical-handler).protected static final StringNamespaces feature id (http://xml.org/sax/features/namespaces).protected static final StringSchema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).protected static final StringSchema validation feature id (http://apache.org/xml/features/validation/schema).protected static final StringValidation feature id (http://xml.org/sax/features/validation). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidnormalizeAndPrint(char c) Normalizes and print the given character.protected voidNormalizes and prints the given string.voidsetCanonical(boolean canonical) Sets whether output is canonical.voidsetOutput(OutputStream stream, String encoding) Sets the output stream for printing.voidSets the output writer.protected Attr[]sortAttributes(NamedNodeMap attrs) Returns a sorted list of attributes.voidWrites the specified node, recursively.
-
Field Details
-
NAMESPACES_FEATURE_ID
Namespaces feature id (http://xml.org/sax/features/namespaces).- See Also:
-
VALIDATION_FEATURE_ID
Validation feature id (http://xml.org/sax/features/validation).- See Also:
-
SCHEMA_VALIDATION_FEATURE_ID
Schema validation feature id (http://apache.org/xml/features/validation/schema).- See Also:
-
SCHEMA_FULL_CHECKING_FEATURE_ID
Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).- See Also:
-
LEXICAL_HANDLER_PROPERTY_ID
Lexical handler property id (http://xml.org/sax/properties/lexical-handler).- See Also:
-
DEFAULT_NAMESPACES
protected static final boolean DEFAULT_NAMESPACESDefault namespaces support (true).- See Also:
-
DEFAULT_VALIDATION
protected static final boolean DEFAULT_VALIDATIONDefault validation support (false).- See Also:
-
DEFAULT_SCHEMA_VALIDATION
protected static final boolean DEFAULT_SCHEMA_VALIDATIONDefault Schema validation support (false).- See Also:
-
DEFAULT_SCHEMA_FULL_CHECKING
protected static final boolean DEFAULT_SCHEMA_FULL_CHECKINGDefault Schema full checking support (false).- See Also:
-
DEFAULT_CANONICAL
protected static final boolean DEFAULT_CANONICALDefault canonical output (false).- See Also:
-
-
Constructor Details
-
DOMWriter
public DOMWriter()Default constructor. -
DOMWriter
public DOMWriter(boolean canonical)
-
-
Method Details
-
setCanonical
public void setCanonical(boolean canonical) Sets whether output is canonical. -
setOutput
Sets the output stream for printing.- Throws:
UnsupportedEncodingException
-
setOutput
Sets the output writer. -
write
Writes the specified node, recursively. -
sortAttributes
Returns a sorted list of attributes. -
normalizeAndPrint
Normalizes and prints the given string. -
normalizeAndPrint
protected void normalizeAndPrint(char c) Normalizes and print the given character.
-