Hi Alessandro,
Well you basically can't do what you want to the way you want. We don't give access to the document at that level. However you can register an onload event listener and walk the tree there yourself.
If you were willing to switch to using a 'sub element' to indicate that the listener should be attached (a bit like animation is currently done) then you could use getElementsByTagNameNS to find your child elements (of course right now it just walks the tree like you would, eventually we may build hashes of this info).
You could also conceivably subclass SAXSVGDocumentFactory and parse the document yourself. Then just give the parsed document to the canvas with 'setSVGDocument(SVGDocument doc)'.
Alessandro Di Bella wrote:
I'm new to BATIK and I'm try to do the following...
I have an SVG like:
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:myns="........">
<g myns:type="mytype" ...../>
.................
</svg>
As you can see I defined a different namespace (myns) that allows me to specify the custom attribute "myns:type".
The purpose of this is that I would like to intercept the creation of the GVT object built form the <g> element and based on the value of
"myns:type" I want attach different listeners to it.
I could not find any ContainerListerer-like class to register with the JSVGCanvas so I thought that I could alternatively use a SAXFilter to intercept the
SAX events so that I can grab the IDs of the elements I am interested in.
Once i know the IDs I can get the components from the SVGDocument, but even like this I cannot see how to specify the DocumentHanlder when the SVG is loaded.
Any help wold be greatly appreciated.
Thanks
Alessandro
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
