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

Re: how to use data in other template? or how to handl

Subject: Re: how to use data in other template? or how to handle it other way?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 25 Mar 2002 03:25:50 -0800 (PST)
handl company yahoo.com
Why in the first place do you expect that a "existence/entity" would be
processed before a "existence/attri"?

XSLT is a declarative, side-effects free language, which among other
things means one cannot generally expect a specific processing order.

The effect of having variables, accessible to every instantiation of a
certain template only, can be achieved by regarding the template as a
function and binding the necessary parameters to values using partial
application.

How to do this in XSLT is described in the article:

"Dynamic Functions using FXSL: Composition, Partial Applications and
Lambda Expressions", 

available at:

http://www.topxml.com/xsl/articles/df


Cheers,
Dimitre Novatchev.


Tommi Grenfors <tkgrenfo at cc dot jyu dot fi> wrote:

I know how to use variable in same template.
But how to use same variable in other template?
Could I get example of case?
For example xml-file:

<existence>
 <entity>
  <!-- data in several "tags" -->
  <id>12</id>
  .
  .
  .
 <entity>
 <attri>
  <!-- data -->
 </attri>
</existence>

xsl-file:

<xsl:template match="existence/entity">
<xsl:variable name="global" select="id"> <!-- variable creation and it 
works here -->
 <xsl:value-of select="id" />
</xsl:variable>
.
.
.
</xsl:template>

<xsl:template match="existence/attri">
<!-- how to use variable here or how to use "data of id" here?   -->
<!-- for example in if case... -->
<xsl:if test="global = //attri/idref1">
<!-- first is variable, but what kind of it should be that it works
here 
--> 
</xsl:template>




__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

 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.