Class XMLUtil
java.lang.Object
org.owasp.validator.html.util.XMLUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringHelper function for decode XML entities.static Stringstatic StringgetAttributeValue(Element ele, String attrName) Helper function for quickly retrieving an attribute from a given element.static booleangetBooleanValue(Element ele, String tagName) Helper function for quickly retrieving an boolean value of a given XML element.static booleangetBooleanValue(Element ele, String tagName, boolean defaultValue) Helper function for quickly retrieving an boolean value of a given XML element, with a default initialization value passed in a parameter.static intgetIntValue(Element ele, String tagName, int defaultValue) Helper function for quickly retrieving an integer value of a given XML element.static StringgetTextValue(Element ele, String tagName) Helper function for quickly retrieving a String value of a given XML element.
-
Constructor Details
-
XMLUtil
public XMLUtil()
-
-
Method Details
-
getAttributeValue
Helper function for quickly retrieving an attribute from a given element.- Parameters:
ele- The document element from which to pull the attribute value.attrName- The name of the attribute.- Returns:
- The value of the attribute contained within the element
-
getIntValue
Helper function for quickly retrieving an integer value of a given XML element.- Parameters:
ele- The document element from which to pull the integer value.tagName- The name of the node.defaultValue- The default int to return if the specified XML element cannot be found or parsed properly.- Returns:
- The integer value of the given node in the element passed in.
-
getTextValue
Helper function for quickly retrieving a String value of a given XML element.- Parameters:
ele- The document element from which to pull the String value.tagName- The name of the node.- Returns:
- The String value of the given node in the element passed in.
-
getBooleanValue
Helper function for quickly retrieving an boolean value of a given XML element.- Parameters:
ele- The document element from which to pull the boolean value.tagName- The name of the node.- Returns:
- The boolean value of the given node in the element passed in.
-
getBooleanValue
Helper function for quickly retrieving an boolean value of a given XML element, with a default initialization value passed in a parameter.- Parameters:
ele- The document element from which to pull the boolean value.tagName- The name of the node.defaultValue- The default value of the node if it's value can't be processed.- Returns:
- The boolean value of the given node in the element passed in.
-
decode
-
encode
-