[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: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Thu, 02 May 2002 16:02:34 +0200
Re:  using mode-values within a template
ChivaBaba@xxxxxxx wrote:

thanks for your suggestion to do this by hard-coding the mode name into the templates as a variable like

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

It's not the most elegant way but it works!
You know, it's kind of reflection, you want to know method signature in the method code, that's why it's not so elegant.

1. How can I select all nodes of a certain type except the one that is used at the moment??

e.g.:
<xsl:for-each select="//project">
<a href="{normalize-space(translate(@name,' ',''))}{@version}_cp.html">
<xsl:value-of select="@name"/>
<xsl:value-of select="@version"/>
</a>
&#160;&#160;&#160;&#160;&#160;
</xsl:for-each>
<xsl:for-each select="//project[count(.|current())!=1]">

I want to create a link for each project in the xml-source except the project I'm currently expanding...maybe it gets simpler, when I tell you, that all the projects are siblings....but I haven't read anything about a general element siblings (only preceding- and following-siblings) in xpath!!
Oh, that's better, try
<xsl:for-each select="preceding-sibling::project | following-sibling::project">



<docu kind="url" loc="internet">
www.gcc.com
</docu>
... my href has the following value:


http://%0A www.gcc.com%0A/


Does anybody know, what I can make better to avoid this rubbish result???

Try to normalize spaces: <xsl:value-of select="normalize-space($online_doc)"/>


--
Oleg Tkachenko
Multiconn International, Israel


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.