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

Re: Re: Method for delimiting template results

Subject: Re: Re: Method for delimiting template results
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Wed, 5 Mar 2003 23:38:01 +0100
 Re: Re: Method for delimiting template results
"Ted Stresen-Reuter" <tedmasterweb@xxxxxxx> wrote in message
news:AB70C6E4-4F56-11D7-92A9-00039315D01C@xxxxxxxxxx
> Thanks for the reply. Upon reflection, I realized that I had the
> solution and then saw your email. However, I also realized that this
> particular solution won't work if my checkbox elements are inside of a
> TABLE element (and they are) because the context for the position() and
> last() is the enclosing TD element.
>
> Any suggestions on how I can "globalize" the context short of doing two
> passes on the xml source (to reduce it to, say, just the FORM element)?

Let's say you have the following source.xml:

<table>
  <tr>
    <td>
      <input type="checkbox" name="first"/>
    </td>
    <td>
      <input type="checkbox" name="second"/>
    </td>
    <td>
      <input type="checkbox" name="third"/>
    </td>
  </tr>
</table>

Then you can use the same transformation, with only the following change:

Replace:

       <xsl:if test="not(position() = last())">,</xsl:if>

with:

       <xsl:if
test="../following-sibling::td[input[@type='checkbox']]">,</xsl:if>


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL







 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.