Hi Christoph,
Scheit Christoph wrote:
I want to create child-nodes for an element, let’s say a rectangle.
Rectangles can't have child graphics nodes. Mostly just
'g', 'svg' and 'symbol' elements can have child graphics nodes.
1) elem.appendChild(rect);
// rect is the new, elem an already exising rectangle
You might try:
elem.getParentNode().appendChild(rect);
This will make the new rect a sibling of 'elem'.
You can also use:
elem.getParentNode().insertBefore(rect, elem.getNextSibling());
To make sure rect is the very next sibling of elem.
If I just add it to the root element
2) svgDoc.getDocumentElement().appendChild(rect);
it works (but they are not children, what I want to have since they are
logically related in the application).
Is there any possibility to do it like in example 1) ??
I think you really want them to be siblings not parent child.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]