public class XMLUtils extends XMLUtils
Modifier and Type | Field and Description |
---|---|
static String |
APACHE_XML_FEATURES_VALIDATION_SCHEMA |
static String |
APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING |
static String |
JAXP_PROPERTIES_SCHEMA_LANGUAGE |
static String |
JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE |
static String |
JAXP_PROPERTIES_SCHEMA_SOURCE |
static String |
TRANSFORMER_FACTORY_JDK5 |
static String |
XPATH1_FALLBACK |
Constructor and Description |
---|
XMLUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copy(XMLStreamReader reader,
XMLStreamWriter writer)
Copies the reader to the writer.
|
static void |
copy(XMLStreamReader reader,
XMLStreamWriter writer,
boolean fragment) |
static Transformer |
getTransformer() |
static List<Node> |
select(String xpath,
Node node)
Select a set of Node objects using the Xpath expression
|
static Node |
selectOne(String xpath,
Node node)
Select a single XML node using an Xpath
|
static String |
selectValue(String xpath,
Node node)
Select a single XML String value using an Xpath
|
static org.dom4j.Document |
toDocument(Object obj,
MuleContext muleContext) |
static org.dom4j.Document |
toDocument(Object obj,
String externalSchemaLocation,
MuleContext muleContext)
Converts an object of unknown type to an org.dom4j.Document if possible.
|
static Node |
toDOMNode(Object src,
MuleEvent event) |
static Node |
toDOMNode(Object src,
MuleEvent event,
DocumentBuilderFactory factory) |
static Source |
toStreamSource(XMLInputFactory xmlInputFactory,
boolean useStaxSource,
InputStream stream) |
static Document |
toW3cDocument(Object payload)
Converts a payload to a
Document representation. |
static String |
toXml(Document dom)
Converts a DOM to an XML string.
|
static Source |
toXmlSource(XMLInputFactory xmlInputFactory,
boolean useStaxSource,
Object src)
Convert our object to a Source type efficiently.
|
static Source |
toXmlSource(XMLStreamReader src) |
static XMLStreamReader |
toXMLStreamReader(XMLInputFactory factory,
MuleEvent event,
Object obj)
Returns an XMLStreamReader for an object of unknown type if possible.
|
static XMLStreamReader |
toXMLStreamReader(XMLInputFactory factory,
Object obj)
Deprecated.
As of 3.7.0, use
toXMLStreamReader(javax.xml.stream.XMLInputFactory, org.mule.api.MuleEvent, Object) instead. |
attributeName, elementToString, getTextChild, isLocalName
public static final String TRANSFORMER_FACTORY_JDK5
public static final String XPATH1_FALLBACK
public static final String APACHE_XML_FEATURES_VALIDATION_SCHEMA
public static final String APACHE_XML_FEATURES_VALIDATION_SCHEMA_FULL_CHECKING
public static final String JAXP_PROPERTIES_SCHEMA_SOURCE
public static final String JAXP_PROPERTIES_SCHEMA_LANGUAGE
public static final String JAXP_PROPERTIES_SCHEMA_LANGUAGE_VALUE
public static String toXml(Document dom)
dom
- the dome object to convertpublic static Transformer getTransformer() throws TransformerConfigurationException
TransformerConfigurationException
- if no TransformerFactory can be located in the
runtime environment.public static org.dom4j.Document toDocument(Object obj, MuleContext muleContext) throws Exception
Exception
public static org.dom4j.Document toDocument(Object obj, String externalSchemaLocation, MuleContext muleContext) throws Exception
org.dom4j.DocumentException
- if an error occurs while parsingException
public static Document toW3cDocument(Object payload) throws Exception
Document
representation.
Reproduces the behavior from toDocument(Object, MuleContext)
which works converting to Document
.
payload
- the payload to convert.Exception
@Deprecated public static XMLStreamReader toXMLStreamReader(XMLInputFactory factory, Object obj) throws XMLStreamException
toXMLStreamReader(javax.xml.stream.XMLInputFactory, org.mule.api.MuleEvent, Object)
instead.XMLStreamException
public static XMLStreamReader toXMLStreamReader(XMLInputFactory factory, MuleEvent event, Object obj) throws XMLStreamException
XMLStreamException
public static Source toXmlSource(XMLStreamReader src) throws Exception
Exception
public static Source toXmlSource(XMLInputFactory xmlInputFactory, boolean useStaxSource, Object src) throws Exception
Exception
public static Source toStreamSource(XMLInputFactory xmlInputFactory, boolean useStaxSource, InputStream stream) throws XMLStreamException
XMLStreamException
public static Node toDOMNode(Object src, MuleEvent event) throws Exception
Exception
public static Node toDOMNode(Object src, MuleEvent event, DocumentBuilderFactory factory) throws Exception
Exception
public static void copy(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException
reader
- writer
- XMLStreamException
public static void copy(XMLStreamReader reader, XMLStreamWriter writer, boolean fragment) throws XMLStreamException
XMLStreamException
public static Node selectOne(String xpath, Node node) throws XPathExpressionException
xpath
- the XPath expression to evaluatenode
- the node (or document) to exaluate onXPathExpressionException
- if the XPath expression is malformed and cannot be parsedpublic static String selectValue(String xpath, Node node) throws XPathExpressionException
xpath
- the XPath expression to evaluatenode
- the node (or document) to evaluate onXPathExpressionException
- if the XPath expression is malformed and cannot be parsedpublic static List<Node> select(String xpath, Node node) throws XPathExpressionException
xpath
- the XPath expression to evaluatenode
- the node (or document) to evaluate onXPathExpressionException
- if the XPath expression is malformed and cannot be parsedCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.