public final class XmlUtils extends Object
Constructor and Description |
---|
XmlUtils() |
Modifier and Type | Method and Description |
---|---|
static Element |
addChildElement(Element element,
String name,
String text) |
static Document |
addResultSetXmlPart(Element resultsElement,
ResultSet rs,
Document xmlDocumentResult,
boolean uppercase) |
static String |
createAbsoluteXPath(Node node) |
static org.apache.xmlbeans.XmlOptions |
createDefaultXmlOptions()
XmlOptions configuration used in preventing XML Bomb
|
static Document |
createDocument(QName element) |
static String |
createJdbcXmlResult(Statement statement) |
static String |
createJdbcXmlResultEx(Statement statement,
boolean makeUpperCased) |
static Node |
createNodeFromPath(Element modelElement,
String path) |
static QName |
createQName(Node node) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(File input) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(File input,
org.apache.xmlbeans.XmlOptions xmlOptions) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(InputStream input) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(InputStream input,
org.apache.xmlbeans.XmlOptions xmlOptions) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(Node input) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(Node input,
org.apache.xmlbeans.XmlOptions xmlOptions) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(String input) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(String input,
org.apache.xmlbeans.XmlOptions xmlOptions) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(URL input) |
static org.apache.xmlbeans.XmlObject |
createXmlObject(URL input,
org.apache.xmlbeans.XmlOptions xmlOptions) |
static String |
createXPath(Node node) |
static String |
createXPath(Node domNode,
boolean normalize) |
static String |
createXPath(Node node,
boolean anonymous,
boolean selectText,
boolean absolute,
XPathModifier modifier) |
static String |
createXPath(Node node,
boolean anonymous,
boolean selectText,
boolean absolute,
XPathModifier modifier,
boolean normalize) |
static String |
createXPath(Node node,
boolean anonymous,
boolean selectText,
XPathModifier modifier) |
static XPathData |
createXPathData(Node node,
boolean anonymous,
boolean selectText,
boolean absolute) |
static XPathData |
createXPathData(Node node,
boolean anonymous,
boolean selectText,
boolean absolute,
boolean normalize) |
static String |
declareXPathNamespaces(String xmlString) |
static String |
declareXPathNamespaces(WsdlInterface iface) |
static String |
declareXPathNamespaces(org.apache.xmlbeans.XmlObject xmlObject) |
static String |
entitize(String xml) |
static String |
entitizeContent(String xml) |
static String |
extractNamespaces(String xpath) |
static String |
findPrefixForNamespace(Element elm,
String namespace) |
static QName |
findTypeNameForXsiType(String typeName,
Element elm) |
static NodeList |
getChildElements(Element elm) |
static NodeList |
getChildElementsByTagName(Element elm,
String name) |
static NodeList |
getChildElementsByTagNameNS(Element elm,
String namespaceUri,
String localName) |
static NodeList |
getChildElementsNS(Element elm,
QName name) |
static NodeList |
getChildElementsOfType(Element elm,
org.apache.xmlbeans.SchemaType schemaType) |
static String |
getChildElementText(Element elm,
String name) |
static String |
getChildElementText(Element elm,
String name,
String defaultValue) |
static int |
getElementIndex(Node element)
Gets the index of the specified element amongst elements with the same
name
|
static String |
getElementPath(Element element)
Returns absolute xpath for specified element, ignores namespaces
|
static String |
getElementText(Element elm) |
static Element |
getFirstChildElement(Element elm) |
static Element |
getFirstChildElement(Element elm,
String name) |
static Element |
getFirstChildElementIgnoreCase(Element elm,
String name) |
static Element |
getFirstChildElementNS(Element domNode,
QName name) |
static Element |
getFirstChildElementNS(Element elm,
String tns,
String localName) |
static String |
getFragmentText(DocumentFragment elm) |
static Node |
getNextElementSibling(Node node) |
static String |
getNodeValue(Node node) |
static QName |
getQName(Node node) |
static QName |
getQName(org.apache.xmlbeans.XmlObject contentElement) |
static String |
getValueForMatch(Node domNode,
boolean prettyPrintXml) |
static String |
getValueForMatch(org.apache.xmlbeans.XmlCursor cursor) |
static String |
getXPathValue(String value,
String xpath) |
static boolean |
hasContentAttributes(Element elm) |
static Document |
parse(InputSource inputSource) |
static Document |
parse(InputStream in) |
static Document |
parse(String fileName) |
static Document |
parseXml(String xmlString) |
static String |
prettyPrintXml(String xml) |
static String |
prettyPrintXml(org.apache.xmlbeans.XmlObject xml) |
static String |
removeUnneccessaryNamespaces(String xml) |
static String |
removeXPathNamespaceDeclarations(String xpath) |
static String |
replaceNameInPathOrQuery(String pathOrQuery,
String oldName,
String newName) |
static boolean |
seemsToBeXml(String str) |
static Node[] |
selectDomNodes(org.apache.xmlbeans.XmlObject xmlObject,
String xpath) |
static Node |
selectFirstDomNode(org.apache.xmlbeans.XmlObject xmlObject,
String xpath) |
static String |
selectFirstNodeValue(org.apache.xmlbeans.XmlObject xmlObject,
String xpath) |
static String[] |
selectNodeValues(org.apache.xmlbeans.XmlObject xmlObject,
String xpath) |
static String |
serialize(Document document) |
static void |
serialize(Document dom,
Writer writer) |
static void |
serialize(Element elm,
Writer writer) |
static String |
serialize(Node node,
boolean prettyPrint) |
static String |
serializePretty(Document document) |
static void |
serializePretty(Document dom,
Writer writer) |
static void |
serializePretty(org.apache.xmlbeans.XmlObject xmlObject,
Writer writer) |
static void |
setChildElementText(Element element,
String name,
String text) |
static void |
setElementText(Element elm,
String text) |
static boolean |
setNodeValue(Node domNode,
String string) |
static String |
setXPathContent(String xmlText,
String xpath,
String value) |
static void |
setXsiType(Element elm,
QName name) |
static String |
stripWhitespaces(String content) |
static String |
transferValues(String source,
String dest) |
public static Document parse(InputStream in)
public static Document parse(String fileName) throws IOException
IOException
public static Document parse(InputSource inputSource) throws IOException
IOException
public static void serializePretty(Document dom, Writer writer) throws IOException
IOException
public static void serializePretty(org.apache.xmlbeans.XmlObject xmlObject, Writer writer) throws IOException
IOException
public static org.apache.xmlbeans.XmlObject createXmlObject(InputStream input, org.apache.xmlbeans.XmlOptions xmlOptions) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlObject createXmlObject(String input, org.apache.xmlbeans.XmlOptions xmlOptions) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlObject createXmlObject(URL input, org.apache.xmlbeans.XmlOptions xmlOptions) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlObject createXmlObject(Node input, org.apache.xmlbeans.XmlOptions xmlOptions) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlObject createXmlObject(File input, org.apache.xmlbeans.XmlOptions xmlOptions) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlObject createXmlObject(InputStream input) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlObject createXmlObject(String input) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlObject createXmlObject(URL input) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlObject createXmlObject(Node input) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlObject createXmlObject(File input) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static org.apache.xmlbeans.XmlOptions createDefaultXmlOptions()
public static void serialize(Document dom, Writer writer) throws IOException
IOException
public static void serialize(Element elm, Writer writer) throws IOException
IOException
public static Element getFirstChildElementIgnoreCase(Element elm, String name)
public static Element getFirstChildElementNS(Element elm, String tns, String localName)
public static String getFragmentText(DocumentFragment elm)
public static String getChildElementText(Element elm, String name, String defaultValue)
public static void setChildElementText(Element element, String name, String text)
public static Document parseXml(String xmlString) throws IOException
IOException
public static String getElementPath(Element element)
element
- the element to create forpublic static int getElementIndex(Node element)
element
- the element to get forpublic static String declareXPathNamespaces(String xmlString) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static String prettyPrintXml(org.apache.xmlbeans.XmlObject xml)
public static String declareXPathNamespaces(WsdlInterface iface)
public static String createXPath(Node node, boolean anonymous, boolean selectText, XPathModifier modifier)
public static String createXPath(Node node, boolean anonymous, boolean selectText, boolean absolute, XPathModifier modifier)
public static String createXPath(Node node, boolean anonymous, boolean selectText, boolean absolute, XPathModifier modifier, boolean normalize)
public static XPathData createXPathData(Node node, boolean anonymous, boolean selectText, boolean absolute)
public static XPathData createXPathData(Node node, boolean anonymous, boolean selectText, boolean absolute, boolean normalize)
public static String declareXPathNamespaces(org.apache.xmlbeans.XmlObject xmlObject)
public static String removeXPathNamespaceDeclarations(String xpath)
public static NodeList getChildElementsByTagName(Element elm, String name)
public static NodeList getChildElementsOfType(Element elm, org.apache.xmlbeans.SchemaType schemaType)
public static NodeList getChildElementsByTagNameNS(Element elm, String namespaceUri, String localName)
public static String getValueForMatch(org.apache.xmlbeans.XmlCursor cursor)
public static boolean hasContentAttributes(Element elm)
public static String selectFirstNodeValue(org.apache.xmlbeans.XmlObject xmlObject, String xpath) throws org.apache.xmlbeans.XmlException
org.apache.xmlbeans.XmlException
public static String[] selectNodeValues(org.apache.xmlbeans.XmlObject xmlObject, String xpath)
public static Node selectFirstDomNode(org.apache.xmlbeans.XmlObject xmlObject, String xpath)
public static Node[] selectDomNodes(org.apache.xmlbeans.XmlObject xmlObject, String xpath)
public static boolean seemsToBeXml(String str)
public static String replaceNameInPathOrQuery(String pathOrQuery, String oldName, String newName) throws Exception
Exception
public static QName getQName(org.apache.xmlbeans.XmlObject contentElement)
public static String createJdbcXmlResult(Statement statement) throws SQLException, ParserConfigurationException
public static String createJdbcXmlResultEx(Statement statement, boolean makeUpperCased) throws SQLException, ParserConfigurationException
public static Document addResultSetXmlPart(Element resultsElement, ResultSet rs, Document xmlDocumentResult, boolean uppercase) throws SQLException
SQLException
Copyright © 2019. All Rights Reserved.