Getting Information

There are functions for getting information about a node, such as name and content. xmlNode's all use the same functions, whether they're elements, attributes, comments, etc.

xmlNs objects are different in that they have a prefix and URI instead of name and content. They have their own functions to reflect this.


<rootNode><name>John Doe</name><age>34</age></rootNode>
</capture><$xmlRaw = $ret>
<$doc = (xmlTreeNewDocFromString( $xmlRaw))>
<$root = (xmlTreeGetRootElement($doc))>
<$name = (xmlTreeGetName($root))>
<$type = (xmlTreeGetType($root))>
<$nameText = (xmlTreeGetChildrenContent($root, 'name'))>
The root $name's type is $type, name's text is $nameText

xmlTreeDumpNode, xmlTreeGetName, xmlTreeGetChildrenContent, xmlTreeGetContent, xmlTreeGetAllContent, xmlTreeGetLine, xmlTreeGetType, xmlTreeIsBlankNode, xmlTreeGetAttributeContent, xmlTreeGetNsURI, xmlTreeGetNsPrefix

Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.