Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 5th, 2006, 02:44 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok instead of calling recursive templates I have written this code with position but I am having a little problem left now.

    <h3><a><xsl:attribute name="href">javascript:sendContentRequest(<xsl:num ber value="position()" format="1" />-1)</xsl:attribute>
                            <xsl:number value="position()" format="1" /><xsl:text>. </xsl:text>
                                <xsl:variable name="headline" select="fcs:headline/fcs:paragraph"/>
                                <xsl:variable name="cut" select="substring($headline,0,50)"/>
                                <xsl:variable name="index" select="0"/>
                                    <xsl:value-of select="$cut"/>

                            </a></h3>

I am having this output


        </tr>
        <tr>
            <td class="text">
                <h3><a href="javascript:sendContentRequest({1}-1)">1. Students' Paths To Small Colleges Can Bypass SAT </a></h3>
            </td>
        </tr>

I want to see ><a href="javascript:sendContentRequest({1}-1)"> as ><a href="javascript:sendContentRequest(0)"> how can I manage to do it?




Your attitude determines your altitude
 
Old September 5th, 2006, 03:39 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok I solved that problem too but Thanks Michael Thanks Joe. I have really learnt lots of things from this topic. And Michael you are gonna earn a bit money from me. I am gonna buy your book :))
I have written (<xsl:number value="position()-1" format="1" /> and it was the solution.


Your attitude determines your altitude





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to loop through a HashMap in XSL? sunilnk XSLT 6 April 10th, 2017 04:09 AM
help: how can I break from xsl for-each loop ? back2grave XSLT 5 May 31st, 2012 12:03 PM
XSL Loop and incrementing a variable 2007-03-29 XSLT 8 March 30th, 2007 10:41 AM
xsl:for-each loop Tomi XSLT 3 September 7th, 2006 05:35 AM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.