xsl-list
[Top] [All Lists]

Re: Re: Method for delimiting template results

2003-03-05 15:38:01

"Ted Stresen-Reuter" <tedmasterweb(_at_)mac(_dot_)com> wrote in message
news:AB70C6E4-4F56-11D7-92A9-00039315D01C(_at_)mac(_dot_)com(_dot_)(_dot_)(_dot_)
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[(_at_)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



<Prev in Thread] Current Thread [Next in Thread>