[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Saxon vs. Xalan - output not the same

Subject: Re: Saxon vs. Xalan - output not the same
From: David N Bertoni/Cambridge/IBM <david_n_bertoni@xxxxxxxxxx>
Date: Thu, 29 Aug 2002 09:41:45 -0700
saxon vs xalan



> Hi all,
> I have this bit of XSL:
>
> <xsl:template match="tight">
> .BR <xsl:value-of select="." /><xsl:text/>
> <xsl:choose>
> <xsl:when test="position() != last()">, </xsl:when>
> <xsl:when test="position() = last()">. </xsl:when>
> </xsl:choose>
> </xsl:template>
>
> that matches this bit of XML:
> <tight><link>mget</link></tight>
> <tight><link>medit</link></tight>
>
> Using Xalan, I get output like this:
>
> mget, medit.
>
> Using Saxon, I get output like this:
>
> mget,
>
> medit,
>
> I want the the output from Saxon to look like Xalan's output . Any ideas
>  what I can do to fix this?

Without a complete example, it's we have to guess what your inputs look
like, but I reconstructed the following:

---------------------------------

   <?xml version="1.0"?>
   <doc>
   <tight><link>mget</link></tight>
   <tight><link>medit</link></tight>
   </doc>

---------------------------------

   <?xml version="1.0"?>
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   version="1.0">

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

   <xsl:template match="tight">
   .BR <xsl:value-of select="." /><xsl:text/>
   <xsl:choose>
   <xsl:when test="position() != last()">, </xsl:when>
   <xsl:when test="position() = last()">. </xsl:when>
   </xsl:choose>
   </xsl:template>

   </xsl:stylesheet>

---------------------------------

Using Xalan-C++, I get the following output:

   <?xml version="1.0" encoding="UTF-8"?>
   <out>

   .BR mget,

   .BR medit,
   </out>

The output from Saxon and MSXSL is pretty the same.

If I use the following input document:

   <?xml version="1.0"?>
   <doc><tight><link>mget</link></tight><tight><link>medit</link></tight></doc>

I get:

   <?xml version="1.0" encoding="UTF-8"?>
   <out>
   .BR mget,
   .BR medit. </out>

If you're expecting the latter, you need to change your source document, or
use the xsl:strip-space instruction to strip whitespace from the
appropriate elements.

It's likely you've found a bug in Xalan, if it is producing what you say it
is.  What version of Xalan are you using?

Dave


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.