Re: DOM vs GVT tree info

Martin J <[email protected]>
Newsgroups gmane.text.xml.batik.user
Message-ID <CADpEmNmAiC2-YsoZVJ46sXqaRj_mjwWO_Qjdyn3P3amZto15sA@mail.gmail.com>
Hi Zainab,

I'm guessing that you want to do what I needed to do: find the
bounding box of each symbol as rendered. My code traversed the DOM,
and when it found an element that was a <use>, it stored the bounding
box, as follows:

Element el;
// ...
String elementTag = el.getNodeName();
SVGRect bb = null;
if (elementTag.equals("use"))
{
	bb = ((SVGOMUseElement) el).getBBox();
	// ...
}

Does this help?

Martin

On 25 September 2011 16:33, Zainab AlMeraj <[email protected]> wrote:
> Hi,
>
> I am a newbie to Batik. I came to it with an task in mind and thought it
> would solve my problems. But it turns out it might be more complicated to do
> than I expect.
>
> I want to read in a .svg that extensively uses <symbol> and <use> tags.
> This information is fairly accessible from the DOM but I loose all the
> geometry
> that exists.
> Using GVT on the other hand gives me all the geometry but without the
> original
> tag information.
>
> So it goes one step too far for what I am in need off.
>
>
> My pitch is to ask whether anyone has worked on this before, or suggested
> that
> it be implemented but wasn't.
> In the archives I have not come across any as of yet (still looking through
> them).
>
> If there is no way to grab this info I may be willing to code it and submit
> my
> stuff.
>
> Any guidance or help is appreciated.
>
> Also forgive me for being too explicit or not explicit enough.
>
> Thanks,
>
> Zainab
>



-- 
From my MacBook Pro
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.