This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: indenting text with <dl> and <dd> hack


Hi Dan,

It looks from the samples that you sent as if there are two types of
'a' elements - ones that contain subelements (other 'a' elements) and
ones that don't.  The ones that don't just need to be turned into 'dd'
elements:

<xsl:template match="a[not(a)]">
   <dd><xsl:value-of select="." /></dd>
</xsl:template>

The ones that *do* contain subelements need the initial text to be
turned into a 'dd' element, and then the 'a' subelements to be given
within a 'dl' element:

<xsl:template match="a[a]">
   <dd><xsl:value-of select="normalize-space(text())" /></dd>
   <dl>
      <xsl:apply-templates select="a" />
   </dl>
</xsl:template>

And of course you need the indent element to be turned into a 'dl'
element:

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

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]