|
Whitebeam Template Reference Documentation
|
System Template
tagtree()
Create a JavaScript representation of an XML subtree. DEPRECATED.
See Also
<rb:macrotag...>, <rb:script...>, rb.page.buildxml, XML Tutorial (DEPRECATED), Processing XML Data Syntax
JavaScript Array = rb.page.tagtree(tag_id)
Parameters
The 'tagtree' method takes 1 parameter:
Name | Type/Value | Range/Length | Description | tag_id | string | | Optional.
Optional ID of an XML tag (named using the rb:id XML attribute)
|
Results
The 'tagtree' method returns JavaScript Array:
Type/Value | Range/Length | Description |
JavaScript Array |
  |
This method returns a JavaScript XmlTag object.
|
Remarks This method has now been DEPRECATED in favour of the new XML API. This method allows a JavaScript programmer access to the XML tree
structure of the source XML Pattern Page. The behaviour of the function
depends on the optional 'tag_id' parameter. There are three options:
Value | Interpretation |
---|
Parameter Absent | Returns the tag tree of the currently executing XML tag. To
see why this might be useful see below. | Empty String | Return the tag tree of the entire XML document - from the root. | String | Searches for a tag within he document that has the
specified ID. The ID is assigned to a tag using the rb:id
XML attribute. |
Note that the most comment use of this tag is in the implementation of
<rb:macro...>
tag. In this situation the function allows the JavaScript implementation of a tag to access the
structure of the tags within that structure. Building the tag tree of the currently executing tag is meaningless for an
<rb:script...> tag - it would simply return the JavaScript source
being executed. This mode of operating is aimed and the implementations of
<rb:macro...>
tags. The implementation, witten in JavaScript, can get the sub-tree and process
the contents to generate a output. This is very effective as a way of translating
from one base format (XML) to another format - such as Rich Text Format or
standard HTML. If you build a tag tree for the entire document the value returned will be a 'dummy'
tag that acts as a representation of the document. So for example in an HTML document the
top level contained will not have a name (a dummy) and the first child will be the <html>
tag Example See xmltag object for an example of this method. |
|
(loadtime : 95ms) |