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

XSLT Processing Model Questions

Subject: XSLT Processing Model Questions
From: "Dietrich Ayala" <dietrich@xxxxxxxxx>
Date: Fri, 12 Apr 2002 21:55:38 -0700
javascript xslt processing
Hello,

I'm trying to grok the xstl processing model. Could someone help me out a bit? Using the document example in section D.1 of the XSLT
1.0 spec:

In this template, I'd thought that the source tree context node to be processed would be the root (/doc[1]), but then the match
expression wouldn't match it, because using /doc[1] as context means this match expression is looking at the immediate children of
the context node, right?

<xsl:template match="doc">
 <html>
   <head>
     <title>
       <xsl:value-of select="title"/>
     </title>
   </head>
   <body>
     <xsl:apply-templates/>
   </body>
 </html>
</xsl:template>

Now, in this template, the source tree context node is still the root (/doc[1]), right? So how does this match anything, as the
match expression seems like it would match any "doc" children of the context node?

<xsl:template match="doc/title">
  <h1>
    <xsl:apply-templates/>
  </h1>
</xsl:template>

I think I'll stop there. Because if my understanding of how the initial context node and source-tree-nodes-to-be-processed are
flawed, then it only goes downhill from here :)

Thanks,

Dietrich

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Anand
> Ganapathy
> Sent: Thursday, April 11, 2002 8:33 PM
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Query regarding XSL variables
>
>
> Hello,
>
> I am generating an html file from an XML using XSL in order to generate a tree display .
>
> I want to pass xsl:variables to a javascript function.How is it possible to achieve the same?
>
> This is  an example of the scenario I am talking about so that what I intend to do becomes clear:
>
>   <xsl:variable name = "nodeaddr1">
>       <xsl:value-of select = "(//Node1/Nodeaddress) "/>
>  </xsl:variable>
>
> <xsl:variable name = "lidentifier1">
>       <xsl:value-of select = "(//Node1/Levelidentifier) "/>
> </xsl:variable>
>
> <xsl:variable name = "nodename1">
>       <xsl:value-of select = "(//Node1/Nodename) "/>
> </xsl:variable>
> <TR class="DARK">
>                <TD>
>                <A class="hier" href="javascript:">
>                   <img src="images\treePics\downarrow.gif" border="0" />
> 	       </A> &#160;
> 	       <A href="javascript:" onClick="( var1,var2,var2);"> <xsl:value-of select="Nodename"/> </A>
>             </TD>
>     </TR>
>
> I want var1,var2 and var3 being passed as the xsl variables declared above.
> I  tried passing $nodeaddr1,$lidentifier1 and $nodename1 but those are unrecognized in the html.
>
> Also tried passing them as:
> <A href="javascript:" onClick="selectNode( <xsl:value-of select = "(//Node1/Nodeaddress)"/>, <xsl:value-of select =
> "(//Node1/Levelidentifier)) "/>, <xsl:value-of select = "(//Node1/Nodename) "/>);"></A>
>
> But I get the following error:
> Message: Server caught unhandled exception from servlet [jsp11]: javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The value of attribute "onClick" must not
> contain the '<' character.
>
> Please help.
>
> Thanks in Advance,
>
> Anand.
>
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 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.