Whitebeam Object Definition

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Object Definition

Method Description

XmlParser.text()

Generate the text representation of the XML subtree. ADVANCED.

Syntax

string = XmlParser.text()

Parameters

The 'XmlParser.text' method takes no parameters

Results

The 'XmlParser.text' method returns string:

Type/Value Range/Length Description
string   Return the text equivalent for the XML subtree.

Remarks

This method returns the currently accumulated text for the specified tag (i.e. that object on which this method is invoked). The result will be the text equivalent of the tag and all its children. Contrast this with the behaviour of XmlTag.bodytext(), which would NOT output the text for the node itself. Consider the following example:

<blockquote rb:id="node">
   <ul>
      <li>First
      <li>Secind
      <li>Third
      <li>Fourth
   </ul>
</blockquote>

And suppose we generate an XmlTag representation of this tree using rb.page.tagtree() as follows:

var tags = rb.page.tagtree("node");

'tags' now references the 'blockquote' tag. Calling tags.text() would generate the entire source text. contrast this with the behaviour of XmlTag.bodytext()(), which would return the entire source.

You can call 'tag.text' as often as you like and each time a string will be generated based on the last time the XML tree was executed. Note that the tree itself is only regenerated by calling tag.regenerate()(). If the tag only contains static HTML then this makes no difference. If on the otherhand the subtree contains active serv-side elements that to get the correct output based on the current environment requires that the tag tree is regenerated for each dataset.
Whitebeam release 1.3.36
(loadtime : 21ms)