xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Hillion <shill...@ilog.fr>
Subject Re: Obtain a SVGTextElement from a SVGDocument
Date Mon, 10 Sep 2001 06:22:16 GMT
On Thursday 06 September 2001 17:57, Albert Valls wrote:
> 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??
>

No, it should work. I suspect your documents do not have <!DOCTYPE svg ...> 
declarations because the elements are not in the SVG namespace.
BTW use getElementsByTagNameNS() instead of getElementsByTagName() or the 
returned list will be empty.
--
  Stephane.

---------------------------------------------------------------------
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