Package org.apache.ofbiz.base.util
Class UtilXml
- java.lang.Object
-
- org.apache.ofbiz.base.util.UtilXml
-
public final class UtilXml extends java.lang.Object
Utilities methods to simplify dealing with JAXP and DOM XML parsing
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UtilXml.LocalErrorHandler
Local error handler for entity resolver to DocumentBuilder parser.static class
UtilXml.LocalResolver
Local entity resolver to handle J2EE DTDs.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.w3c.dom.Element
addChildElement(org.w3c.dom.Element element, java.lang.String childElementName, org.w3c.dom.Document document)
Creates a child element with the given name and appends it to the element child node list.static org.w3c.dom.Element
addChildElementCDATAValue(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String childElementValue, org.w3c.dom.Document document)
Creates a child element with the given name and appends it to the element child node list.static org.w3c.dom.Element
addChildElementNSElement(org.w3c.dom.Element element, java.lang.String childElementName, org.w3c.dom.Document document, java.lang.String nameSpaceUrl)
Creates a child element with the given namespace supportive name and appends it to the element child node list.static org.w3c.dom.Element
addChildElementNSValue(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String childElementValue, org.w3c.dom.Document document, java.lang.String nameSpaceUrl)
Creates a child element with the given namespace supportive name and appends it to the element child node list.static org.w3c.dom.Element
addChildElementValue(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String childElementValue, org.w3c.dom.Document document)
Creates a child element with the given name and appends it to the element child node list.static boolean
checkBoolean(java.lang.String str)
static boolean
checkBoolean(java.lang.String str, boolean defaultValue)
static java.lang.String
checkEmpty(java.lang.String string)
static java.lang.String
checkEmpty(java.lang.String string1, java.lang.String string2)
static java.lang.String
checkEmpty(java.lang.String string1, java.lang.String string2, java.lang.String string3)
static java.lang.String
childElementAttribute(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String attributeName, java.lang.String defaultValue)
Return a named attribute of a named child node or a default if null.static java.util.List<? extends org.w3c.dom.Element>
childElementList(org.w3c.dom.DocumentFragment fragment)
Return a List of Element objects that are children of the given DocumentFragmentstatic java.util.List<? extends org.w3c.dom.Element>
childElementList(org.w3c.dom.Element element)
Return a List of Element objects that are children of the given elementstatic java.util.List<? extends org.w3c.dom.Element>
childElementList(org.w3c.dom.Element element, java.lang.String childElementName)
Return a List of Element objects that have the given name and are immediate children of the given element; if name is null, all child elements will be included.static java.util.List<? extends org.w3c.dom.Element>
childElementList(org.w3c.dom.Element element, java.lang.String... childElementNames)
Return a List of Element objects that have the given name and are immediate children of the given element; if name is null, all child elements will be included.static java.util.List<? extends org.w3c.dom.Element>
childElementList(org.w3c.dom.Element element, java.util.Set<java.lang.String> childElementNames)
Return a List of Element objects that have the given name and are immediate children of the given element; if name is null, all child elements will be included.static java.lang.String
childElementValue(org.w3c.dom.Element element, java.lang.String childElementName)
Return the text (node value) contained by the named child node.static java.lang.String
childElementValue(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String defaultValue)
Return the text (node value) contained by the named child node or a default value if null.static java.util.List<? extends org.w3c.dom.Node>
childNodeList(org.w3c.dom.Node node)
Return a List of Node objects that have the given name and are immediate children of the given element; if name is null, all child elements will be included.static java.lang.String
convertDocumentToXmlString(org.w3c.dom.Document document)
static org.w3c.dom.Comment
createApacheLicenceComment(org.w3c.dom.Document document)
Returns an ASF Licence Header as a Comment Elementstatic org.w3c.dom.ls.LSOutput
createLSOutput(org.w3c.dom.ls.DOMImplementationLS impl, java.io.OutputStream os, java.lang.String encoding)
Returns aLSOutput
instance.static org.w3c.dom.ls.LSSerializer
createLSSerializer(org.w3c.dom.ls.DOMImplementationLS impl, boolean includeXmlDeclaration, boolean enablePrettyPrint)
Returns aLSSerializer
instance.static javax.xml.transform.Transformer
createOutputTransformer(java.lang.String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount)
Creates a JAXP TrAX Transformer suitable for pretty-printing an XML document.static java.lang.String
elementAttribute(org.w3c.dom.Element element, java.lang.String attrName, java.lang.String defaultValue)
static java.lang.String
elementValue(org.w3c.dom.Element element)
Return the text (node value) of the first node under this, works best if normalized.static org.w3c.dom.Element
firstChildElement(org.w3c.dom.Element element)
Return the first child Element returns the first element.static org.w3c.dom.Element
firstChildElement(org.w3c.dom.Element element, java.lang.String childElementName)
Return the first child Element with the given name; if name is null returns the first element.static org.w3c.dom.Element
firstChildElement(org.w3c.dom.Element element, java.lang.String... childElementNames)
Return the first child Element returns the first element.static org.w3c.dom.Element
firstChildElement(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String attrName, java.lang.String attrValue)
Return the first child Element with the given name; if name is null returns the first element.static org.w3c.dom.Element
firstChildElement(org.w3c.dom.Element element, java.util.Set<java.lang.String> childElementNames)
Return the first child Element returns the first element.static java.lang.Object
fromXml(java.io.InputStream input)
Deserialize an object from anInputStream
.static java.lang.Object
fromXml(java.io.Reader reader)
Deserialize an object from aReader
.static java.lang.Object
fromXml(java.lang.String str)
Deserialize an object from aString
.static java.lang.String
getAttributeValueIgnorePrefix(org.w3c.dom.Element element, java.lang.String attributeName)
get attribute value ignoring prefix in attribute namestatic org.w3c.dom.ls.DOMImplementationLS
getDomLsImplementation()
Returns aDOMImplementationLS
instance.static java.lang.String
getNodeNameIgnorePrefix(org.w3c.dom.Node node)
get node name without any prefixstatic java.lang.String
getTagNameIgnorePrefix(org.w3c.dom.Element element)
get tag name without any prefixstatic org.w3c.dom.Document
makeEmptyXmlDocument()
static org.w3c.dom.Document
makeEmptyXmlDocument(java.lang.String rootElementName)
static java.lang.String
nodeNameToJavaName(java.lang.String nodeName, boolean capitalizeFirst)
static java.lang.String
nodeValue(org.w3c.dom.Node node)
Return the text (node value) of the first node under thisstatic org.w3c.dom.Document
readXmlDocument(java.io.InputStream is, boolean validate, java.lang.String docDescription)
static org.w3c.dom.Document
readXmlDocument(java.io.InputStream is, boolean validate, java.lang.String docDescription, boolean withPosition)
static org.w3c.dom.Document
readXmlDocument(java.io.InputStream is, java.lang.String docDescription)
static org.w3c.dom.Document
readXmlDocument(java.io.InputStream is, java.lang.String docDescription, boolean withPosition)
static org.w3c.dom.Document
readXmlDocument(java.lang.String content)
static org.w3c.dom.Document
readXmlDocument(java.lang.String content, boolean validate)
static org.w3c.dom.Document
readXmlDocument(java.lang.String content, boolean validate, boolean withPosition)
static org.w3c.dom.Document
readXmlDocument(java.net.URL url)
static org.w3c.dom.Document
readXmlDocument(java.net.URL url, boolean validate)
static org.w3c.dom.Document
readXmlDocument(java.net.URL url, boolean validate, boolean withPosition)
static java.lang.String
toXml(java.lang.Object obj)
Serialize an object to an XMLString
.static void
toXml(java.lang.Object obj, java.io.OutputStream output)
Serialize an object to anOutputStream
.static void
toXml(java.lang.Object obj, java.io.Writer writer)
Serialize an object to aWriter
.static void
transformDomDocument(javax.xml.transform.Transformer transformer, org.w3c.dom.Node node, java.io.OutputStream os)
Serializes a DOMNode
to anOutputStream
using JAXP TrAX.static void
writeXmlDocument(java.io.OutputStream os, org.w3c.dom.Node node)
static void
writeXmlDocument(java.io.OutputStream os, org.w3c.dom.Node node, java.lang.String encoding, boolean includeXmlDeclaration, boolean enablePrettyPrint)
Serializes a DOM Node to anOutputStream
using DOM 3.static void
writeXmlDocument(java.lang.String filename, org.w3c.dom.Node node)
static java.lang.String
writeXmlDocument(org.w3c.dom.Node node)
static void
writeXmlDocument(org.w3c.dom.Node node, java.io.OutputStream os, java.lang.String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount)
Serializes a DOMNode
to anOutputStream
using JAXP TrAX.
-
-
-
Method Detail
-
getDomLsImplementation
public static org.w3c.dom.ls.DOMImplementationLS getDomLsImplementation() throws java.lang.ClassCastException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
Returns aDOMImplementationLS
instance.- Returns:
- A
DOMImplementationLS
instance - Throws:
java.lang.ClassCastException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
- See Also:
- DOM Level 3 Load and Save Specification
-
createLSOutput
public static org.w3c.dom.ls.LSOutput createLSOutput(org.w3c.dom.ls.DOMImplementationLS impl, java.io.OutputStream os, java.lang.String encoding)
Returns aLSOutput
instance.- Parameters:
impl
- ADOMImplementationLS
instanceos
- OptionalOutputStream
instanceencoding
- Optional character encoding, default is UTF-8- Returns:
- A
LSOutput
instance - See Also:
- DOM Level 3 Load and Save Specification
-
createLSSerializer
public static org.w3c.dom.ls.LSSerializer createLSSerializer(org.w3c.dom.ls.DOMImplementationLS impl, boolean includeXmlDeclaration, boolean enablePrettyPrint)
Returns aLSSerializer
instance.- Parameters:
impl
- ADOMImplementationLS
instanceincludeXmlDeclaration
- If set totrue
, the xml declaration will be included in the outputenablePrettyPrint
- If set totrue
, the output will be formatted in human-readable form. If set tofalse
, the entire document will consist of a single line.- Returns:
- A
LSSerializer
instance - See Also:
- DOM Level 3 Load and Save Specification
-
writeXmlDocument
public static void writeXmlDocument(java.io.OutputStream os, org.w3c.dom.Node node, java.lang.String encoding, boolean includeXmlDeclaration, boolean enablePrettyPrint) throws java.lang.ClassCastException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
Serializes a DOM Node to anOutputStream
using DOM 3.- Parameters:
os
- TheOutputStream
instance to write tonode
- The DOMNode
object to be serializedencoding
- Optional character encodingincludeXmlDeclaration
- If set totrue
, the xml declaration will be included in the outputenablePrettyPrint
- If set totrue
, the output will be formatted in human-readable form. If set tofalse
, the entire document will consist of a single line.- Throws:
java.lang.ClassCastException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
- See Also:
- DOM Level 3 Load and Save Specification
-
createOutputTransformer
public static javax.xml.transform.Transformer createOutputTransformer(java.lang.String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount) throws javax.xml.transform.TransformerConfigurationException
Creates a JAXP TrAX Transformer suitable for pretty-printing an XML document. This method is provided as an alternative to the deprecatedorg.apache.xml.serialize.OutputFormat
class.- Parameters:
encoding
- Optional encoding, defaults to UTF-8omitXmlDeclaration
- Iftrue
the xml declaration will be omitted from the outputindent
- Iftrue
, the output will be indentedindentAmount
- Ifindent
istrue
, the number of spaces to indent. Default is 4.- Returns:
- A
Transformer
instance - Throws:
javax.xml.transform.TransformerConfigurationException
- See Also:
- JAXP TrAX
-
transformDomDocument
public static void transformDomDocument(javax.xml.transform.Transformer transformer, org.w3c.dom.Node node, java.io.OutputStream os) throws javax.xml.transform.TransformerException
Serializes a DOMNode
to anOutputStream
using JAXP TrAX.- Parameters:
transformer
- ATransformer
instancenode
- TheNode
to serializeos
- TheOutputStream
to serialize to- Throws:
javax.xml.transform.TransformerException
- See Also:
- JAXP TrAX
-
writeXmlDocument
public static void writeXmlDocument(org.w3c.dom.Node node, java.io.OutputStream os, java.lang.String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount) throws javax.xml.transform.TransformerException
Serializes a DOMNode
to anOutputStream
using JAXP TrAX.- Parameters:
node
- TheNode
to serializeos
- TheOutputStream
to serialize toencoding
- Optional encoding, defaults to UTF-8omitXmlDeclaration
- Iftrue
the xml declaration will be omitted from the outputindent
- Iftrue
, the output will be indentedindentAmount
- Ifindent
istrue
, the number of spaces to indent. Default is 4.- Throws:
javax.xml.transform.TransformerException
- See Also:
- JAXP TrAX
-
fromXml
public static java.lang.Object fromXml(java.io.InputStream input)
Deserialize an object from anInputStream
.- Parameters:
input
- TheInputStream
- Returns:
- The deserialized
Object
-
fromXml
public static java.lang.Object fromXml(java.io.Reader reader)
Deserialize an object from aReader
.- Parameters:
reader
- TheReader
- Returns:
- The deserialized
Object
-
fromXml
public static java.lang.Object fromXml(java.lang.String str)
Deserialize an object from aString
.- Parameters:
str
- TheString
- Returns:
- The deserialized
Object
-
toXml
public static java.lang.String toXml(java.lang.Object obj)
Serialize an object to an XMLString
.- Parameters:
obj
- The object to serialize- Returns:
- An XML
String
-
toXml
public static void toXml(java.lang.Object obj, java.io.OutputStream output)
Serialize an object to anOutputStream
.- Parameters:
obj
- The object to serializeoutput
- TheOutputStream
-
toXml
public static void toXml(java.lang.Object obj, java.io.Writer writer)
Serialize an object to aWriter
.- Parameters:
obj
- The object to serializewriter
- TheWriter
-
writeXmlDocument
public static java.lang.String writeXmlDocument(org.w3c.dom.Node node) throws java.io.IOException
- Throws:
java.io.IOException
-
writeXmlDocument
public static void writeXmlDocument(java.lang.String filename, org.w3c.dom.Node node) throws java.io.FileNotFoundException, java.io.IOException
- Throws:
java.io.FileNotFoundException
java.io.IOException
-
writeXmlDocument
public static void writeXmlDocument(java.io.OutputStream os, org.w3c.dom.Node node) throws java.io.IOException
- Throws:
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.lang.String content) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.lang.String content, boolean validate) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.lang.String content, boolean validate, boolean withPosition) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.net.URL url) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.net.URL url, boolean validate) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.net.URL url, boolean validate, boolean withPosition) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.io.InputStream is, java.lang.String docDescription) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.io.InputStream is, java.lang.String docDescription, boolean withPosition) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.io.InputStream is, boolean validate, java.lang.String docDescription) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.io.InputStream is, boolean validate, java.lang.String docDescription, boolean withPosition) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException
- Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
-
makeEmptyXmlDocument
public static org.w3c.dom.Document makeEmptyXmlDocument()
-
makeEmptyXmlDocument
public static org.w3c.dom.Document makeEmptyXmlDocument(java.lang.String rootElementName)
-
addChildElement
public static org.w3c.dom.Element addChildElement(org.w3c.dom.Element element, java.lang.String childElementName, org.w3c.dom.Document document)
Creates a child element with the given name and appends it to the element child node list.
-
addChildElementValue
public static org.w3c.dom.Element addChildElementValue(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String childElementValue, org.w3c.dom.Document document)
Creates a child element with the given name and appends it to the element child node list. Also creates a Text node with the given value and appends it to the new elements child node list.
-
addChildElementNSElement
public static org.w3c.dom.Element addChildElementNSElement(org.w3c.dom.Element element, java.lang.String childElementName, org.w3c.dom.Document document, java.lang.String nameSpaceUrl)
Creates a child element with the given namespace supportive name and appends it to the element child node list.
-
addChildElementNSValue
public static org.w3c.dom.Element addChildElementNSValue(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String childElementValue, org.w3c.dom.Document document, java.lang.String nameSpaceUrl)
Creates a child element with the given namespace supportive name and appends it to the element child node list. Also creates a Text node with the given value and appends it to the new elements child node list.
-
addChildElementCDATAValue
public static org.w3c.dom.Element addChildElementCDATAValue(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String childElementValue, org.w3c.dom.Document document)
Creates a child element with the given name and appends it to the element child node list. Also creates a CDATASection node with the given value and appends it to the new elements child node list.
-
childElementList
public static java.util.List<? extends org.w3c.dom.Element> childElementList(org.w3c.dom.Element element)
Return a List of Element objects that are children of the given element
-
childElementList
public static java.util.List<? extends org.w3c.dom.Element> childElementList(org.w3c.dom.Element element, java.lang.String childElementName)
Return a List of Element objects that have the given name and are immediate children of the given element; if name is null, all child elements will be included.
-
childElementList
public static java.util.List<? extends org.w3c.dom.Element> childElementList(org.w3c.dom.Element element, java.util.Set<java.lang.String> childElementNames)
Return a List of Element objects that have the given name and are immediate children of the given element; if name is null, all child elements will be included.
-
childElementList
public static java.util.List<? extends org.w3c.dom.Element> childElementList(org.w3c.dom.Element element, java.lang.String... childElementNames)
Return a List of Element objects that have the given name and are immediate children of the given element; if name is null, all child elements will be included.
-
childElementList
public static java.util.List<? extends org.w3c.dom.Element> childElementList(org.w3c.dom.DocumentFragment fragment)
Return a List of Element objects that are children of the given DocumentFragment
-
childNodeList
public static java.util.List<? extends org.w3c.dom.Node> childNodeList(org.w3c.dom.Node node)
Return a List of Node objects that have the given name and are immediate children of the given element; if name is null, all child elements will be included.
-
firstChildElement
public static org.w3c.dom.Element firstChildElement(org.w3c.dom.Element element, java.util.Set<java.lang.String> childElementNames)
Return the first child Element returns the first element.
-
firstChildElement
public static org.w3c.dom.Element firstChildElement(org.w3c.dom.Element element, java.lang.String... childElementNames)
Return the first child Element returns the first element.
-
firstChildElement
public static org.w3c.dom.Element firstChildElement(org.w3c.dom.Element element)
Return the first child Element returns the first element.
-
firstChildElement
public static org.w3c.dom.Element firstChildElement(org.w3c.dom.Element element, java.lang.String childElementName)
Return the first child Element with the given name; if name is null returns the first element.
-
firstChildElement
public static org.w3c.dom.Element firstChildElement(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String attrName, java.lang.String attrValue)
Return the first child Element with the given name; if name is null returns the first element.
-
childElementValue
public static java.lang.String childElementValue(org.w3c.dom.Element element, java.lang.String childElementName)
Return the text (node value) contained by the named child node.
-
childElementValue
public static java.lang.String childElementValue(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String defaultValue)
Return the text (node value) contained by the named child node or a default value if null.
-
childElementAttribute
public static java.lang.String childElementAttribute(org.w3c.dom.Element element, java.lang.String childElementName, java.lang.String attributeName, java.lang.String defaultValue)
Return a named attribute of a named child node or a default if null.
-
elementValue
public static java.lang.String elementValue(org.w3c.dom.Element element)
Return the text (node value) of the first node under this, works best if normalized.
-
nodeValue
public static java.lang.String nodeValue(org.w3c.dom.Node node)
Return the text (node value) of the first node under this
-
elementAttribute
public static java.lang.String elementAttribute(org.w3c.dom.Element element, java.lang.String attrName, java.lang.String defaultValue)
-
checkEmpty
public static java.lang.String checkEmpty(java.lang.String string)
-
checkEmpty
public static java.lang.String checkEmpty(java.lang.String string1, java.lang.String string2)
-
checkEmpty
public static java.lang.String checkEmpty(java.lang.String string1, java.lang.String string2, java.lang.String string3)
-
checkBoolean
public static boolean checkBoolean(java.lang.String str)
-
checkBoolean
public static boolean checkBoolean(java.lang.String str, boolean defaultValue)
-
nodeNameToJavaName
public static java.lang.String nodeNameToJavaName(java.lang.String nodeName, boolean capitalizeFirst)
-
getNodeNameIgnorePrefix
public static java.lang.String getNodeNameIgnorePrefix(org.w3c.dom.Node node)
get node name without any prefix- Parameters:
node
-- Returns:
- nodeName
-
getTagNameIgnorePrefix
public static java.lang.String getTagNameIgnorePrefix(org.w3c.dom.Element element)
get tag name without any prefix- Parameters:
element
-- Returns:
- tagName
-
getAttributeValueIgnorePrefix
public static java.lang.String getAttributeValueIgnorePrefix(org.w3c.dom.Element element, java.lang.String attributeName)
get attribute value ignoring prefix in attribute name- Parameters:
element
-- Returns:
- The value of the node, depending on its type; see the table Node class
-
convertDocumentToXmlString
public static java.lang.String convertDocumentToXmlString(org.w3c.dom.Document document)
-
createApacheLicenceComment
public static org.w3c.dom.Comment createApacheLicenceComment(org.w3c.dom.Document document)
Returns an ASF Licence Header as a Comment Element- Parameters:
document
-- Returns:
-
-