Hi Yaroslav,
"Yaroslav Bulatov" <[EMAIL PROTECTED]> wrote on 08/30/2006 07:07:41 PM:
> I use Javascript to remove a child of "<g>" element and add it as a
> child of "<use>" element
Do you mean this literally? a 'use' element can't have
graphic children in SVG. Do you really mean that you add
it as a child of a 'used' element (probably a 'g' with id
or a 'symbol' element).
> oldNode.removeChild(node);
> newNode.insertBefore(node, newNode.firstChild);
>
> Inside Batik this seems to create a new DOM node which is not rooted
> in the existing DOM hiearchy (ie, not accessible through
> svgCanvas.getSVGDocument()). The old DOM node is not removed from the
> DOM hierarchy.
This is certainly not my experience with the Batik DOM.
I think I would have noticed by now if this was common behavior
in Batik. ;)
> The BridgeContext is updated correctly however, and it is possible to
> access the new node through BridgeContext.getElement(GraphicsNode).
Perhaps you are getting confused by the 'shadow copy' of the
used tree? When a 'use' element references a element. That element
and it's children are copied into a shadow tree (mostly so we can
do CSS inheritance from the use element).
> Is there a way to force Batik to update the DOM so that it is
> synchronized with the GraphicalNode hierarchy?
Well in Batik the GraphicsNodes are updated from
the DOM never the other way round. So if your 'nodes' above
are GraphicsNodes then you need to change them to be DOM
nodes (but I suspect that this is the case).
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]