[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: Francois Belanger <francois@xxxxxxxxxxx>
Date: Wed, 13 Jan 99 11:13:24 -0500
Re: dl/dt/dd matching
James Clark wrote on 12/01/99 23h40:

>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?

As you mentionned earlier:

>One solution is to allow nodes to be grouped together:
>
>[[A1, B1], [A2, B2], [A3, B3]]
>
>and then specify an operation f on the results of groups, thus getting
>
>f(r(A1) + r(B1)) + f(r(A2) + r(B2)) + f(r(A3) + r(B3))

but instead of specifying an operation, I would consider [[A1, B1], [A2, 
B2], [A3, B3]] as the three nodes result of group() match and then apply 
the template to those three nodes as usual. Since the group match acts 
more like a slice (slice it as each element name), we should maybe call 
it slice(ElementName). 

<xsl:template match="slice(dt)">
     <tr><xsl:apply-templates/></tr>
</xsl:template>

I can see here that this is modifying the input tree by creating new 
parent nodes to act as a container of each slice. From previous postings 
on this list, this seems to cause problems, is it in this case?   



Francois Belanger
Sitepak, Bringing Internet Business into Focus
http://www.sitepak.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.