[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

JavaScript and XSL (ver2)

Subject: JavaScript and XSL (ver2)
From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxx>
Date: Thu, 19 Feb 2004 00:11:40 -0700
loadxml javascript
Hello,
Ohh man, I just made life very difficult.  However, there will be much
benefit and writing Javascript functions dynamically from XSLT.  Think this
topic warants a huge tutorial on it / or faq (hmm.. checking xsl faqs now)

All right, here is what I am trying to do (there are a lot of jscript
"Alert('test');" type calls... just to insure that things are operating as
expected (javascript does fire at these locations).
Here is what I have, well first what I am trying to accomplish is loading up
a xml dom object with some XML.  Executing dom.loadXML in javascript.  So, I
am expecting to build the XML dynamically in XSL, then issue the loadxml
into the client side xml active x object.
Seems easy enough.  Here is where I am at.. but not working:

        <script language="JavaScript" type="text/javascript">
        <xsl:text disable-output-escaping="yes">
         alert('test');
   </xsl:text>
  <xsl:call-template name="jscript_test"/>
        </script>


<xsl:template name="jscript_test">
 <xsl:variable name="test2">
     <xsl:element name="TEST">
         <xsl:element name="T"><xsl:attribute
name="att">1</xsl:attribute></xsl:element>
         <xsl:element name="T"><xsl:attribute
name="att">2</xsl:attribute></xsl:element>
         <xsl:element name="T"><xsl:attribute
name="att">3</xsl:attribute>the zoo</xsl:element>
        </xsl:element>
    </xsl:variable>

   <xsl:text disable-output-escaping="yes">alert('</xsl:text>
    <xsl:value-of disable-output-escaping="yes" select="$test2"/>
   <xsl:text disable-output-escaping="yes">');</xsl:text>

    <xsl:text disable-output-escaping="yes">dom.loadXML('</xsl:text>
     <xsl:value-of disable-output-escaping="yes" select="$test2"/>
 <xsl:text disable-output-escaping="yes">');</xsl:text>

    <xsl:text
disable-output-escaping="no">writeToLayer('select_signature',dom.xml);</xsl:
text>
</xsl:template>


The writeToLayer function above is a proven and stable function.
What I am expecting to happen, the the XML document "test2" gets loaded into
the dom object... and then I will simple display results of xml doc in the
DIV with id of "select_signature".  I am getting nothing at all.

Karl


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.