This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: pass value between xml and javascript


By the way, in my html page, it just includes these.
<html>
<head>
<script language="javascript">
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
xml.load("travel.xml");

var xsl = new ActiveXObject("Microsoft.XMLDOM");
xsl.async = false;
xsl.load("travel.xsl");

document.write(xml.transformNode(xsl));

</script></head><body></body></html>

Hope the calling is right.

Chen

-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Jeni Tennison
Sent: Sunday, September 09, 2001 10:40 AM
To: Chen Wang
Cc: XSL-List@lists.mulberrytech.com
Subject: Re: [xsl] pass value between xml and javascript


Hi Chen,

> Of course it will not work for above line. But how to get that id
> between <cityid> into the WM_toggle function? I also tried this: <a
> href="#" onclick="WM_toggle('{cityid}'); return false">..</a>, but
> it did not work either.

The above should generate some HTML that looks like:

  <a href="#" onclick="WM_toggle('id'); return false">..</a>

If it doesn't, then you are probably using MSXML2 rather than MSXML3.
MSXML2 doesn't support XSLT, but rather a Microsoft-specific variant
which doesn't implement attribute value templates (the {}s). You can
find out more about the difference from the MSXML FAQ at
http://www.netcrucible.com/.

If that's what the transformation's producing but the Javascript
doesn't work, then there's something wrong with the Javascript, not
the XSLT.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]