Name

LzDataNode — The base class for a node of hierarchical data.

Synopsis

JavaScript: LzDataNode
Type: Class
Access: public
Topic: LFC.Data
Declared in: WEB-INF/lps/lfc/data/LzDataNode.lzs

Description

LzDataNode is the base class for the classes that represent OpenLaszlo's hierarchical data format.

 <canvas width="300" height="300">
   <simplelayout axis="y"/>
 
   <text width="300" height="250" bgcolor="silver" 
         multiline="true" name="display"/>
   <button>Make some data
     <attribute name="currentstep" value="0"/>
 
     <handler name="onclick">
       <![CDATA[ 
       switch(currentstep ++){
         case 0:
           this.n = 
           setAttribute('text', 'Add some children');
           break;
         case 1:
           for (var i = 1; i < 11 ; i++){
             
 
           }
           setAttribute('text', 'Add linebreaks');
           break;
         case 2:
           var dp = new LzDatapointer();
           dp.setPointer(this.n.getFirstChild());
           do {
             
           } while (dp.selectNext())
           dp.p.parentNode.appendChild(new LzDataText('\n')); 
           setAttribute('visible', false);
           break;
       }
       display.setText(display.escapeText(n.serialize()));
       ]]>
     </handler>
   </button>
 </canvas>
 

Superclass Chain

LzDataNode

Known Subclasses

Details

Static Properties (4)

DOCUMENT_NODE
static public var DOCUMENT_NODE = 9;
ELEMENT_NODE
static public var ELEMENT_NODE = 1;
TEXT_NODE
static public var TEXT_NODE = 3;
whitespaceChars
static public var whitespaceChars = { ... };

Static Methods (1)

stringToLzData()
static public function stringToLzData(str : String, trimwhitespace : boolean, nsprefix : boolean) : LzDataElement;
Converts string to XML data.

Properties (1)

nodeType
public abstract var nodeType : Number;
The type of this node -- ELEMENT_NODE or TEXT_NODE

Methods (4)

childOf()
public function childOf(el : LzDataElement, allowself : Boolean);
Tells whether the given node is above this one in the node hierarchy.
getNextSibling()
public function getNextSibling() : LzDataNode;
Returns the sibling after this one this node's parentNodes List of children
getPreviousSibling()
public function getPreviousSibling() : LzDataNode;
Returns the sibling before this one this node's parentNodes List of children
setOwnerDocument()
public function setOwnerDocument(ownerDoc : LzDataNode);
Sets the LzDataNode which is the ownerDocument for this node.

Events (1)

onownerDocument
public event onownerDocument;

JavaScript Synopsis

public LzDataNode {
  static public var DOCUMENT_NODE  = 9;
  static public var ELEMENT_NODE  = 1;
  static public function stringToLzData (str : String, trimwhitespace : boolean, nsprefix : boolean) : LzDataElement;
  static public var TEXT_NODE  = 3;
  static public var whitespaceChars  = { ... };
  public abstract var nodeType  : Number;
  prototype public function childOf (el : LzDataElement, allowself : Boolean);
  prototype public function getNextSibling () : LzDataNode;
  prototype public function getPreviousSibling () : LzDataNode;
  prototype public event onownerDocument ;
  prototype public function setOwnerDocument (ownerDoc : LzDataNode);
}