(xmlVariables: Element, workspace: Workspace)
| 694 | * @param workspace The workspace to which the variable should be added. |
| 695 | */ |
| 696 | export function domToVariables(xmlVariables: Element, workspace: Workspace) { |
| 697 | for (let i = 0; i < xmlVariables.children.length; i++) { |
| 698 | const xmlChild = xmlVariables.children[i]; |
| 699 | const type = xmlChild.getAttribute('type'); |
| 700 | const id = xmlChild.getAttribute('id'); |
| 701 | const name = xmlChild.textContent; |
| 702 | |
| 703 | if (!name) return; |
| 704 | workspace.getVariableMap().createVariable(name, type ?? undefined, id); |
| 705 | } |
| 706 | } |
| 707 | |
| 708 | /** A mapping of nodeName to node for child nodes of xmlBlock. */ |
| 709 | interface childNodeTagMap { |
no test coverage detected