Property

NAME_SPACE

static

Namespace for Blockly's XML.

Methods

createElement

public   static

createElement(tagName) returns Element

Create DOM element for XML.

Parameter

tagName

string

Name of DOM element.

Returns

non-null Element New DOM element.

createTextNode

public   static

createTextNode(text) returns Node

Create text element for XML.

Parameter

text

string

Text content.

Returns

non-null Node New DOM node.

domToText

public   static

domToText(dom) returns string

Converts a DOM structure into plain text. Currently the text format is fairly ugly: all one line with no whitespace.

Parameter

dom

Element

A tree of XML elements.

Value must not be null.

Returns

string Text representation.

textToDomDocument

public   static

textToDomDocument(text) returns Document

Converts an XML string into a DOM tree. This method will be overridden in the Node.js build of Blockly. See gulpfile.js, blockly_javascript_en task.

Parameter

text

string

XML string.

Throws

if XML doesn't parse.

Returns

Document The DOM document.