public class XMLUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FILE_DOT_EXTENSION |
static java.lang.String |
FILE_EXTENSION |
static java.lang.String |
NODE_ROOT_NAME |
Constructor and Description |
---|
XMLUtil() |
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Element |
addElement(org.w3c.dom.Node node,
java.lang.String name)
Add a named element to the specified node
|
static org.w3c.dom.Element |
addElement(org.w3c.dom.Node node,
java.lang.String name,
java.lang.String value)
Add a named element with a value to the specified node
|
static org.w3c.dom.Element |
addGenericElement(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name)
Add a generic element with specified type and name to the specified node
|
static org.w3c.dom.Element |
addGenericElement(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
java.lang.String value)
Add a generic element with specified type, name and value to the specified node
|
static org.w3c.dom.Node |
addNode(org.w3c.dom.Node parent,
org.w3c.dom.Node node)
Add the specified node to specified parent node
|
static org.w3c.dom.Node |
addValue(org.w3c.dom.Node node,
java.lang.String value)
Add a value to the specified node
|
static org.w3c.dom.Document |
createDocument(boolean createRoot)
Create and return an empty XML Document.
|
static org.w3c.dom.Document |
createDocument(java.lang.String xmlString)
Parse the specified string and convert it to XML Document (throw an exception if an error occurred).
|
static javax.xml.parsers.DocumentBuilder |
createDocumentBuilder()
Create and returns a new DocumentBuilder.
|
static org.w3c.dom.Element |
createRootElement(org.w3c.dom.Document doc)
Create root element for specified document if it does not already exist and return it
|
static org.w3c.dom.Element |
createRootElement(org.w3c.dom.Document doc,
java.lang.String name)
Create root element for specified document if it does not already exist and return it
|
static javax.xml.transform.Transformer |
createTransformer()
Create and returns a new Transformer.
|
static javax.xml.transform.Transformer |
createTransformerSafe()
Create and returns a new Transformer.
|
static java.lang.String |
filterString(java.lang.String text)
|
static java.util.ArrayList<org.w3c.dom.Attr> |
getAllAttributes(org.w3c.dom.Element element)
Get all attributes of the specified element
|
static java.lang.String |
getAllValues(org.w3c.dom.Element element,
java.lang.String def)
Get all values (value of all child) from the specified Element.
|
static org.w3c.dom.Attr |
getAttribute(org.w3c.dom.Element element,
java.lang.String attribute)
Get an attribute from the specified Element
|
static boolean |
getAttributeBooleanValue(org.w3c.dom.Element element,
java.lang.String attribute,
boolean def)
Get attribute value as Boolean from the specified Element.
|
static byte[] |
getAttributeBytesValue(org.w3c.dom.Element element,
java.lang.String attribute,
byte[] def)
Get attribute value as byte array from the specified Element.
|
static double |
getAttributeDoubleValue(org.w3c.dom.Element element,
java.lang.String attribute,
double def)
Get attribute value as double from the specified Element.
|
static float |
getAttributeFloatValue(org.w3c.dom.Element element,
java.lang.String attribute,
float def)
Get attribute value as float from the specified Element.
|
static int |
getAttributeIntValue(org.w3c.dom.Element element,
java.lang.String attribute,
int def)
Get attribute value as integer from the specified Element.
|
static long |
getAttributeLongValue(org.w3c.dom.Element element,
java.lang.String attribute,
long def)
Get attribute value as long from the specified Element.
|
static java.lang.String |
getAttributeValue(org.w3c.dom.Element element,
java.lang.String attribute,
java.lang.String def)
Get attribute value from the specified Element.
|
static boolean |
getBooleanValue(org.w3c.dom.Element element,
boolean def)
Get all values (value of all child) as Boolean from the specified Element.
|
static byte[] |
getBytes(java.lang.String value,
byte[] def) |
static byte[] |
getBytesValue(org.w3c.dom.Element element,
byte[] def)
Get value as byte array from the specified Element.
|
static org.w3c.dom.Node |
getChild(org.w3c.dom.Node node,
java.lang.String name)
Get the first child node with specified name from node.
|
static java.util.ArrayList<org.w3c.dom.Node> |
getChildren(org.w3c.dom.Node node)
Get all child node of specified node.
|
static java.util.ArrayList<org.w3c.dom.Node> |
getChildren(org.w3c.dom.Node node,
java.lang.String name)
Get all child nodes with specified name from node.
|
static org.w3c.dom.Document |
getDocument(java.lang.String xmlString)
Deprecated.
Use
createDocument(String) instead. |
static org.w3c.dom.Document |
getDocumentSafe(java.lang.String xmlString)
Deprecated.
Use
createDocument(String) instead. |
static double |
getDoubleValue(org.w3c.dom.Element element,
double def)
Get value as double from the specified Element.
|
static org.w3c.dom.Element |
getElement(org.w3c.dom.Node node,
java.lang.String name)
Get the first child element with specified name from node.
|
static java.lang.String |
getElementAllValues(org.w3c.dom.Node node,
java.lang.String name,
java.lang.String def)
Get all element values from the specified node.
|
static boolean |
getElementBooleanValue(org.w3c.dom.Node node,
java.lang.String name,
boolean def)
Get element value as boolean from the specified node.
|
static byte[] |
getElementBytesValue(org.w3c.dom.Node node,
java.lang.String name,
byte[] def)
Get element value as byte array from the specified node.
|
static double |
getElementDoubleValue(org.w3c.dom.Node node,
java.lang.String name,
double def)
Get element value as double from the specified node.
|
static java.lang.String |
getElementFirstValue(org.w3c.dom.Node node,
java.lang.String name,
java.lang.String def)
Get first element value from the specified node.
|
static float |
getElementFloatValue(org.w3c.dom.Node node,
java.lang.String name,
float def)
Get element value as float from the specified node.
|
static int |
getElementIntValue(org.w3c.dom.Node node,
java.lang.String name,
int def)
Get element value as integer from the specified node.
|
static long |
getElementLongValue(org.w3c.dom.Node node,
java.lang.String name,
long def)
Get element value as long from the specified node.
|
static java.util.ArrayList<org.w3c.dom.Element> |
getElements(org.w3c.dom.Node node)
Get all child element of specified node.
|
static java.util.ArrayList<org.w3c.dom.Element> |
getElements(org.w3c.dom.Node node,
java.lang.String name)
Get all child element with specified name of specified node.
|
static java.lang.String |
getElementValue(org.w3c.dom.Node node,
java.lang.String name,
java.lang.String def)
Get element value as string from the specified node.
|
static java.lang.String |
getFirstValue(org.w3c.dom.Element element,
java.lang.String def)
Get first value (value of first child) from the specified Element.
|
static float |
getFloatValue(org.w3c.dom.Element element,
float def)
Get value as float from the specified Element.
|
static org.w3c.dom.Element |
getGenericElement(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name)
Get child element with specified type (name) and name ('name attribute value')
from specified node.
|
static boolean |
getGenericElementBooleanValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
boolean def)
Get value ('value' attribute value) as boolean from element with specified type
and name ('name' attribute value).
|
static byte[] |
getGenericElementBytesValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
byte[] def)
Get value ('value' attribute value) as byte array from element with specified type
and name ('name' attribute value).
|
static double |
getGenericElementDoubleValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
double def)
Get value ('value' attribute value) as double from element with specified type
and name ('name' attribute value).
|
static float |
getGenericElementFloatValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
float def)
Get value ('value' attribute value) as float from element with specified type
and name ('name' attribute value).
|
static int |
getGenericElementIntValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
int def)
Get value ('value' attribute value) as integer from element with specified type
and name ('name' attribute value).
|
static long |
getGenericElementLongValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
long def)
Get value ('value' attribute value) as long from element with specified type
and name ('name' attribute value).
|
static java.lang.String |
getGenericElementName(org.w3c.dom.Element element)
Get name of specified generic element
|
static java.util.ArrayList<org.w3c.dom.Element> |
getGenericElements(org.w3c.dom.Node node,
java.lang.String type)
Get all child element with specified type (name) from specified node.
|
static java.util.ArrayList<org.w3c.dom.Element> |
getGenericElements(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name)
Get all child element with specified type (name) and name ('name attribute value')
from specified node.
|
static java.lang.String |
getGenericElementValue(org.w3c.dom.Element element,
java.lang.String def)
Get value of specified generic element
|
static java.lang.String |
getGenericElementValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
java.lang.String def)
Get value ('value' attribute value) from element with specified type
and name ('name' attribute value).
|
static int |
getIntValue(org.w3c.dom.Element element,
int def)
Get value as integer from the specified Element.
|
static long |
getLongValue(org.w3c.dom.Element element,
long def)
Get value as long from the specified Element.
|
static org.w3c.dom.Element |
getParentElement(org.w3c.dom.Element element)
Get parent element of specified element
|
static org.w3c.dom.Element |
getRootElement(org.w3c.dom.Document doc)
Return the root element for specified document (null if not found)
|
static org.w3c.dom.Element |
getRootElement(org.w3c.dom.Document doc,
boolean create)
Return the root element for specified document
Create if it does not already exist with the default NODE_ROOT_NAME |
static org.w3c.dom.Element |
getSubElement(org.w3c.dom.Node node,
java.lang.String name)
Deprecated.
Use
getElement(Node, String) instead. |
static java.util.ArrayList<org.w3c.dom.Element> |
getSubElements(org.w3c.dom.Node node)
Deprecated.
Use
getElements(Node) instead. |
static java.util.ArrayList<org.w3c.dom.Element> |
getSubElements(org.w3c.dom.Node node,
java.lang.String name)
Deprecated.
Use
getElements(Node, String) instead. |
static java.util.ArrayList<org.w3c.dom.Element> |
getSubGenericElements(org.w3c.dom.Node node,
java.lang.String type)
Deprecated.
Use
getGenericElements(Node, String) instead. |
static java.util.ArrayList<org.w3c.dom.Element> |
getSubGenericElements(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name)
Deprecated.
Use
getGenericElements(Node, String, String) instead. |
static org.w3c.dom.Node |
getSubNode(org.w3c.dom.Node node,
java.lang.String name)
Deprecated.
Use
getChild(Node, String) instead. |
static java.util.ArrayList<org.w3c.dom.Node> |
getSubNodes(org.w3c.dom.Node node)
Deprecated.
Use
getChildren(Node) instead. |
static java.util.ArrayList<org.w3c.dom.Node> |
getSubNodes(org.w3c.dom.Node node,
java.lang.String name)
Deprecated.
Use
getChildren(Node, String) instead. |
static java.lang.String |
getValue(org.w3c.dom.Element element,
java.lang.String def)
Get all values (value of all child) as String from the specified Element.
|
static java.lang.String |
getXMLString(org.w3c.dom.Document document)
Return the XML String from the specified document.
|
static org.w3c.dom.Document |
loadDocument(java.io.File f)
Load XML Document from specified file.
|
static org.w3c.dom.Document |
loadDocument(java.io.File f,
boolean showError)
Load XML Document from specified file.
|
static org.w3c.dom.Document |
loadDocument(java.lang.String path)
Load XML Document from specified path.
|
static org.w3c.dom.Document |
loadDocument(java.lang.String path,
AuthenticationInfo auth,
boolean showError)
Load XML Document from specified path with specified authentication.
|
static org.w3c.dom.Document |
loadDocument(java.lang.String path,
boolean showError)
Load XML Document from specified path.
|
static org.w3c.dom.Document |
loadDocument(java.net.URL url)
Load XML Document from specified URL.
|
static org.w3c.dom.Document |
loadDocument(java.net.URL url,
AuthenticationInfo auth,
boolean showError)
Load XML Document from specified URL with authentication informations.
|
static org.w3c.dom.Document |
loadDocument(java.net.URL url,
boolean showError)
Load XML Document from specified URL.
|
static void |
removeAllAttributes(org.w3c.dom.Element element)
Remove all attribute from the specified element
|
static void |
removeAllChildren(org.w3c.dom.Node node)
Remove all children from the specified node
|
static void |
removeAllChilds(org.w3c.dom.Node node)
Deprecated.
Use
removeAllChildren(Node) instead |
static void |
removeAttribute(org.w3c.dom.Element element,
java.lang.String name)
Remove an attribute from the specified element
|
static void |
removeChildren(org.w3c.dom.Node node,
java.lang.String name)
Remove all children with specified name from the specified node
|
static void |
removeChilds(org.w3c.dom.Node node,
java.lang.String name)
Deprecated.
Use
removeChildren(Node, String) instead |
static java.lang.String |
removeInvalidXMLCharacters(java.lang.String text)
Remove any invalid XML character from the specified string.
|
static boolean |
removeNode(org.w3c.dom.Node parent,
org.w3c.dom.Node child)
Remove the specified node from the specified parent node
|
static boolean |
removeNode(org.w3c.dom.Node node,
java.lang.String name)
Remove a node with specified name from the specified node
|
static java.lang.String |
removeXMLMarkups(java.lang.String s)
Remove all characters that are valid XML markups.
|
static boolean |
saveDocument(org.w3c.dom.Document doc,
java.io.File f)
Save the specified XML Document to specified file.
|
static boolean |
saveDocument(org.w3c.dom.Document doc,
java.lang.String filename)
Save the specified XML Document to specified filename.
|
static void |
setAttributeBooleanValue(org.w3c.dom.Element element,
java.lang.String attribute,
boolean value)
Set an attribute and his value as boolean to the specified node
|
static void |
setAttributeBytesValue(org.w3c.dom.Element element,
java.lang.String attribute,
byte[] value)
Set an attribute and his value as byte array to the specified node
|
static void |
setAttributeDoubleValue(org.w3c.dom.Element element,
java.lang.String attribute,
double value)
Set an attribute and his value as double to the specified node
|
static void |
setAttributeFloatValue(org.w3c.dom.Element element,
java.lang.String attribute,
float value)
Set an attribute and his value as float to the specified node
|
static void |
setAttributeIntValue(org.w3c.dom.Element element,
java.lang.String attribute,
int value)
Set an attribute and his value as integer to the specified node
|
static void |
setAttributeLongValue(org.w3c.dom.Element element,
java.lang.String attribute,
long value)
Set an attribute and his value as integer to the specified node
|
static void |
setAttributeValue(org.w3c.dom.Element element,
java.lang.String attribute,
java.lang.String value)
Set an attribute and his value to the specified node
|
static void |
setBooleanValue(org.w3c.dom.Element element,
boolean value)
Set value as boolean to the specified element
|
static void |
setBytesValue(org.w3c.dom.Element element,
byte[] value)
Set value as byte array to the specified element
|
static void |
setDoubleValue(org.w3c.dom.Element element,
double value)
Set value as double to the specified element
|
static org.w3c.dom.Element |
setElement(org.w3c.dom.Node node,
java.lang.String name)
Set a element with specified name to specified node.
|
static void |
setElementBooleanValue(org.w3c.dom.Node node,
java.lang.String name,
boolean value)
Set an element with specified name and his value as boolean to the specified node
|
static void |
setElementBytesValue(org.w3c.dom.Node node,
java.lang.String name,
byte[] value)
Set an element with specified name and his value as byte array to the specified node
|
static void |
setElementDoubleValue(org.w3c.dom.Node node,
java.lang.String name,
double value)
Set an element with specified name and his value as double to the specified node
|
static void |
setElementFloatValue(org.w3c.dom.Node node,
java.lang.String name,
float value)
Set an element with specified name and his value as float to the specified node
|
static void |
setElementIntValue(org.w3c.dom.Node node,
java.lang.String name,
int value)
Set an element with specified name and his value as integer to the specified node
|
static void |
setElementLongValue(org.w3c.dom.Node node,
java.lang.String name,
long value)
Set an element with specified name and his value as long to the specified node
|
static void |
setElementValue(org.w3c.dom.Node node,
java.lang.String name,
java.lang.String value)
Set an element with specified name and his value to the specified node
|
static void |
setFloatValue(org.w3c.dom.Element element,
float value)
Set value as float to the specified element
|
static org.w3c.dom.Element |
setGenericElement(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name)
Set a generic element with specified type and name to specified node.
|
static void |
setGenericElementBooleanValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
boolean value)
Set an element with specified type and name and his value as boolean to the specified node
|
static void |
setGenericElementBytesValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
byte[] value)
Set an element with specified type and name and his value as byte array to the specified node
|
static void |
setGenericElementDoubleValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
double value)
Set an element with specified type and name and his value as double to the specified node
|
static void |
setGenericElementFloatValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
float value)
Set an element with specified type and name and his value as float to the specified node
|
static void |
setGenericElementIntValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
int value)
Set an element with specified type and name and his value as integer to the specified node
|
static void |
setGenericElementLongValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
long value)
Set an element with specified type and name and his value as long to the specified node
|
static void |
setGenericElementName(org.w3c.dom.Element element,
java.lang.String name)
Set name of specified generic element
|
static void |
setGenericElementValue(org.w3c.dom.Element element,
java.lang.String value)
Set value of specified generic element
|
static void |
setGenericElementValue(org.w3c.dom.Node node,
java.lang.String type,
java.lang.String name,
java.lang.String value)
Set a generic element with specified type and name and his value to the specified node
|
static void |
setIntValue(org.w3c.dom.Element element,
int value)
Set value as integer to the specified element
|
static void |
setLongValue(org.w3c.dom.Element element,
long value)
Set value as long to the specified element
|
static org.w3c.dom.Node |
setNode(org.w3c.dom.Node parent,
org.w3c.dom.Node node)
Set the specified node to the specified parent node.
|
static void |
setValue(org.w3c.dom.Element element,
java.lang.String value)
Set value to the specified element
|
static java.lang.String |
toString(byte[] value) |
public static final java.lang.String FILE_EXTENSION
public static final java.lang.String FILE_DOT_EXTENSION
public static final java.lang.String NODE_ROOT_NAME
public XMLUtil()
public static javax.xml.parsers.DocumentBuilder createDocumentBuilder()
public static javax.xml.transform.Transformer createTransformer()
public static javax.xml.transform.Transformer createTransformerSafe() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public static org.w3c.dom.Document createDocument(boolean createRoot)
public static org.w3c.dom.Document createDocument(java.lang.String xmlString) throws org.xml.sax.SAXException, java.io.IOException
java.io.IOException
org.xml.sax.SAXException
@Deprecated public static org.w3c.dom.Document getDocument(java.lang.String xmlString)
createDocument(String)
instead.@Deprecated public static org.w3c.dom.Document getDocumentSafe(java.lang.String xmlString) throws org.xml.sax.SAXException, java.io.IOException
createDocument(String)
instead.org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document loadDocument(java.lang.String path)
public static org.w3c.dom.Document loadDocument(java.lang.String path, boolean showError)
public static org.w3c.dom.Document loadDocument(java.lang.String path, AuthenticationInfo auth, boolean showError)
public static org.w3c.dom.Document loadDocument(java.io.File f)
public static org.w3c.dom.Document loadDocument(java.io.File f, boolean showError)
public static org.w3c.dom.Document loadDocument(java.net.URL url)
public static org.w3c.dom.Document loadDocument(java.net.URL url, boolean showError)
public static org.w3c.dom.Document loadDocument(java.net.URL url, AuthenticationInfo auth, boolean showError)
public static boolean saveDocument(org.w3c.dom.Document doc, java.lang.String filename)
public static boolean saveDocument(org.w3c.dom.Document doc, java.io.File f)
public static java.lang.String getXMLString(org.w3c.dom.Document document) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public static org.w3c.dom.Element createRootElement(org.w3c.dom.Document doc)
public static org.w3c.dom.Element createRootElement(org.w3c.dom.Document doc, java.lang.String name)
public static org.w3c.dom.Element getRootElement(org.w3c.dom.Document doc, boolean create)
NODE_ROOT_NAME
public static org.w3c.dom.Element getRootElement(org.w3c.dom.Document doc)
public static org.w3c.dom.Element getParentElement(org.w3c.dom.Element element)
public static java.util.ArrayList<org.w3c.dom.Node> getChildren(org.w3c.dom.Node node)
public static org.w3c.dom.Node getChild(org.w3c.dom.Node node, java.lang.String name)
public static java.util.ArrayList<org.w3c.dom.Node> getChildren(org.w3c.dom.Node node, java.lang.String name)
@Deprecated public static java.util.ArrayList<org.w3c.dom.Node> getSubNodes(org.w3c.dom.Node node)
getChildren(Node)
instead.@Deprecated public static org.w3c.dom.Node getSubNode(org.w3c.dom.Node node, java.lang.String name)
getChild(Node, String)
instead.@Deprecated public static java.util.ArrayList<org.w3c.dom.Node> getSubNodes(org.w3c.dom.Node node, java.lang.String name)
getChildren(Node, String)
instead.public static java.util.ArrayList<org.w3c.dom.Element> getElements(org.w3c.dom.Node node)
public static org.w3c.dom.Element getElement(org.w3c.dom.Node node, java.lang.String name)
public static java.util.ArrayList<org.w3c.dom.Element> getElements(org.w3c.dom.Node node, java.lang.String name)
@Deprecated public static java.util.ArrayList<org.w3c.dom.Element> getSubElements(org.w3c.dom.Node node)
getElements(Node)
instead.@Deprecated public static org.w3c.dom.Element getSubElement(org.w3c.dom.Node node, java.lang.String name)
getElement(Node, String)
instead.@Deprecated public static java.util.ArrayList<org.w3c.dom.Element> getSubElements(org.w3c.dom.Node node, java.lang.String name)
getElements(Node, String)
instead.public static java.util.ArrayList<org.w3c.dom.Element> getGenericElements(org.w3c.dom.Node node, java.lang.String type)
public static java.util.ArrayList<org.w3c.dom.Element> getGenericElements(org.w3c.dom.Node node, java.lang.String type, java.lang.String name)
@Deprecated public static java.util.ArrayList<org.w3c.dom.Element> getSubGenericElements(org.w3c.dom.Node node, java.lang.String type)
getGenericElements(Node, String)
instead.@Deprecated public static java.util.ArrayList<org.w3c.dom.Element> getSubGenericElements(org.w3c.dom.Node node, java.lang.String type, java.lang.String name)
getGenericElements(Node, String, String)
instead.public static org.w3c.dom.Element getGenericElement(org.w3c.dom.Node node, java.lang.String type, java.lang.String name)
public static java.lang.String getGenericElementName(org.w3c.dom.Element element)
public static java.lang.String getGenericElementValue(org.w3c.dom.Element element, java.lang.String def)
public static java.util.ArrayList<org.w3c.dom.Attr> getAllAttributes(org.w3c.dom.Element element)
public static byte[] getBytes(java.lang.String value, byte[] def) throws java.util.zip.DataFormatException
java.util.zip.DataFormatException
public static java.lang.String toString(byte[] value)
public static org.w3c.dom.Attr getAttribute(org.w3c.dom.Element element, java.lang.String attribute)
public static java.lang.String getAttributeValue(org.w3c.dom.Element element, java.lang.String attribute, java.lang.String def)
public static boolean getAttributeBooleanValue(org.w3c.dom.Element element, java.lang.String attribute, boolean def)
public static byte[] getAttributeBytesValue(org.w3c.dom.Element element, java.lang.String attribute, byte[] def)
null
then null
is returned.public static int getAttributeIntValue(org.w3c.dom.Element element, java.lang.String attribute, int def)
public static long getAttributeLongValue(org.w3c.dom.Element element, java.lang.String attribute, long def)
public static float getAttributeFloatValue(org.w3c.dom.Element element, java.lang.String attribute, float def)
public static double getAttributeDoubleValue(org.w3c.dom.Element element, java.lang.String attribute, double def)
public static java.lang.String getFirstValue(org.w3c.dom.Element element, java.lang.String def)
public static java.lang.String getAllValues(org.w3c.dom.Element element, java.lang.String def)
public static java.lang.String getValue(org.w3c.dom.Element element, java.lang.String def)
public static boolean getBooleanValue(org.w3c.dom.Element element, boolean def)
public static int getIntValue(org.w3c.dom.Element element, int def)
public static long getLongValue(org.w3c.dom.Element element, long def)
public static float getFloatValue(org.w3c.dom.Element element, float def)
public static double getDoubleValue(org.w3c.dom.Element element, double def)
public static byte[] getBytesValue(org.w3c.dom.Element element, byte[] def)
null
if an error happened.public static java.lang.String getElementFirstValue(org.w3c.dom.Node node, java.lang.String name, java.lang.String def)
public static java.lang.String getElementAllValues(org.w3c.dom.Node node, java.lang.String name, java.lang.String def)
public static java.lang.String getElementValue(org.w3c.dom.Node node, java.lang.String name, java.lang.String def)
public static boolean getElementBooleanValue(org.w3c.dom.Node node, java.lang.String name, boolean def)
public static int getElementIntValue(org.w3c.dom.Node node, java.lang.String name, int def)
public static long getElementLongValue(org.w3c.dom.Node node, java.lang.String name, long def)
public static float getElementFloatValue(org.w3c.dom.Node node, java.lang.String name, float def)
public static double getElementDoubleValue(org.w3c.dom.Node node, java.lang.String name, double def)
public static byte[] getElementBytesValue(org.w3c.dom.Node node, java.lang.String name, byte[] def)
null
if an error happened.public static java.lang.String getGenericElementValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, java.lang.String def)
public static boolean getGenericElementBooleanValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, boolean def)
public static int getGenericElementIntValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, int def)
public static long getGenericElementLongValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, long def)
public static float getGenericElementFloatValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, float def)
public static double getGenericElementDoubleValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, double def)
public static byte[] getGenericElementBytesValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, byte[] def)
null
if an error happened.public static org.w3c.dom.Node addNode(org.w3c.dom.Node parent, org.w3c.dom.Node node)
public static org.w3c.dom.Node addValue(org.w3c.dom.Node node, java.lang.String value)
public static org.w3c.dom.Element addElement(org.w3c.dom.Node node, java.lang.String name)
public static org.w3c.dom.Element addElement(org.w3c.dom.Node node, java.lang.String name, java.lang.String value)
public static org.w3c.dom.Element addGenericElement(org.w3c.dom.Node node, java.lang.String type, java.lang.String name)
public static org.w3c.dom.Element addGenericElement(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, java.lang.String value)
public static void setGenericElementName(org.w3c.dom.Element element, java.lang.String name)
public static void setGenericElementValue(org.w3c.dom.Element element, java.lang.String value)
public static org.w3c.dom.Node setNode(org.w3c.dom.Node parent, org.w3c.dom.Node node)
public static org.w3c.dom.Element setElement(org.w3c.dom.Node node, java.lang.String name)
public static org.w3c.dom.Element setGenericElement(org.w3c.dom.Node node, java.lang.String type, java.lang.String name)
public static void setAttributeValue(org.w3c.dom.Element element, java.lang.String attribute, java.lang.String value)
public static void setAttributeBooleanValue(org.w3c.dom.Element element, java.lang.String attribute, boolean value)
public static void setAttributeIntValue(org.w3c.dom.Element element, java.lang.String attribute, int value)
public static void setAttributeLongValue(org.w3c.dom.Element element, java.lang.String attribute, long value)
public static void setAttributeFloatValue(org.w3c.dom.Element element, java.lang.String attribute, float value)
public static void setAttributeDoubleValue(org.w3c.dom.Element element, java.lang.String attribute, double value)
public static void setAttributeBytesValue(org.w3c.dom.Element element, java.lang.String attribute, byte[] value)
public static void setValue(org.w3c.dom.Element element, java.lang.String value)
public static java.lang.String removeXMLMarkups(java.lang.String s)
public static java.lang.String removeInvalidXMLCharacters(java.lang.String text)
public static java.lang.String filterString(java.lang.String text)
public static void setBooleanValue(org.w3c.dom.Element element, boolean value)
public static void setIntValue(org.w3c.dom.Element element, int value)
public static void setLongValue(org.w3c.dom.Element element, long value)
public static void setFloatValue(org.w3c.dom.Element element, float value)
public static void setDoubleValue(org.w3c.dom.Element element, double value)
public static void setBytesValue(org.w3c.dom.Element element, byte[] value)
public static void setElementValue(org.w3c.dom.Node node, java.lang.String name, java.lang.String value)
public static void setElementBooleanValue(org.w3c.dom.Node node, java.lang.String name, boolean value)
public static void setElementIntValue(org.w3c.dom.Node node, java.lang.String name, int value)
public static void setElementLongValue(org.w3c.dom.Node node, java.lang.String name, long value)
public static void setElementFloatValue(org.w3c.dom.Node node, java.lang.String name, float value)
public static void setElementDoubleValue(org.w3c.dom.Node node, java.lang.String name, double value)
public static void setElementBytesValue(org.w3c.dom.Node node, java.lang.String name, byte[] value)
public static void setGenericElementValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, java.lang.String value)
public static void setGenericElementBooleanValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, boolean value)
public static void setGenericElementIntValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, int value)
public static void setGenericElementLongValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, long value)
public static void setGenericElementFloatValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, float value)
public static void setGenericElementDoubleValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, double value)
public static void setGenericElementBytesValue(org.w3c.dom.Node node, java.lang.String type, java.lang.String name, byte[] value)
public static boolean removeNode(org.w3c.dom.Node node, java.lang.String name)
public static boolean removeNode(org.w3c.dom.Node parent, org.w3c.dom.Node child)
@Deprecated public static void removeAllChilds(org.w3c.dom.Node node)
removeAllChildren(Node)
insteadpublic static void removeAllChildren(org.w3c.dom.Node node)
@Deprecated public static void removeChilds(org.w3c.dom.Node node, java.lang.String name)
removeChildren(Node, String)
insteadpublic static void removeChildren(org.w3c.dom.Node node, java.lang.String name)
public static void removeAttribute(org.w3c.dom.Element element, java.lang.String name)
public static void removeAllAttributes(org.w3c.dom.Element element)