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

saxon xmlspy discrepancy in whitespace handling

Subject: saxon xmlspy discrepancy in whitespace handling
From: "Erwin Kloeck" <kloeck@xxxxxxxxx>
Date: Wed, 17 Jan 2007 10:51:30 +0100
 saxon xmlspy discrepancy in whitespace handling
Hi,

I write my xsl in xmlspy (version 2006 sp2) and use saxon 8804 to do
the transformation in java code.
I get the following discrepancy in the produced output, saxon seems to
produce extra white space.
I know that saxon is the more specification compliant of the two
processors, but xmlspy does what I want.
So I know that I am missing something fundamental here and I would be
grateful for some help.

The immediate question is, how do I get saxon to produce the output I
want, shown by the xmlspy output?
And secondly, what am I not understanding about whitespace handling in xsl?

Thank you for your attention.

Erwin

Here is my example code that demostrates the problem:

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

<section name="AAA" />

<section name="BBB" />

</top>
-- end xml --

-- begin xsl --
?xml version="1.0" encoding="UTF-8"?>
<?altova_samplexml C:\workspaces\rad\garuda\storage\example.xml?>

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">


<xsl:output method="text" version="1.0" encoding="iso-8859-1" />


<xsl:variable name="newline"><xsl:text>&#10;</xsl:text></xsl:variable>

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

  <xsl:template match="//section" >
      <xsl:call-template name="section-header" />
 </xsl:template>

 <xsl:template name="section-header" >
     <xsl:value-of select="@name"/>
     <xsl:value-of select="$newline"/>
 </xsl:template>

</xsl:stylesheet>
-- end xsl --

-- begin xmlspy output --
AAA
BBB

-- end xmlspy output --

-- begin saxon output --


AAA



BBB



-- end saxon output -


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.