This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Transforming using Javascript's documentElement
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- subject: RE: [xsl] Transforming using Javascript's documentElement
- From: Rosa I-Ting Cheng <Rosa at ceanet dot com dot au>
- Date: Mon, 16 Jul 2001 14:51:13 +1000
- Reply-To: xsl-list at lists dot mulberrytech dot com
thanx! I got it fixed.
all i had to do was to put fXML.async before I load the file.
-----Original Message-----
From: Chris Bayes [mailto:Chris@Bayes.co.uk]
Sent: Friday, 13 July 2001 7:17 PM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] Transforming using Javascript's documentElement
Rosa,
I didn't read all of your message. It may not be an async problem. Are you
sure the page has loaded and the data islands have completed loading when
you call writeToPage
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
>-----Original Message-----
>From: owner-xsl-list@lists.mulberrytech.com
>[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Rosa I-Ting
>Cheng
>Sent: 12 July 2001 05:16
>To: 'xsl-list@lists.mulberrytech.com'
>Subject: [xsl] Transforming using Javascript's documentElement
>
>
>I'm not sure if this has been asked before... but can anyone please tell me
>why sometimes fXML.documentElement returns a null and sometimes it doesn't?
>this is the javascript code I have:
>
><HTML>
><HEAD>
><SCRIPT>
> function writeToPage(xsl1, xsl2)
> {
> qXML.load(qXML.src);
> fXSL.load(xsl1);
>
>
>qXML.transformNodeToObject(fXSL.documentElement,gpXML.XMLDocument);
>//fXSL.do
>cumentElement always have problems
> fXSL.load(xsl2);
>
>
>mainBody.document.write(gpXML.transformNode(fXSL.documentElement));
> mainBody.document.close();
> }
></SCRIPT>
><HEAD>
><BODY>
><xml id="qXML" src="TotalQuotesPolicies.xml"></xml>
><xml id="gpXML"></xml>
><xml id="fXSL"></xml>
>...
></BODY>
><HTML>
>
>I'm trying to transform the XML twice with 2 different XSLs. And when I
>directly put in the
><?xml-stylesheet type="text/xsl" href="saBySALogin2.xsl"?>
>line in the XML, the transformation works fine, but when trying to use that
>javascrit code above, at times it works and at times it doesn't. I know it
>is due to the fXML.documentElement return null and the
>transformNodeToObject() and the transformNode() returns an error when that
>happens... is there a way around it? or a substitute for the
>documentElement? or am I doing something wrong?
>
>thank you!
>
>
>Ross
>
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list