TextToDom is not a function

734 views
Skip to first unread message

Bart Butenaers

unread,
Sep 9, 2023, 4:58:36 PM9/9/23
to Blockly
Hi everybody,

In my old application, I loaded a xml string into a workspace like this:

                var dom = Blockly.Xml.textToDom(workspaceXml);
                Blockly.Xml.domToWorkspace(dom, my_workspace);


However when I run this in the latest Blockly version, I get the error "Blockly.Xml.textToDom is not a function".

It looks like all the other functions in this class require a dom input parameter:

textToDom.png
So I am not sure whether textToDom has been moved to some other class, or do I need to use another approach to create a dom from the xml?

Thanks!!
Bart

Neil Fraser

unread,
Sep 10, 2023, 1:41:58 AM9/10/23
to blo...@googlegroups.com
It appears that Blockly.Xml.textToDom was relocated to Blockly.utils.xml.textToDom:
Apparently this breaking change was done to resolve a circular dependency.

Does this work for you?

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/a0a781e7-70c6-49b8-b257-fdecc6562155n%40googlegroups.com.


--
Neil Fraser, Switzerland
https://neil.fraser.name

Bart Butenaers

unread,
Sep 10, 2023, 3:24:33 PM9/10/23
to Blockly
Hi Neil,

That works like a charm.   Thanks a lot!!

Bart
Reply all
Reply to author
Forward
0 new messages