I need help with one problem.
I have an Element called e.g. myElement
. I have also some strings and elements (generally nodes), which I want to add as myElement's children (all of the same level). My idea looks like this piece of code:
DivElement div1=new DivElement();
// ... some parameters of div1
String string1="Hello";
DivElement div2=new DivElement();
// ... some parameters of div2
String string2="World!";
DivElement myElement=new DivElement();
myElement.nodes.addAll([div1,string1,div2,string2]);
But this don't work, because Strings are not Nodes. How could I make a Node from a String?