[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Embedded bold,italic,anchors etc.


Subject: Re: [xsl] Embedded bold,italic,anchors etc.
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 11 Jun 2008 13:41:54 +0200

Craig Riley wrote:

I have created an XSLT style sheet that does everything I need it to
except for handling embedded text. The XML documents I am transforming
contain the usual italic, bold, superscript, plus hyper links that
need converting into html.

Of course I need them to retain there place in the copy of course.

The key to solve that is usually writing templates for the elements you want to process where you make sure the necessary transformation happens and where you use xsl:apply-templates in the body of the template e.g.


  <xsl:template match="foo">
    <strong>
      <xsl:apply-templates/>
    </strong>
  </xsl:template>

  <xsl:template match="bar">
    <em>
      <xsl:apply-templates/>
    </em>
  </xsl:template>



--

	Martin Honnen
	http://JavaScript.FAQTs.com/


Current Thread
Keywords