abstract class DomUtils
Convenience methods for working with the DOM API, in particular for working with DOM Nodes and DOM Elements.
Author
Juergen Hoeller
Author
Rob Harrop
Author
Costin Leau
Author
Arjen Poutsma
Author
Luke Taylor
Since
1.2
See Also
org.w3c.dom.Nodeorg.w3c.dom.Element
DomUtils()
Convenience methods for working with the DOM API, in particular for working with DOM Nodes and DOM Elements. |
open static fun createContentHandler(node: Node): ContentHandler
Returns a SAX |
|
open static fun getChildElementByTagName(ele: Element, childEleName: String): Element
Utility method that returns the first child element identified by its name. |
|
open static fun getChildElementValueByTagName(ele: Element, childEleName: String): String
Utility method that returns the first child element value identified by its name. |
|
open static fun getChildElements(ele: Element): MutableList<Element>
Retrieves all child elements of the given DOM element |
|
open static fun getChildElementsByTagName(ele: Element, vararg childEleNames: String): MutableList<Element>
Retrieves all child elements of the given DOM element that match any of the given element names. Only looks at the direct child level of the given element; do not go into further depth (in contrast to the DOM API's open static fun getChildElementsByTagName(ele: Element, childEleName: String): MutableList<Element>
Retrieves all child elements of the given DOM element that match the given element name. Only look at the direct child level of the given element; do not go into further depth (in contrast to the DOM API's |
|
open static fun getTextValue(valueEle: Element): String
Extracts the text value from the given DOM element, ignoring XML comments. Appends all CharacterData nodes and EntityReference nodes into a single String value, excluding Comment nodes. Only exposes actual user-specified text, no default values of any kind. |
|
open static fun nodeNameEquals(node: Node, desiredName: String): Boolean
Namespace-aware equals comparison. Returns |