SYNOPSISstring[] xmlTreeGetChildrenContent(xmlNode parent, string name
[, string ns_URI])
Parameters:
parent
- the element to get the children's content fromname
- the local name of the child elements to get content fromns_URI
(optional) - limit result to the children in
the namespace ns_URI
. If not specified, namespace is ignored.
Returns:
DESCRIPTIONxmlTreeGetChildrenContent()
provides an easy way to read
"config" XML data, where a node has many element children. Rather
than getting each child element and getting their content,
xmlTreeGetChildrenContent()
allows you to do it in one call. If
there are multiple name
child elements, then multiple strings
are returned.
The call
<$content = (xmlTreeGetChildrenContent($node, 'item'))>
is essentially a shortcut for the following:
<$tmp = (xmlTreeGetChildren($node, 'item'))>
<loop $tmp>
<$ret = (xmlTreeGetAllContent($tmp))>
<$content = $content $ret>
</loop>
See the xmlTree02_Get
sample script for examples of using
xmlTreeGetChildrenContent()
.
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 elements that match the 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.
EXAMPLE<$content = (xmlTreeGetChildrenContent($parent, 'item'))>
SEE ALSOxmlTreeDumpNode
,
xmlTreeGetAllContent
,
xmlTreeGetContent
xmlTreeGetFirstChild
,
xmlTreeGetNext
,
xmlTreeGetPrevious
,
xmlTreeGetParent