Closed kbruneel closed 5 years ago
Hi! I`ve tried headless mode in a browser and it works fine for me. https://codesandbox.io/s/bri2g
Could you attach your xml string?
It indeed depends on the xml:
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="j:|seQ!Cb:h%]r.Nv:%Y">left_sensor</variable>
<variable type="" id="FJ]G9nydQGLnneo:ZbqE">right_sensor</variable>
<variable type="" id="u?-rKl3vhHz+uDeW^7P|">speed</variable>
<variable type="" id="G0Chi5P*a^O=e,BqIQOa">engineTorque</variable>
<variable type="" id="_EjEfOO,oBya{dHE*8os">breakingTorque</variable>
<variable type="" id="(J~4Dn0U.UWbd8EOTxb_">steeringAngle</variable>
</variables>
<block type="procedures_defreturn" id="Yl60#PO2|*uWo/.!BTri" x="22" y="17">
<mutation>
<arg name="left_sensor" varid="j:|seQ!Cb:h%]r.Nv:%Y"></arg>
<arg name="right_sensor" varid="FJ]G9nydQGLnneo:ZbqE"></arg>
<arg name="speed" varid="u?-rKl3vhHz+uDeW^7P|"></arg>
</mutation>
<field name="NAME">control</field>
<comment pinned="false" h="80" w="160">Describe this function...</comment>
<statement name="STACK">
<block type="variables_set" id="O]OFir;j96=k,9,RK.s#">
<field name="VAR" id="G0Chi5P*a^O=e,BqIQOa" variabletype="">engineTorque</field>
<value name="VALUE">
<block type="math_number" id="g-NlG|U!heP1m+5As`/4">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="variables_set" id="=/@aA6R=aBsQf:piGb`6">
<field name="VAR" id="_EjEfOO,oBya{dHE*8os" variabletype="">breakingTorque</field>
<value name="VALUE">
<block type="math_number" id="B}7$u)csO]L0VC?+HueC">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="variables_set" id="[?y0jg4n7`)tOpm_yVa:">
<field name="VAR" id="(J~4Dn0U.UWbd8EOTxb_" variabletype="">steeringAngle</field>
<value name="VALUE">
<block type="math_number" id="^VH5^TrMjwGZ+y]@[/8Z">
<field name="NUM">0</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="RETURN">
<block type="lists_create_with" id="027yG)#OYYGcKX0|@NI4">
<mutation items="3"></mutation>
<value name="ADD0">
<block type="variables_get" id="iFM]Ho}p0py|QqEAi?/u">
<field name="VAR" id="G0Chi5P*a^O=e,BqIQOa" variabletype="">engineTorque</field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="=sJ.^7rxVo/acsD3KGu8">
<field name="VAR" id="_EjEfOO,oBya{dHE*8os" variabletype="">breakingTorque</field>
</block>
</value>
<value name="ADD2">
<block type="variables_get" id=":![`-}#*aHZA{$IW+utl">
<field name="VAR" id="(J~4Dn0U.UWbd8EOTxb_" variabletype="">steeringAngle</field>
</block>
</value>
</block>
</value>
</block>
</xml>
I think this is related to: https://github.com/google/blockly/issues/2575
Please try latest 1.0.40
version
Hi,
I'm trying to translate xml string to a javascript string in the browser but I don't have a visual workspace. I'm trying to use the code from the README except that I require the browser version on node-blockly. This is the essential part of my code:
If I do this I get the following error:
Which method would you recommend to go from an xml string to a javascript string in the browser?
Many thanks!