lz.DataElement
A node of hierarchical data.

JavaScript: lz.DataElement
extends lz.DataNode » lz.Eventable »

An lz.DataElement represents a node a in a hierarchical dataset. An lz.DataElement can contain other lz.DataElements, or lz.DataText, which represents a text node. See the example on lz.DataNodeMixin.

Attributes inherited from lz.DataElementMixin

attributes, nodeName

Class Attributes

Name (CSS property) Type (tag) Type (js) Default Category
DOCUMENT_NODE   int 9 readonly
  constant for LZX DOM document root node type
ELEMENT_NODE   int 1 readonly
  constant for LZX DOM data element node type
TEXT_NODE   int 3 readonly
  constant for LZX DOM data text node type

Methods

LzDataElement()
lz.DataElement.LzDataElement(name : String, attributes : Object, children : [lz.DataNodeMixin]);
This object represents a hierarchical data node.
Parameter Name Type Description
name String The name for this node.
attributes Object A optional dictionary of attributes for this node.
children [lz.DataNodeMixin] An optional array of children for this node

Methods inherited from lz.Eventable

destroy, setAttribute

Class Methods

makeNodeList()
lz.DataElement.makeNodeList(count : int, name : String);
Returns a list of empty nodes, each named 'name'.
Parameter Name Type Description
count int how many nodes to create.
name String the name for each node
Returns Type Description
  Array list of new nodes.

stringToLzData()
lz.DataElement.stringToLzData(str : String, trimwhitespace : boolean, nsprefix : boolean);
Converts string to XML data.
Parameter Name Type Description
str String A valid string of XML. If the string is simple text, or that there isn't a single root element, this function returns null. In cases where the string is an invalid but well formatted snippet of XML, this function will close any tags to make for a valid XML document
trimwhitespace boolean if true, text nodes have whitespace trimmed from start and end.
nsprefix boolean if true, preserve namespace prefixes on node names and attribute names.
Returns Type Description
  lz.DataElement An LzDataElement which is the top of the hierarchy generated from the string

valueToElement()
lz.DataElement.valueToElement(o);
Get LzDataElement representation of primitive type, array, or object value.
Parameter Name Type Description
o    

Events

Events inherited from lz.Eventable

ondestroy