xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barbisch, Martin" <barbi...@sony.de>
Subject RE: I figured out part of implementing Scrollbar
Date Mon, 20 Jan 2003 09:05:33 GMT
Hi William Huang,
I do not know whether this solves your problem, but I think you should use
'setAttributeNS' for 'xmlns:xlink':
    var XLINKNS = "  <http://www.w3.org/1999/xlink>

    newconElement.setAttributeNS(XLINKNS, "xlink", XLINKNS);

-----Original Message-----
From: William Huang [mailto:shuang@xperient.net]
Sent: Montag, 20. Januar 2003 05:55
To: batik-users@xml.apache.org
Subject: I figured out part of implementing Scrollbar

Dear Mr. Thomas E Deweese,
Sorry about the second question in my last email. I figured out how to move
elements from scrollPane1 to innerSvg by correctly using cloneNode(true). 
For the first question, I found the problem is that the svg element
generated in my Javascript function won't do clipping. The code I used to
generate the svg element is
 newconElement = document.createElementNS(svgNs, "svg");
 newconElement.setAttribute("xmlns", " http://www.w3.org/2000/svg
<http://www.w3.org/2000/svg> ");
 newconElement.setAttribute("xmlns:xlink", " http://www.w3.org/1999/xlink
<http://www.w3.org/1999/xlink> ");
 newconElement.setAttribute("x", parseInt(paneX)+33);
 newconElement.setAttribute("y", parseInt(paneY)+33);
 newconElement.setAttribute("width", parseInt(paneWidth)-33);
 newconElement.setAttribute("height", parseInt(paneHeight)-33);

Then I append the new g element containing scroll elements to this new svg
element. I also tried to hard-code the x, y, width, and height of this
newconElement to 33, 33, 200, 300, the elements it contains also won't be
restricted to (33, 33, 200, 300). Is there something wrong with my generated
svg element? Thank you for your help.
With best regards,

View raw message