xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kari Hoijarvi" <hoija...@me.wustl.edu>
Subject RE: Loading images in ECMA scripts
Date Thu, 10 Jul 2003 13:04:34 GMT
Try 

   image.setAttributeNS(xlinkNS, "href", url);

without the "xlink:" in the attribute name. The 
namespace is identified by the namespace URI only.

Kari

-----Original Message-----
From: Jens Heidrich [mailto:heidrich@informatik.uni-kl.de]
Sent: 10 July 2003 04:05
To: batik-users@xml.apache.org
Subject: Loading images in ECMA scripts


Hello,

we are using SVG in order to display charts, that use JavaScript to 
support some simple interaction. We discovered a strange behavior when 
trying to change the "href" attribute of an image by an ECMA script:

function load_image(url) {
   image = document.getElementById("image");
   image.setAttributeNS(xlinkNS, "xlink:href", url);
}

Our aim was to change the image by clicking on a certain SVG element. 
According to the squiggle DOM Viewer the DOM is adapted accordingly by 
the script (that is, it includes an attribute "xlink:href" and the 
corresponding, transmitted URL), but the displayed image is still the 
same (and shows the image of the old URL). Other attribute changes (like 
size or position) seem to work as expected.

We discovered this while using Batik 1.5 beta4b and beta5. We are 
running Batik under Windows 2000, JDK 1.4.1_01.

Any help will be appreciated.


Regards,

Jens


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message