RE: [xsl] Handling Mixed Child Elements and Text() Nodes

Subject: RE: [xsl] Handling Mixed Child Elements and Text() Nodes
From: Americo Albuquerque <melinor@xxxxxxxx>
Date: Thu, 2 Oct 2003 12:03:11 +0100

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Brook Ellingwood
> Sent: Thursday, October 02, 2003 5:47 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] Handling Mixed Child Elements and Text() Nodes
> One further observation on the processor differences in this 
> operation (without reposting all the code). You are getting
> <div class="body_subhead">Linked Text</div>
> from Saxon, but I'm getting
> <div class="body">Linked Text</div>
> from MSXML3. Easy enough to find a workaround, but I thought 
> I'd point it out. If MSXML3 behaved the way I expected it to, 
> I probably would have gotten this worked out on my own two days ago.
> Thanks again.

That's true. I've tested the code with msxml3, saxon and xalan and only
saxon displayed
<div class="body_subhead">Linked Text</div>

But differences doesn't stop here, in saxon and msxml I get
<div class="body"><a href="a" class="body">A</a></div>
But with xalan I get
<div class="body">
<a href="a" class="body">A</a>

Regarding to the body_subhead case, on the template named d1 change the
<xsl:otherwise> like this:
        <div class="{$divClass}">
          <xsl:value-of select="$s"/>
        <div class="{$divClass}">
          <xsl:if test="$s"><xsl:value-of select="$s"/></xsl:if>

This will make msxml and xalan to display 
<div class="body_subhead">Linked Text</div>

Americo Albuquerque

 XSL-List info and archive:

Current Thread