xmlNode[] xmlTreeGetChildren(xmlNode parent [, string name
                               [, string ns_URI]])


  • element - the element to get the children from

  • name (optional) - only get children with the specified local name. If not specified, all children are returned.

  • ns_URI (optional) - limit result to the children in the namespace ns_URI. If not specified, namespace is ignored.


  • the xmlNode children of the element parent

xmlTreeGetChildren() returns the children of the element parent, which includes elements, comments, CDATA, etc.

If you only want certain elements, you can specify a name parameter to only get elements named name.

Additionally, if no ns_URI is specified, then the namespace prefix/URIs are disregarded and only local names are compared. If a ns_URI is provided, only an attribute that matches a name and the namespace URI will be returned. This includes the empty namespace; if you pass in a ns_URI as '', then only the attribute matching that name and without a namespace will be returned.


<$children = (xmlTreeGetChildren($parent, 'item'))>

xmlTreeGetFirstChild, xmlTreeGetNext, xmlTreeGetPrevious, xmlTreeGetParent, xmlTreeGetChildrenContent

Copyright © Thunderstone Software     Last updated: Oct 24 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.