xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcelo Gilman <marcelogil...@yahoo.com.ar>
Subject Problems managing application-dependent attributes
Date Wed, 06 Aug 2003 14:52:29 GMT
Hi all, 
I am new using Batik so may be the my problem has a trivial solution, sorry if it is the case.
 I need to insert some application-dependent attributes as for example:
    <rect x="10" y="20" width="100" height="50"/>
In order to insert the new properties I simply do the following:
SVGElement rectangle = (SVGElement) doc.createElementNS(svgNS, "rect");
rectangle.setAttributeNS(null, "x", "10");
rectangle.setAttributeNS(null, "y", "20");
rectangle.setAttributeNS(null, "width", "100");
rectangle.setAttributeNS(null, "height", "50");
Element myProps = doc.createElement("myProps");
myProps.setAttribute("a", "147");
but I then have problems when trying to read it because I get the following exception:
org.w3c.dom.DOMException: The current document is unable to create an element of the requested
type (namespace: http://www.w3.org/2000/svg, name: myProps).

I guess it is because I need to add the new definition to but it is not clear to me which
is the proper way to do it using Batik. 
I would also need to listen for the svg-document reading process not at the begining,or the
end as allows the SVGDocumentLoaderListener but for each read element.
I would appreciate any help.
Thanks a lot, 

Internet GRATIS es Yahoo! Conexión.
Usuario: yahoo; contraseña: yahoo
Desde Buenos Aires: 4004-1010
Más ciudades: clic aquí.
View raw message