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

dl/dt/dd matching

Subject: dl/dt/dd matching
From: Francois Belanger <francois@xxxxxxxxxxx>
Date: Mon, 11 Jan 99 18:12:31 -0500
dl dt dd
I'm scratching my head on this one. We are trying to define an XML 
content DTD and giving a shot to Voyager, the W3 effort for reinstating 
HTML 4 as an XML application see <http://www.w3.org/TR/WD-html-in-xml/>.

What were trying to do is layout a suite of dt/dd within a dl as a table 
with a row for each dt. Since there's no container for each dt (the 
corresponding dl are siblings, not children of the dt node), how can one 
start a new row for each dt and express that in XSL?

Speicifcally, any suggestion on xsl:templates for turning:

<dl>
<dt>Term 1</dt>
<dd>Description 1</dd>
<dt>Term 2</dt>
<dd>Description 2</dd>
</dl>

into:

<TABLE>
<TR>
     <TD>Term1</TD>
     <TD>Description 1</TD>
</TR>
<TR>
     <TD>Term2</TD>
     <TD>Description 2</TD>
</TR>
</TABLE>

Our current templates (which obviously do not produce the desired result):

<xsl:template match="dl">
	<TABLE>
	<xsl:apply-templates/>
	</TABLE>
</xsl:template>

<xsl:template match="dl/dt">
	<TR>
    <TD><xsl:value-of select="."/></TD>
		<TD<xsl:apply-templates select = "../dd"></TD>
   </TR>
</xsl:template>

<xsl:template match="dl/dd">
	<TD><xsl:apply-templates/></TD>
</xsl:template>

Any suggestion or comment welcome!

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.