Whitebeam Object Definition

Site Map
Application Guide
  XML Markup
  JavaScript Classes
  Dev Process
  External Links
  Example libraries
Contact Whitebeam
Whitebeam Users

Whitebeam Object Definition

XmlGeneric Object Description

Elements in the XML tree are represented by a number of separate classes, the most common of which are XmlTag and XmlText. The Each of these specific classes share a lot of commonoality and this is documented as a 'virtual' class - XmlGeneric. It is effectively the base - or super class of each of the specific element types.


XmlGeneric.select() Execute an XPath 1.0 exression
XmlGeneric.xpath() Execute an XPath 1.0 exression
XmlGeneric.clean() Discard generated output from this element
XmlGeneric.execute() Re-execute part of an XML tag tree. ADVANCED.
XmlGeneric.toString() Return string equivalent of sub-tree
XmlGeneric.moveTo() Move XML element to a parent
XmlGeneric.destroy() Destructor

Object Properties

Name Type/Value Range/Length Description
parentstruct XmlGeneric.XmlTagsee definition Required. A reference to the XmlTag that is the parent of this XmlTag. The only element not to have a parent is the root tag in the parser (parser.root).
typestring  Required.

A textual name for the element represented by this JavaScript object. Allows the underlying code to tell whether a child of a tag is another tag, a text element or a comment etc. The possible values for this property are:

ValueInstance of...

You can also distinguish the type of the element using the 'instanceof' JavaScript operation.

textstring  Required. For XmlText, XmlComment, XmlCData and XmlPi classes the 'text' property contains the raw text for that element. This value can be changed. Note though that the changes are not reflected in the generated output from an element util it is next executed.
rb$tagidnumber  Required. Every XML element is allocated a numeric unique identifier within the page execution. This value is not usually required, however it can be used to test two elements to see whether they are in fact the same element.
existsbool  Required.

This property returns 'true' if the JavaScript object currently maps down to an underlying XML tree object (a tag, comment, text element etc). This property is useful when manipulating XML trees because attempting operations on objects that no longer map to an XML element will throw an error.

Example: if you delete a tag in an XML tree and have another JavaScript object the references one of the children of that tag then the child element will cease to reference an object when the parent is deleted.

Available from version : 1.3.27

lineNumbernumber  Required. Return the line number in the source XML tree where the parser found this element. Useful, for example, where you want to evaluate some embedded script within an XML document and you want to pass the line number to the rb.page.eval function.

Available from version : 1.3.27

Whitebeam release 1.3.36
(loadtime : 33ms)