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

Re: variable definition reuse

Subject: Re: variable definition reuse
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 22 Mar 2002 13:46:17 GMT
david star definition
> I need those variables because in the same style sheet they are used many 
> times and i dont want to keep doing select="exp-date"  

but exp-date is less verbose than $exp-date so it's not clear what you
are gaining.

unless your template for <product> moves the current node so the relative
path to exp-date no longer works? Maybe you need to show an example
template. Even if you have a complicated expression like say
<xsl:if test="$exp-date='foo'">
 <xsl:value-of select="concat($exp-date,$xxx,$yyy)"/>
then the same would work without variables, just by removing the $.


> So no having said that can how 
> can i place them in a different file??

If you really need to do this then you could use an entity reference,
but still it seems to me unlikely that the variables are reallyh elping
much. there isn't an XSLT-specific include mechanism you could use at
that point.

If your variable were outside all teh templates then you could
xsl:include them but if they are local to a template then they must be
literally in the template.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 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.