Re: FW: [xsl] Double output

Subject: Re: FW: [xsl] Double output
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sun, 9 Mar 2003 23:11:37 GMT

> When I open the xml file in MSIE 6.28,
It's best to debug by looking at the generated html file rather than
looking what it looks like in a browser.

In this case you are going to generate invalid html.

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


You are placing the result of applying templates to the subsection
inside an h4 element. There are two such children an ssHdr and a p.
The ssHdr itself generates an h4 so you will end up with an h4 inside an
h4 which is an error  but the browser probably renders it as an h4.
Then still inside the h4 you will get the result of applying templates
to the p. You have the same problem with the next line:  you are
putting all textpara's inside a p from your subsection template
and then putting each one inside a nested p coming from the TextPara
template.

You just want something like:

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


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

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

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


Current Thread