public class XMLToolP extends XMLToolT
Constructor and Description |
---|
XMLToolP() |
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Node |
findNode(org.w3c.dom.Node srcNode,
java.lang.String strXmlPath,
java.lang.String... str1dSeparators)
Searches the given node in order to find out the target node, according
to the given text path (and separators) of the target node.
|
static org.w3c.dom.Node |
findNode(org.w3c.dom.Node srcNode,
XMLPath path)
Searches the given node in order to find out the target node, according
to the given path.
|
static org.w3c.dom.Document |
loadFromFile(java.io.File file)
Loads document from the given XML file.
|
static org.w3c.dom.Document |
loadFromFile(java.lang.String strFileName)
Loads document from an XML file according to the given file name.
|
static java.lang.String |
node2s(org.w3c.dom.Node node)
Generates a text presentation of a node, just for human reading, not
standard XML.
|
static boolean |
saveToFile(org.w3c.dom.Node node,
java.io.File file)
Saves the given node into the given XML file.
|
static boolean |
saveToFile(org.w3c.dom.Node node,
java.lang.String strFileName)
Saves the given node into an XML file according to the given file name.
|
public static org.w3c.dom.Document loadFromFile(java.lang.String strFileName)
strFileName
- - The given file name of the XML file to load.public static org.w3c.dom.Document loadFromFile(java.io.File file)
file
- - The given XML file to load.public static org.w3c.dom.Node findNode(org.w3c.dom.Node srcNode, java.lang.String strXmlPath, java.lang.String... str1dSeparators)
srcNode
- - The given node to be searched.strXmlPath
- - A text presentation of the path of the target node. str1dSeparators
- - Path separators:public static org.w3c.dom.Node findNode(org.w3c.dom.Node srcNode, XMLPath path)
srcNode
- - The given node to be searched.path
- - Path of the target node.public static java.lang.String node2s(org.w3c.dom.Node node)
node
- - The given node to be presented as text.public static boolean saveToFile(org.w3c.dom.Node node, java.lang.String strFileName) throws javax.xml.transform.TransformerException
node
- - The given node to be saved.strFileName
- - The given file name of the XML file to save.javax.xml.transform.TransformerException
- .public static boolean saveToFile(org.w3c.dom.Node node, java.io.File file) throws javax.xml.transform.TransformerException
node
- - The given node to be saved.file
- - The given XML file to save.javax.xml.transform.TransformerException
- .