How can I get the UseElement of trancoded SVG?

<[email protected]>
Newsgroups gmane.text.xml.batik.user
Message-ID <0E4D0F7AD75E694985E184D6A869BE4E158F4B94ED@GBLONZ-PMSGEM02.emrsn.org>
Hello all,

I`ve got a problem to obtain the original "use"-element of a dynamically generated SVG. E. g. my program creates a SVG containing this fragment:

<g transform="rotate(0,0,0) translate(0,0)">
<use xlink:href="file:/C:/dummy/MyFirstSVG.SVG#E3" x="0" y="0"/>
     <g transform="translate(8,32) rotate(0,0,0)">
          <use xlink:href="file:/C:/dummy/MySecondSVG.SVG#E3" x="0" y="0"/>
     </g>
</g>

This SVG then is transcoded and painted in a BridgeContext. When "painting" via the "convertFillAndStroke"-method of my batik.bridge.PainServer-implementation I need some information of the original UseElement, but asking for

Element elem = (Element)((SVGOMUseShadowRoot)myNode).getCSSParentNode();

and then

String value = elem.getAttributeNS(XMLConstants.XLINK_NAMESPACE_URI, "href");

delivers the embedded contents of the referenced SVG parts.

When debugging, I can see the original content somewhere in the deep of the DOM (myNode -> ownerDocument -> referent -> (several childNodes) -> SVGOMUseElement -> attributes -> "href" -> GenericAttrNS -> "file:/C:/dummy/MyFirstSVG.SVG#E3"), but how can I get it programmatically?
I need the "MyFirstSVG#E3" or "MySecondSVG#E3" from the original UseElements, but what I get is the embedded content of the referenced "MyFirstSVG.SVG", "MySecondSVG.SVG"

Thank you very much for your help.

Kind regards


Michael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.