Stay organized with collections
Save and categorize content based on your preferences.
blockly > Xml > domToWorkspace
Xml.domToWorkspace() function
Decode an XML DOM and create blocks on the workspace.
Signature:
export declare function domToWorkspace(xml: Element, workspace: Workspace): string[];
Parameters
Parameter |
Type |
Description |
xml |
Element |
XML DOM. |
workspace |
Workspace |
The workspace. |
Returns:
string[]
An array containing new block IDs.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003edomToWorkspace\u003c/code\u003e function decodes an XML DOM and creates corresponding blocks on a specified Blockly workspace.\u003c/p\u003e\n"],["\u003cp\u003eThis function accepts an XML DOM element and a Blockly workspace as input.\u003c/p\u003e\n"],["\u003cp\u003eIt returns an array containing the IDs of the newly created blocks.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [Xml](./blockly.xml_namespace.md) \\\u003e [domToWorkspace](./blockly.xml_namespace.domtoworkspace_1_function.md)\n\nXml.domToWorkspace() function\n-----------------------------\n\nDecode an XML DOM and create blocks on the workspace.\n\n**Signature:** \n\n export declare function domToWorkspace(xml: Element, workspace: Workspace): string[];\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|-------------------------------------------|----------------|\n| xml | Element | XML DOM. |\n| workspace | [Workspace](./blockly.workspace_class.md) | The workspace. |\n\n**Returns:**\n\nstring\\[\\]\n\nAn array containing new block IDs."]]