I need a SVGTextElement or it's implementing class SVGOMTextElement in witch
are many methods I need to manipulate the position of the text. (I know many
of them are not already implemented). One of the methods is the getBBox()
for example.
This is my code:
NodeList list = svgRoot.getElementsByTagName("text");
int listLength = list.getLength();
int i = 0;
while ( i < listLength ) {
Node aux = list.item(i);
....
....
SVGOMTextElement textE = (SVGOMTextElement)list.item(i);
<<< Here is the problem
....
i++;
}
thank's Dave.
Albert.
----- Original Message -----
From: "David Kane" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 3:17 PM
Subject: RE: Obtain a SVGTextElement from a SVGDocument
> Albert,
>
> What do you want to do with the node? There is very little in the
> SVGTextElement interface. But in general, you'll do something like the
> following:
>
> Nodelist n = document.getElementsByTagName("text");
> Element e = n.item(0);
>
> The element interface should give you visibility what I imagine you might
> need.
>
> Dave
>
>
> Albert wrote:
> >I parse a file getting a SVGDocument. I'm interested in treating the
> ><text> tags and to do so I use the method
> >getElementsByTagName("text"). The problem is that when I have one of
> >the nodes, I can't cast it to a SVGTextElement, it gives to me a
> >classCastException: org.apache.batik.dom.GenericElement.
> >What's wrong with what i'm doing ?
> >
> >Thanks.
>
> ---------------------------------------------------------
> David Kane [EMAIL PROTECTED]
> "What's Life?" http://www.houseofyin.com
> http://www.vraps.com
>
>
> ---------------------------------------------------------------------
> 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]