On 5/23/07, Jeff Abernathy <[EMAIL PROTECTED]> wrote:
I'm having trouble inserting a "use" element into a Document. This is a basic drawing application that has a 
"stamp" tool, and for this stamp I'm using a group. When I try to append the use element to the document I get the 
error "The attribute "xlink:href" of the element <use> is required". The xlink:href attribute is 
most certainly present, here is the code that creates the element:

final Element element = getElement();
element.setAttributeNS(SketchPadConstants.SVG_XLINK_NS, X_ATTRIBUTE_NAME, "" + 
origin.getX());
element.setAttributeNS(SketchPadConstants.SVG_XLINK_NS, Y_ATTRIBUTE_NAME, "" + 
origin.getY());
element.setAttributeNS(SketchPadConstants.SVG_XLINK_NS, "xlink:href", 
GROUP_NAME);

A couple of possibly useful ideas..

- Make sure "xmlns:xlink" is defined appropriately on this or a higher node
- Use org.apache.batik.util.XMLConstants.XLINK_NAMESPACE_URI to be sure you
 don't have a typo. Also lots of constants are in SVGConstants (same package).
- "x" and "y" should be in the null namespace.. perhaps your stamp is appearing
 at location (0, 0) which is "off screen"?

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to