public final class XMLUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CDATA_SECTIONS |
static String |
ELEMENT_CONTENT_WHITESPACE |
static String |
FORMAT_PRETTY_PRINT |
static String |
RESOURCE_RESOLVER |
static String |
SPLIT_CDATA_SECTIONS |
static String |
VALIDATE_IF_SCHEMA |
| Modifier and Type | Method and Description |
|---|---|
static LSInput |
createLSInput()
Creates LSInput from dom implementation.
|
static LSOutput |
createLSOutput()
Creates LSOutput form dom implementation.
|
static LSParser |
createLSParser()
Creates basic LSParser instance and sets common
properties and configuration parameters.
|
static LSSerializer |
createLSSerializer()
Creates basic LSSerializer instance and sets common
properties and configuration parameters.
|
static Node |
findNodeByName(Document doc,
String pathExpression)
Searches for a node within a DOM document with a given node path expression.
|
static String |
getNodesPathName(Node node)
Returns the path expression for a given node.
|
static Charset |
getTargetCharset(Document doc)
Try to find encoding for document node.
|
static Map<String,String> |
lookupNamespaces(Node referenceNode)
Look up namespace attribute declarations in the specified node and
store them in a binding map, where the key is the namespace prefix and the value
is the namespace uri.
|
static Map<String,String> |
lookupNamespaces(String xml)
Look up namespace attribute declarations in the XML fragment and
store them in a binding map, where the key is the namespace prefix and the value
is the namespace uri.
|
static String |
omitXmlDeclaration(String xml)
Removes leading XML declaration from xml if present.
|
static Document |
parseMessagePayload(String messagePayload)
Parse message payload with DOM implementation.
|
static String |
prettyPrint(String xml)
Pretty prints a XML string.
|
static String |
serialize(Document doc)
Serializes a DOM document
|
static void |
setParserConfigParameter(LSParser parser,
String parameterName,
Object value)
Sets a config parameter on LSParser instance if settable.
|
static void |
setSerializerConfigParameter(LSSerializer serializer,
String parameterName,
Object value)
Sets a config parameter on LSParser instance if settable.
|
static void |
stripWhitespaceNodes(Node element)
Removes text nodes that are only containing whitespace characters
inside a DOM tree.
|
public static final String SPLIT_CDATA_SECTIONS
public static final String FORMAT_PRETTY_PRINT
public static final String ELEMENT_CONTENT_WHITESPACE
public static final String CDATA_SECTIONS
public static final String VALIDATE_IF_SCHEMA
public static final String RESOURCE_RESOLVER
public static LSParser createLSParser()
public static LSSerializer createLSSerializer()
public static LSInput createLSInput()
public static LSOutput createLSOutput()
public static Node findNodeByName(Document doc, String pathExpression)
doc - DOM Document to search for a node.pathExpression - dot separated path expressionpublic static void stripWhitespaceNodes(Node element)
element - the root node to normalize.public static String getNodesPathName(Node node)
node - in DOM tree.public static String serialize(Document doc)
doc - CitrusRuntimeExceptionpublic static String prettyPrint(String xml)
xml - CitrusRuntimeExceptionpublic static Map<String,String> lookupNamespaces(Node referenceNode)
referenceNode - XML node to search for namespace declarations.public static Map<String,String> lookupNamespaces(String xml)
xml - XML fragment.public static Document parseMessagePayload(String messagePayload)
messagePayload - CitrusRuntimeExceptionpublic static Charset getTargetCharset(Document doc)
doc - public static void setSerializerConfigParameter(LSSerializer serializer, String parameterName, Object value)
serializer - parameterName - value - public static void setParserConfigParameter(LSParser parser, String parameterName, Object value)
parser - parameterName - value - Copyright © 2008–2015 ConSol* Consulting&Solutions GmbH. All rights reserved.