How do I do something similar to what the Image element does in SVG?  When you use Batik to create an Image element, it comes out like:

 

<image xmlns:xlink=”…”/>

 

I need to import attributes from another namespace in all my elements.  I add these elements like this:

 

Element.setAttributeNS(NS_URI, NS_ATTR, value);

 

However, I can’t retrieve these values at all (they come back as blank strings):

 

Element.getAttributeNS(NS_URI, NS_ATTR) or element.getAttribute(NS_ATTR);

 

I think I need an additional xmlns:ns declared, but how do you add one to an element?  The examples I can find online talk about creating the entire element in another namespace.  I want an SVG element with NS_URI attributes.

 

<rect xmlns:someOtherNamespace=”http://x.y.z/a x=”0” y=”0” w=”10” h=”10” someOtherNamespace:center=”5”/>

 

Michael Bishop

 

 

Reply via email to