System Template
buildxml()
Build an XML tree from XML source code. DEPRECATED!!.
See Also
<rb:macrotag...>, <rb:script...>, rb.page.tagtree, XML Tutorial, Processing XML Data Syntax
void = rb.page.buildxml(xmlSource, nodeid, childrenOnly)
Parameters
The 'buildxml' method takes 3 parameters:
Name | Type/Value | Range/Length | Description | xmlSource | string | | Required.
XML source code from which to build an XML tree. This is a string containing XML
source code.
| nodeid | string | | Optional.
If this parameter is specified the parser will return a subtree from the source
code provided. The parameter is the name of the tag required.
By default the presentation engine uses the entire tree. | childrenOnly | bool | | Optional.
This flag tells the Presentation Engine whether to include the specified node and its
children - or just its children. If this is flag is present and true then only the child
tags are include.
The default value is 'true'. |
Results
The 'buildxml' method returns no useful information.
Remarks This method has now been DEPRECATED in favour of the new XML API. This method provides a means of compiling an XML tree or subtree from a literal string. Obviously
that string can have been read from a file (into a binary object) or may have been retrieved from
one of the templates. Alternatively the XML may have been generated by an external application,
such as an existing client application exporting data, and the Pattern Page could be
responsible for the translation into the Whitebeam system. The method takes the source XML string provided in it's first parameter and runs it through the
XML interpreter to build a tree. From the resulting tree the method selects the required sub-tree,
according to the 'nodeid' and 'childrenOnly' parameters. Having selected the required portion of the tree, the method attaches that subtree to the
currently executing tag. So, if for example the the rb.page.buildxml() method is called
from within an rb:script the resulting
XML tags will become the next available child indices of the rb:script tag. - The XML is parsed effectively using the same parser and parse rules as the
XML page being executed. So the page will have all the HTML rules, will be case
insensitive etc as a normal XML page.
- The tag tree is constructed, but not executed! If you want to
run the subtree using the Presentation Engine you need to get the xmltag object that
represents the tree using
tagtree, then invoke the
regenerate
method on that object.
- If you choose to regenerate the tree then the Presentation Engine executes all it's known
handlers for each of the tags in the tree - just as it would for the original page. This
provides a very powerful way of processing the XML data by defining
rb:macrotag implementations
for some of the key elements in the tag tree.
|