xsl-list
[Top] [All Lists]

RE: preserving XHTML from XML source

2004-05-25 11:49:02
-----Original Message-----
From: Zakon, Stuart [mailto:stuart_zakon(_at_)medco(_dot_)com]


Hi,

<snip />

Is there a better way to do this?


The preferrable solution IMHO would be to replace the xsl:copy-of with an
xsl:apply-templates, and add a template matching b nodes.

Since, for the text nodes, you can depend on the default template rule to
perform its magic, the text will automatically be copied.

<xsl:template match="Message">
  <tr>
    <td>
      <xsl:apply-templates />
    </td>
  </tr>
</xsl:template>

<xsl:template match="b">
  <xsl:copy>
    <xsl:apply-templates />
  </xsl:copy>
</xsl:template>

Should do it.

HTH!

Greetz,

Andreas



<Prev in Thread] Current Thread [Next in Thread>