Skip to main content

Home > blockly > Xml > blockToDomWithXY

Xml.blockToDomWithXY() function

Encode a block subtree as XML with XY coordinates.

Signature:

export declare function blockToDomWithXY(block: Block, opt_noId?: boolean): Element | DocumentFragment;

Parameters

ParameterTypeDescription
blockBlockThe root block to encode.
opt_noIdboolean(Optional) True if the encoder should skip the block ID.

Returns:

Element | DocumentFragment

Tree of XML elements or an empty document fragment if the block was an insertion marker.