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

Re: dl/dt/dd matching

Subject: Re: dl/dt/dd matching
From: David Rosenborg <David.Rosenborg@xxxxxxxxxxx>
Date: Wed, 13 Jan 1999 14:11:30 +0100
rosenborg tr
Another suggestion:

Allow the select patterns 'previous (MatchExpr)' and 'next (MatchExpr)'.

<xsl:template match="dl">
  <table>
    <xsl:for-each select="dt">
      <tr>
        <xsl:apply-templates/>
        <xsl:apply-templates select="next (dd)"/>
      </tr>
    </xsl:for-each>
  </table>
<xsl:template>

<xsl:template match="dt|dd">
  <td><xsl:apply-templates/></td>
</xsl:template>

The previous and next patterns would select the nearest sibling
of the current node that matches the match pattern.

Also if 'previous ()' and 'next ()' could be used
for matching an element of the same type as the current node,
the first-of-type, first-of-any etc boolean expressions would not be
needed.

Maybe I've overlooked some deficiencies with this solution
but to me it looks simpler and more intuitive than a 'group'
solution. However, it is less declarative and more explicit
which might not be desired.

</David>

___________________________________________________________________
David.Rosenborg@xxxxxxxxxxx                        OM Technology AB


James Clark wrote:
> 
> Francois Belanger wrote:
> 
> >  How about:
> >
> > <xsl:template match="dl">
> >   <table>
> >     <xsl:for-each select="group(dt)">
> >          <tr><xsl:apply-templates/></tr>
> >     </xsl:for-each>
> >   </table>
> > </xsl:template>
> >
> > <xsl:template match="dt|dd">
> >     <td>
> >       <xsl:apply-templates/>
> >     </td>
> > </xsl:template>
> >
> > This way one can see that the tr will enclose the td.
> 
> I agree this looks more intuitive, but what exactly are the semantics
> that you have in mind?
> 
> James
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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.