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.bodytext()

Generate the text representation of the XML subtree. ADVANCED.

Syntax

string = XmlParser.bodytext()

Parameters

The 'XmlParser.bodytext' method takes no parameters

Results

The 'XmlParser.bodytext' 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 children of the object. That is it will not include the enclosing text of the tag itself. Compare this with the behaviour of the text() method. Suppose we have the following XML:

<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. The string returned from tags.bodytext() would be:

<ul>
   <li>First
   <li>Secind
   <li>Third
   <li>Fourth
</ul>

contrast this with the behaviour of XmlTag.text(), which would return the entire source.

You can call 'tag.bodytext' 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.execute(). 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 : 20ms)