2009/1/29 Dan Slater <[email protected]>: > Hi, Age, > > Never mind the filter. This will get you where you want to go...supply your > click target, and modify it to break at the use element - you'll see you can > access the id: > > public static SVGElement returnNextDOMEltUp(SVGElement svgElt) { > Node n = svgElt; > String name = "start"; > > while (!name.equals("g")) { > if (n instanceof SVGOMCSSImportedElementRoot){ > n=((SVGOMCSSImportedElementRoot)n).getCSSParentElement(); > } else { > n = n.getParentNode(); > if (n instanceof SVGOMDocument) return null; > } > if (n instanceof SVGElement) { > showIdAndNodeName(n); > } > name = n.getNodeName(); > } > if (n instanceof SVGElement) { > svgElt = (SVGElement)n; > } else svgElt = null; > return svgElt; > } >
Thanks for helping out Dan. I never expected it to require such trickery but if it works it works. There's one problem with the method you provided though. You are using the 'SVGOMCSSImportedElementRoot' class but this one isn't part of batik at all? As far as I have been able to determine it was included in version 1.5.1 but it has been removed in a later release for some reason. Is there a replacement of some sort available? Yours, Age --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
