xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Valls" <ava...@ngeografics.com>
Subject Re: Obtain a SVGTextElement from a SVGDocument
Date Thu, 06 Sep 2001 15:57:43 GMT
The problem is not setting the attributes, the problem is how to obtain an
object of the class SVGOMTextElement.

To Stephane Hillion: The file is loaded with this code:

   DocumentBuilder builder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
   factory.setNamespaceAware(true);
   builder = factory.newDocumentBuilder();
   java.io.File file = new java.io.File(path);
   Document docTemp = builder.parse(file);
   DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
   Document doc=
(SVGOMDocument)DOMUtilities.deepCloneDocument(docTemp,impl);

Do you think here is the problem??

thank's

Albert
----- Original Message -----
From: "Stephane Hillion" <shillion@ilog.fr>
To: "Batik Users" <batik-users@xml.apache.org>
Sent: Thursday, September 06, 2001 4:03 PM
Subject: Re: Obtain a SVGTextElement from a SVGDocument


> On Thursday 06 September 2001 15:48, Albert Valls wrote:
> > 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++;
> >     }
>
> This kind of problems can happen if you build your document using
something
> else that the
org.apache.batik.dom.svg.SVGDOMImplementation.createDocument().
> --
>   Stephane.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message