public class XMLUtil
extends java.lang.Object
Constructor and Description |
---|
XMLUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
attrBoolVal(org.w3c.dom.Element el,
java.lang.String attrName) |
static boolean |
attrBoolValWithDefault(org.w3c.dom.Element el,
java.lang.String attrName,
boolean defaultValue) |
static java.awt.Color |
attrColorVal(org.w3c.dom.Element el,
java.lang.String attrName)
Constructs a color from an attribute value in an XML document.
|
static int |
attrIntVal(org.w3c.dom.Element el,
java.lang.String attrName) |
static java.lang.String |
attrStrVal(org.w3c.dom.Element el,
java.lang.String attrName) |
static java.util.List<org.w3c.dom.Element> |
getChildElements(org.w3c.dom.Element el) |
static java.util.List<org.w3c.dom.Element> |
getElements(org.w3c.dom.Element el,
java.lang.String elName) |
static org.w3c.dom.Document |
newEmptyDocument() |
static org.w3c.dom.Document |
parseXMLStream(java.io.InputStream s,
boolean validating)
parse an XML file
|
static void |
writeXML(org.w3c.dom.Node node,
java.lang.String outfile)
Generates an XML file at a specified path containing the contents of a DOM node
|
public static org.w3c.dom.Document parseXMLStream(java.io.InputStream s, boolean validating)
f
- the XML filevalidating
- toggle validationpublic static org.w3c.dom.Document newEmptyDocument()
public static void writeXML(org.w3c.dom.Node node, java.lang.String outfile)
node
- - the DOM node whose content is output into the fileoutfile
- - the path to the XML file that is to be generatedpublic static boolean attrBoolVal(org.w3c.dom.Element el, java.lang.String attrName)
public static boolean attrBoolValWithDefault(org.w3c.dom.Element el, java.lang.String attrName, boolean defaultValue)
public static java.awt.Color attrColorVal(org.w3c.dom.Element el, java.lang.String attrName)
el
- the element whose attribute we accessattrName
- name of the attribute whose value encodes the colorpublic static int attrIntVal(org.w3c.dom.Element el, java.lang.String attrName)
public static java.lang.String attrStrVal(org.w3c.dom.Element el, java.lang.String attrName)
public static java.util.List<org.w3c.dom.Element> getElements(org.w3c.dom.Element el, java.lang.String elName)
public static java.util.List<org.w3c.dom.Element> getChildElements(org.w3c.dom.Element el)