[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: dl/dt/dd matching
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|