|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.zekr.engine.xml.XmlUtils
public class XmlUtils
Field Summary | |
---|---|
static java.lang.String |
TEXT_NODE
|
Constructor Summary | |
---|---|
XmlUtils()
|
Method Summary | |
---|---|
static java.lang.String |
getAttr(org.w3c.dom.Node node,
java.lang.String attr)
|
static org.w3c.dom.Element |
getElementByNamedAttr(org.w3c.dom.NodeList nodeList,
java.lang.String tagName,
java.lang.String attrName,
java.lang.String attrValue)
This methods looks into nodeList for any node matches <tagName> with an
attribute attrNode . |
static org.w3c.dom.Node |
getNode(org.w3c.dom.NodeList nodeList,
java.lang.String tagName)
|
static NodeList |
getNodes(NodeList list,
java.lang.String tagName)
|
static NodeList |
getNodes(org.w3c.dom.Node node,
java.lang.String tagName)
|
static java.lang.String |
getParentAttr(org.w3c.dom.Node node,
java.lang.String parentAttr)
|
static boolean |
isElement(org.w3c.dom.Node node,
java.lang.String string)
|
static void |
setAttr(org.w3c.dom.Element element,
java.lang.String attr,
java.lang.String value)
|
static void |
writeXml(org.w3c.dom.Node node,
java.io.File outputFile)
Writes a org.w3c.Node object into an output file. |
static void |
writeXml(org.w3c.dom.Node node,
java.io.File outputFile,
java.lang.String encoding)
Writes a org.w3c.Node object into an output file, specifying output file encoding. |
static void |
writeXml(org.w3c.dom.Node node,
java.io.Writer outputWriter)
Writes a org.w3c.Node object into an output Writer , omitting XML declaration. |
static void |
writeXml(org.w3c.dom.Node node,
java.io.Writer outputWriter,
boolean omitXmlDecl)
Writes a org.w3c.Node object into an output Writer . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TEXT_NODE
Constructor Detail |
---|
public XmlUtils()
Method Detail |
---|
public static org.w3c.dom.Node getNode(org.w3c.dom.NodeList nodeList, java.lang.String tagName)
public static NodeList getNodes(org.w3c.dom.Node node, java.lang.String tagName)
node
- single Node
.tagName
-
tagName
which are present in node
children (depth = 1). NodeList
.public static NodeList getNodes(NodeList list, java.lang.String tagName)
list
- tagName
-
list
with tag name equal to tagName
public static org.w3c.dom.Element getElementByNamedAttr(org.w3c.dom.NodeList nodeList, java.lang.String tagName, java.lang.String attrName, java.lang.String attrValue)
nodeList
for any node matches <tagName>
with an
attribute attrNode
.
nodeList
- a list of Node
stagName
- tag nameattrName
- tag attribute name
attrName
equal to attrValue
public static java.lang.String getAttr(org.w3c.dom.Node node, java.lang.String attr)
node
- attr
-
null
if there is no such attributepublic static void setAttr(org.w3c.dom.Element element, java.lang.String attr, java.lang.String value)
element
- attr
- value
- public static java.lang.String getParentAttr(org.w3c.dom.Node node, java.lang.String parentAttr)
node
- parentAttr
-
node
public static boolean isElement(org.w3c.dom.Node node, java.lang.String string)
public static void writeXml(org.w3c.dom.Node node, java.io.File outputFile) throws javax.xml.transform.TransformerException
org.w3c.Node
object into an output file.
node
- a Node
object to be written to fileoutputFile
- ouput file
javax.xml.transform.TransformerException
public static void writeXml(org.w3c.dom.Node node, java.io.File outputFile, java.lang.String encoding) throws javax.xml.transform.TransformerException
org.w3c.Node
object into an output file, specifying output file encoding.
node
- a Node
object to be written to fileoutputFile
- ouput fileencoding
- encoding of the output file
javax.xml.transform.TransformerException
public static void writeXml(org.w3c.dom.Node node, java.io.Writer outputWriter) throws javax.xml.transform.TransformerException
org.w3c.Node
object into an output Writer
, omitting XML declaration.
node
- node object to be written to fileoutputWriter
- ouput writer object
javax.xml.transform.TransformerException
public static void writeXml(org.w3c.dom.Node node, java.io.Writer outputWriter, boolean omitXmlDecl) throws javax.xml.transform.TransformerException
org.w3c.Node
object into an output Writer
.
node
- node object to be written to fileoutputWriter
- ouput writer objectomitXmlDecl
- omits XML declaration if true
javax.xml.transform.TransformerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |