XMLQuery

XMLQuery

The following methods are available on an XMLQuery object:

firstChild

Returns the first child node.

xml.firstChild()

lastChild

Returns the last child node.

xml.lastChild()

name

Returns the name of a node.

xml.firstChild().name()

val

Returns the value of a node.

xml.firstChild().val()

children

Returns a list of child nodes.

xml.children()

attr

Returns a dictionary of attributes.

xml.firstChild().attr('title')

childNamed(name)

Returns a child node whose name is name.

xml.childNamed('My item')

childrenNamed(name)

Returns all child nodes whose name is name.

xml.childrenNamed('An item')

childWithAttribute(name, value)

Returns all child nodes with an attribute named name which has a value of value.

xml.childWithAttribute('title', 'My item')

descendantWithPath(path)

Returns a single node whose path matches path.

xml.descendantWithPath('feed.items.item')

valueWithPath(path)

Returns the node value or attribute value that matches path.

xml.valueWithPath('feed.items.item')

xml.valueWithPath('feed.items.item@title')
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.