[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[xsl] indenting text with
[xsl] indenting text with and - hack
Subject: [xsl] indenting text with <dl> and <dd> hack From: Dan Diebolt <dandiebolt@xxxxxxxxx> Date: Thu, 29 Mar 2001 00:46:24 -0800 (PST) |
I am trying to use the <dl> and <dd> hack to generated indented html. This is my xml: <indent> <a>Item1.0</a> <a>Item1.1</a> <a>Item1.2 <a>Item1.2.1</a> <a>Item1.2.2</a> <a>Item1.2.3</a> </a> <a>Item1.3</a> <a>Item1.4 <a>Item1.4.1</a> <a>Item1.4.2</a> </a> </indent> This is what I want as html output: <dl> <dd>Item1.0</dd> <dd>Item1.1</dd> <dd>Item1.2</dd> <dl> <dd>Item1.2.1</dd> <dd>Item1.2.2</dd> <dd>Item1.2.3</dd> </dl> <dd>Item1.3</dd> <dd>Item1.4</dd> <dl> <dd>Item1.4.1</dd> <dd>Item1.4.2</dd> </dl> </dl> I am having a problem in the early placement of the end tags </dl>. Here is the template I have been working with: <xsl:template match="a"> <xsl:choose> <xsl:when test="count(preceding-sibling::*)=0"> <dl> <dd> <xsl:value-of select="text()"/> </dd> <xsl:apply-templates select="a"/> </dl> </xsl:when> <xsl:otherwise> <dd> <xsl:value-of select="text()"/> </dd> <xsl:apply-templates select="a"/> </xsl:otherwise> </xsl:choose> </xsl:template> Any help would be appreciated. __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Should we let XT fade away (L, Eric van der Vlist | Thread | Re: [xsl] indenting text with <dl> , Jeni Tennison |
[xsl] Should we let XT fade away (L, Eric van der Vlist | Date | RE: [xsl] xsl filtering duplicate n, Michael Kay |
Month |