| java.lang.Object | |
| ↳ | com.microstrategy.utils.xml.XMLUtils |
This class provides additional utilities that can be applied to the XML.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| class | XMLUtils.DefaultEntityResolver | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| XMLUtils() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static void | appendResolvedSessionId(String sessionID, XMLBuilder builder) | ||||||||||
| static String |
compareNodes(Node base, Node other, boolean ignoreTextNodes)
This method compares two
Node instances (including all their attributes and children) and
returns a string with the differences between them. | ||||||||||
| static String |
encodeXMLAttribute(String strToEncode)
Replaces HTML unfriendly characters with their escaped equivalents.
| ||||||||||
| static String |
escapeString(String s)
Given a String containing markup, escape the markup so it
can be put into xml as normal text.
| ||||||||||
| static String |
formatXML(String xmlIn)
This constructs a nicely formatted XML document, typically used for printing in a user readable format. | ||||||||||
| static String | getResolvedSessionId(String sessionID) | ||||||||||
| static boolean |
isValidGUID(String str)
Check whether the string is a valid GUID
| ||||||||||
| static boolean |
isValidNodeKey(String str)
Check whether the string is a valid Nodekey, a loose check on whether it is consists of alphabet or digits.
| ||||||||||
| static boolean |
isValidXML(String str)
Equivalent to
parseValidateXML(String, DefaultHandler) with null for the DefaultHandler parameter. | ||||||||||
| static String |
loadXMLFile(String name)
Load XML from a file.
| ||||||||||
| static String |
nodeValue(Node contextNode)
This method returns the "naive" node value of a node, that is, the concatenation of
node values from all its child nodes.
| ||||||||||
| static boolean |
parseValidateXML(String str, DefaultHandler handler)
Returns whether the given string is valid XML.
| ||||||||||
| static String |
processElement(int level, Node objXmlElem)
ProcessElement method returns a string with tabs and newlines inserted in the appropriate spots.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
This method compares two Node instances (including all their attributes and children) and
returns a string with the differences between them.
If the nodes are equal, it returns null.
| base | The base node to compare. |
|---|---|
| other | The other node to compare. |
| ignoreTextNodes | if true, this method only compare Element child nodes, that
is, all text nodes are ignored. |
null if equal.Replaces HTML unfriendly characters with their escaped equivalents. Used to store XML string inside hidden input fields or other HTML attribute
| strToEncode | the source string to encode. |
|---|
Given a String containing markup, escape the markup so it can be put into xml as normal text.
| s | String to escape |
|---|
This constructs a nicely formatted XML document, typically used for printing in a user readable format.
| xmlIn | The xml string to be formatted. |
|---|
| XMLSupportException | Signals an error when format the XML. |
|---|
Check whether the string is a valid GUID
| str | string to check |
|---|
Check whether the string is a valid Nodekey, a loose check on whether it is consists of alphabet or digits.
| str | string to check |
|---|
Equivalent to parseValidateXML(String, DefaultHandler) with null for the DefaultHandler parameter.
| str | string to check |
|---|
Load XML from a file.
| name | The path to the file. |
|---|
| IOException | When error occurs during retrieving the XML from the file. |
|---|
This method returns the "naive" node value of a node, that is, the concatenation of node values from all its child nodes.
Returns whether the given string is valid XML. The supplied parser is also used to parse the string.
| str | string to check |
|---|---|
| handler | handler attempt parsing with, if null, an empty DefaultHandler is used |
ProcessElement method returns a string with tabs and newlines inserted in the appropriate spots.
| level | int, level from which we want to process |
|---|---|
| objXmlElem | Node, node we want to process |
| XMLSupportException | Signals an error when parsing the XML. |
|---|