hi,

  Another way of doing it might be to use the 'metadata' element.  For example:

      <g id="someGroup">

            <metadata>

                <abins:groupprops xmlns:abins="http://blah.blah.com">

                    <abins:segProps segStart="1000" segEnd="1099"/>

                </abins:groupprops>

            </metadata>

            <text x="103" font-size="8" y="60" font-weight="bold" font-family="Lucida Console">sometext</text>

      </g>

 

see also the w3 specs: http://www.w3.org/TR/SVG/metadata.html

 

-randy

 

 

 

-----Original Message-----
From: Marcelo Gilman [mailto:[EMAIL PROTECTED]]
Sent
:
Wednesday, August 06, 2003 4:52 PM
To: Batik Users
Subject: Problems managing application-dependent attributes

 

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:

 

<svg>

    <rect x="10" y="20" width="100" height="50"/>

        <myProps>

             <a>147</a>

        </myProps>

    </rect>

</svg>

 

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");

svgRoot.appendChild(rectangle);

Element myProps = doc.createElement("myProps");

myProps.setAttribute("a", "147");

rectangle.appendChild(myProps);

 

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,

Marcelo.

 

 

 


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

Reply via email to