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

XSL template "namespace" problem

Subject: XSL template "namespace" problem
From: Ian Bonnycastle <ibonny@xxxxxxxxxxxx>
Date: Wed, 29 Mar 2006 09:08:31 -0500 (EST)
xsl template namespace
Hey everyone, I noticed that this XSL mailing list was pretty active, and I have a pretty confusing question regarding the xsl:template tag.

I'm attempting to modify DIV sections via Javascript so that they can be turned on and off... pretty standard. But, in order to setup my screen properly, I need to use xsl:template to recursively go down through the sections. When I do this, though, the Javascript I use to turn on and off the DIV sections suddenly can't see the sections anymore. It claims (well, the Javascript console on the browser I use complains) that the section I'm attempting to access does not exist. It only seems to occur when the sections are broken up via xsl:template. Does this change the division's namespace at all? When I use "xsltproc" to consolidate the XSLT into a "flat" XSL file, with no templates, and have the XML file use that XSL file directly, everything works perfectly.

As an example (in the templated XSL file):

<SCRIPT>
   function Toggle(p_ID)
   {
       { ... Javascript code to turn on the particular division "p_ID" and turn off the rest ... }
   }
</SCRIPT>

<xsl:template match="/rootnode/menuitems/item">
    <A HREF="javascript:Toggle('<xsl:value-of select="fname" />')"><xsl:value-of select="name" /></A>

    <DIV ID='<xsl:value-of select="fname" />' STYLE="display:none">
        <xsl:value-of select="desc"/>
    </DIV>
</xsl:template>

(Above, its assumed that each "item" in the XML file has 3 parts, the "name", or link name, the "fname" or proper calling name, and the "desc" or the text within the division to display when clicked.)

The above code parses correctly via xsltproc, but when put into IE, IE complains that "Toggle" can't find the p_ID of item "itemone", if that, for example, is the fname of one of the items in the XML file.

Whats going on here? If I parse out the above with xsltproc and save it to a file, IE is perfectly happy and can find everything fine.

Ian

Current Thread

Back To School Sale!

Save 30% off all Stylus Studio 2008 Products when you purchase from our Online Shop.

Offer ends August 31, 2008.

Coupon Code
TRTY-C4JV-OFF

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-2007 All Rights Reserved.