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

Re: using mode-values within a template

Subject: Re: using mode-values within a template
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 2 May 2002 13:50:42 +0100
using mode xsl template variable


 <xsl:template match="foo" mode="bar">
     <xsl:variable name="mode" select="'bar'"/>

  It's not the most elegant way but it works!

But what is "work" here? As others have said this information can not be
that useful, everywhere where it is legal to use the syntax $mode  you
could just as easily use the string 'bar' as either $mode is set to 'bar'
or it is out of scope.

> but I haven't read anything about a general element siblings (only
> preceding- and following-siblings) in xpath!! 
siblings are ../* (children of your parent)

But you want all your sibling projects that are not you, so that is

select="preceding-sibling::project|following-sibling::project"
or

select="../project[not(generate-id(.)=generate-id(current()))]

or if your name attribute is enough to distinguish:

select="../project[not(@name=current()/@name]

(don't use // as in //project unless you really want to search the
entire document, // is almost always the cause of slow stylesheets)

> %0A      
that is hex 10 in URI quoted syntax, ie it's a newline character coming
from your white space before www: you can get rid of that by using

 <xsl:variable name="online_doc" select="normalize-space(docu[@kind='url'])"/>

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.