|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.util.XMLUtils
org.mule.module.xml.util.XMLUtils
public class XMLUtils
General utility methods for working with XML.
Field Summary | |
---|---|
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
|
Constructor Summary | |
---|---|
XMLUtils()
|
Method Summary | |
---|---|
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 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 XMLStreamReader |
toXMLStreamReader(XMLInputFactory factory,
Object obj)
Returns an XMLStreamReader for an object of unknown type if possible. |
Methods inherited from class org.mule.util.XMLUtils |
---|
attributeName, elementToString, getTextChild, isLocalName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TRANSFORMER_FACTORY_JDK5
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
Constructor Detail |
---|
public XMLUtils()
Method Detail |
---|
public static String toXml(Document dom)
dom
- the dome object to convert
public 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 parsing
Exception
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
public static XMLStreamReader toXMLStreamReader(XMLInputFactory factory, Object obj) throws XMLStreamException
XMLStreamException
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 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 on
XPathExpressionException
- 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 on
XPathExpressionException
- 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 on
XPathExpressionException
- if the XPath expression is malformed and cannot be parsed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |