[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 14:07:54 +0200

Craig Riley wrote:

For example I have:

<p>some text <italic>some italic text</italic></p>

which could happen in numerous paragraphs within the document.

Whenever I "call" the template the peice of italix text is displayed outside of the paragraph text! I don't know how to convert the italic tags into <i></i> tags and keep it within the main body of text?

If you do


  <xsl:template match="/">
    <html>
      <body>
        <xsl:apply-templates/>
      </body>
    </html>
  </xsl:template>

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

  <xsl:template match="italic">
    <i>
      <xsl:apply-templates/>
    </i>
  </xsl:template>

that you get the result you want.


--


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


Current Thread