On Wed, 2008-02-06 at 09:27 -0600, Archie Cobbs wrote:
> You should be using elCard.setAttributeNS(null, ...) instead of
> elCard.setAttributeNS(svgNS, ...).
thanks!
you are right.
the only exception is href, I must use
org.apache.batik.util.XMLConstants.XLINK_NAMESPACE_URI for it
the working code (for refecence) is:
String translate = "100,100";
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
Element elCard = document.createElementNS(svgNS, "use");
elCard.setAttributeNS(null, "id", id + "instance");
elCard.setAttributeNS(null, "transform", "translate(" + translate +
")");
//either the previous or these, both work:
// elCard.setAttributeNS(null, "x", "300");
// elCard.setAttributeNS(null, "y", "100");
//this is mandatory
elCard.setAttributeNS(org.apache.batik.util.XMLConstants.XLINK_NAMESPACE_URI,
"href", link);
document.getElementById("mysvg").getParentNode().appendChild(elCard);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]