public class CXMLHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_DATA_DEFAULT_INTEGER
A crazy integer to use as a default if you don't really want a default
|
static java.lang.String |
NO_DATA_DEFAULT_STRING
A crazy string to use as a default if you don't really want a default
|
| Constructor and Description |
|---|
CXMLHelper() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
int nDefault) |
static java.lang.String |
getChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
java.lang.String sDefault) |
static java.lang.String |
getChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
java.lang.String sDefault,
boolean bAllowEmptyString) |
static java.lang.String[] |
getChildElementValueList(org.w3c.dom.Element oParent,
java.lang.String sChildName,
java.lang.String sDefault) |
static int |
getNthChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
int n,
int nDefault) |
static java.lang.String |
getNthChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
int n,
java.lang.String sDefault) |
static org.w3c.dom.Document |
LoadFileIntoDOM(java.lang.String sFileName)
Load a file into a DOM
|
static org.w3c.dom.Document |
LoadStringIntoDOM(java.lang.String sInput)
Load a string into a DOM
|
static java.lang.String |
NodeToString(org.w3c.dom.Node node) |
static void |
SaveDocumentToDisk(org.w3c.dom.Document doc,
java.lang.String fileName) |
public static final java.lang.String NO_DATA_DEFAULT_STRING
public static final int NO_DATA_DEFAULT_INTEGER
public static java.lang.String getChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
java.lang.String sDefault)
public static java.lang.String getChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
java.lang.String sDefault,
boolean bAllowEmptyString)
oParent - The parent node to read fromsChildName - The name of the tag that you want the value ofsDefault - The default value to return if the value is missingbAllowEmptyString - If false, an empty node will return sDefault rather than an empty string.public static int getChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
int nDefault)
oParent - The parent node to read fromsChildName - The name of the tag that you want the value ofnDefault - The default value to return if the value is missingpublic static java.lang.String getNthChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
int n,
java.lang.String sDefault)
oParent - The parent node to read fromsChildName - The name of the tag that you want the value ofn - The 1-based index of the child to read (eg 2 means to return the value of the second child element with that namesDefault - The default value to return if the value is missingpublic static int getNthChildElementValue(org.w3c.dom.Element oParent,
java.lang.String sChildName,
int n,
int nDefault)
oParent - The parent node to read fromsChildName - The name of the tag that you want the value ofn - The 1-based index of the child to read (eg 2 means to return the value of the second child element with that namenDefault - The default value to return if the value is missingpublic static java.lang.String[] getChildElementValueList(org.w3c.dom.Element oParent,
java.lang.String sChildName,
java.lang.String sDefault)
throws ResponseMasterException
oParent - The parent node to read fromsChildName - The name of the tag that you want the value ofsDefault - The default value to return if the value is missingResponseMasterException - If there is a problem with the xml structure.public static org.w3c.dom.Document LoadFileIntoDOM(java.lang.String sFileName)
throws ResponseMasterException
sFileName - The file name to read.ResponseMasterException - is thrown if there is a problempublic static org.w3c.dom.Document LoadStringIntoDOM(java.lang.String sInput)
throws ResponseMasterException
sInput - Xml string to load into an XML documentResponseMasterException - is thrown if there is a problempublic static void SaveDocumentToDisk(org.w3c.dom.Document doc,
java.lang.String fileName)
throws ResponseMasterException
ResponseMasterExceptionpublic static java.lang.String NodeToString(org.w3c.dom.Node node)
throws ResponseMasterException
ResponseMasterException