Hi Paramod,
Pramod Kalapa wrote:
Here's what I am trying to accomplish:
On mouseclicking on a node element rendered in the
JSVGCanvas, I would like to extract the associated
URL/URI attribute (if any) before it is actually
loaded into the canvas.
Well the UserAgent class get's asked to accept or
reject all URL's before they are loaded, but see below.
I am trying to use this attribute to store information
other than a loadable URL/URI to use to lauch other
applications. Unless there is a better way to do this
i.e to encode some non displayed information that I
can easly access on clicking a displayed node that can be
ingnored/bypassed by the Batik framework ?
This is _exactly_ what XML namespaces are for. So
you can define your own namespace on the root of the document:
xmlns:kalapa="http://kalapa.com/paramod"
Then on your 'clickable' elements simply has a custom
attribute:
<rect ... kalapa:app="foo bar"/>
Register an onclick handler with the root element and
then just check if 'getTarget()' has your custom attribute:
e.getAttribteNS("http://kalapa.com/paramod", "app")
Anything that is in a custom namespace will be ignored by
Batik (and any other conformant SVG renderer).
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]