public class DomNodeParser extends Object implements XmlFieldNodeParser
Node
object.
DomNodeParser is not thread safe.
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_CLEANUP_XML
Remove invalid XML numeric entities before parsing XML document.
|
static String |
CONFIG_INDENT_XML
Deprecated.
|
Constructor and Description |
---|
DomNodeParser() |
DomNodeParser(Map<String,String> configurationParam)
Create document parser and writer.
|
Modifier and Type | Method and Description |
---|---|
String |
nodeToXml(XmlFieldNode node)
Transform an xml field node to an xml string.
|
void |
nodeToXml(XmlFieldNode node,
Writer writer) |
XmlFieldNode |
xmlToNode(InputStream xmlContent)
Transform an xml inputstream to an xml field node.
|
XmlFieldNode |
xmlToNode(String xml)
Transform an xml string to an xml field node.
|
public static final String CONFIG_CLEANUP_XML
This option have a small performance impact but should be disabled only if is content is known to perfectly valid.
@Deprecated public static String CONFIG_INDENT_XML
OutputKeys
public DomNodeParser() throws TransformerConfigurationException, TransformerFactoryConfigurationError
public DomNodeParser(Map<String,String> configurationParam) throws TransformerConfigurationException, TransformerFactoryConfigurationError
configurationParam
- configure XML output (Transformer). Allowed values are
OutputKeys
constants.TransformerConfigurationException
TransformerFactoryConfigurationError
public String nodeToXml(XmlFieldNode node) throws XmlFieldParsingException
XmlFieldNodeParser
nodeToXml
in interface XmlFieldNodeParser
node
- xml field nodeXmlFieldParsingException
- parsing exceptionpublic void nodeToXml(XmlFieldNode node, Writer writer) throws XmlFieldParsingException
nodeToXml
in interface XmlFieldNodeParser
XmlFieldParsingException
public XmlFieldNode xmlToNode(InputStream xmlContent) throws XmlFieldParsingException
XmlFieldNodeParser
xmlToNode
in interface XmlFieldNodeParser
xmlContent
- xml input streamXmlFieldParsingException
- parsing exceptionpublic XmlFieldNode xmlToNode(String xml) throws XmlFieldParsingException
XmlFieldNodeParser
xmlToNode
in interface XmlFieldNodeParser
xml
- xml stringXmlFieldParsingException
- parsing exceptionCopyright © 2011–2014. All rights reserved.