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

Re: Plse Help! something to do with counter....

Subject: Re: Plse Help! something to do with counter....
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 2 May 2001 09:49:07 +0100
Re:  Plse Help! something to do with counter....
Hi Justin,

> Thanks for your reply. I tried to change the codes to fit into my
> XSL but failed. This is my XSL..

Ah... I'm sorry - I misinterpreted your question.  Thanks for posting
more details.

So, you want to have a different input element for each Resource; each
Resource has an Index child which gives the name for the checkbox, and
you want each to have a distinct value.

That's actually a lot easier. Just apply templates to the Resource
elements:

<xsl:template match="/">
   <html>
      <body>
         <form method="GET" action="../servlet/takeLoan">
            <xsl:apply-templates select="List/Resource" />
         </form>
      </body>
   </html>
</xsl:template>

Now, the processor takes that set of Resource elements and sorts them
into a list (in document order) that it will process, called the
current node list.  You can have a template that matches the Resource
element to provide you with the output that you want for each of them.
Within this template, you can use position() to get the position of
the particular Resource element you're currently processing (the
current node) within the current node list.  And you can use that to
get the incrementing values that you want:

<xsl:template match="Resource">
   <div align="right">
      <input type="checkbox" name="{Index}" value="c{position()}" />
   </div>
   <br />
</xsl:template>

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 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.