This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: variable definition reuse



> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]