Setting Information

There are relatively fewer functions fore setting data, reflecting the fact that the only real data stored in the nodes are name and content.

Once again xmlNs get their own versions for the prefix and URI.


EXAMPLE

<capture>
<rootNode><name>John Doe</name><age>34</age></rootNode>
</capture><$xmlRaw = $ret>
<$doc = (xmlTreeNewDocFromString( $xmlRaw, 'XML_PARSE_NOBLANKS'))>
<$root = (xmlTreeGetRootElement($doc))>
<$name = (xmlTreeGetChildren($root, 'name'))>
<$ret = (xmlTreeSetName($name, 'target'))>
<$ret = (xmlTreeSetContent($name, 'Jane Doe'))>
<$output = (xmlTreePrintDoc($doc, 'INDENT'))>
output is $output


SEE ALSO
xmlTreeSetName, xmlTreeSetContent, xmlTreeAddContent, xmlTreeSetNsPrefix, xmlTreeSetNsURI


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