- java.lang.Object
-
- com.lowagie.text.xml.XmlDomWriter
-
public class XmlDomWriter extends Object
- Author:
- psoares
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
fCanonical
Canonical output.protected PrintWriter
fOut
Print writer.protected boolean
fXML11
Processing XML 1.1 document.
-
Constructor Summary
Constructors Constructor Description XmlDomWriter()
Default constructor.XmlDomWriter(boolean canonical)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
normalizeAndPrint(char c, boolean isAttValue)
Normalizes and print the given character.protected void
normalizeAndPrint(String s, boolean isAttValue)
Normalizes and prints the given string.void
setCanonical(boolean canonical)
Sets whether output is canonical.void
setOutput(OutputStream stream, String encoding)
Sets the output stream for printing.void
setOutput(Writer writer)
Sets the output writer.protected Attr[]
sortAttributes(NamedNodeMap attrs)
Returns a sorted list of attributes.void
write(Node node)
Writes the specified node, recursively.
-
-
-
Field Detail
-
fOut
protected PrintWriter fOut
Print writer.
-
fCanonical
protected boolean fCanonical
Canonical output.
-
fXML11
protected boolean fXML11
Processing XML 1.1 document.
-
-
Method Detail
-
setCanonical
public void setCanonical(boolean canonical)
Sets whether output is canonical.- Parameters:
canonical
- true if canonical, false otherwise
-
setOutput
public void setOutput(OutputStream stream, String encoding) throws UnsupportedEncodingException
Sets the output stream for printing.- Parameters:
stream
- the OutputStringencoding
- the encoding- Throws:
UnsupportedEncodingException
- on error of encoding
-
setOutput
public void setOutput(Writer writer)
Sets the output writer.- Parameters:
writer
- the writer to set
-
write
public void write(Node node)
Writes the specified node, recursively.- Parameters:
node
- the Node to write
-
sortAttributes
protected Attr[] sortAttributes(NamedNodeMap attrs)
Returns a sorted list of attributes.- Parameters:
attrs
- the NameNomeMap of attributes- Returns:
- a Attr array of sorted attributes
-
normalizeAndPrint
protected void normalizeAndPrint(String s, boolean isAttValue)
Normalizes and prints the given string.- Parameters:
isAttValue
- booleans
- the String to normalize and print
-
normalizeAndPrint
protected void normalizeAndPrint(char c, boolean isAttValue)
Normalizes and print the given character.- Parameters:
c
- the characterisAttValue
- boolean
-
-