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

Re: Saxon & xsltproc giving different output (SOLVED)

Subject: Re: Saxon & xsltproc giving different output (SOLVED)
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 29 Dec 2011 21:30:41 +0000
Re:  Saxon & xsltproc giving different output (SOLVED)
On 29/12/2011 20:33, Russell Urquhart wrote:
I wanted to thank Michael for helping me on this.
(To recap, when i ran a given xslt on an xml data file, it was creating a table, based on a<modules_impacted>  element where each row contained a bug impacting that given module, as it should. Running this xslt under xsltproc, was giving the table, with an extra row, containing a bug not related to the<modules_impacted>  value of HDQ.

When i ran the same xslt under Saxon, I was not even getting the table at all.
I extracted out the template for responsible for creating the table.

In looking at this i started looking at the key dfined and used in the loop:

   <xsl:key name="module-index" match="errata_section" use="module_impacted"/>
and the containing loop:

      <xsl:for-each select="//errata_section[generate-id(.)=generate-id(key('module-index', module_impacted)[1])]">
         <xsl:sort select="module_impacted"/>


So i started looking in the data file for anomalies. Turns out that there was a<modules_impacted> element with a value of HDQ/1-wire. All the others had the value of HDQ. i.e.


<modules_impacted>HDQ/1-wire</modules_impacted>
<modules_impacted>HDQ</modules_impacted>
<modules_impacted>HDQ</modules_impacted>
<modules_impacted>HDQ</modules_impacted>
<modules_impacted>HDQ</modules_impacted>

Changing the first<modules_impacted> to have the value of HDQ, seemed to fix the problem under both processors. Both now seem to output the table with only the relevant bugs.

I'm glad its fixed, but can anyone share some light as to why such an anomaly would play out like that?


I don't think you're giving us enough information to solve the original problem. I suspect even the limited information you are giving us is unreliable - are module_impacted and modules_impacted supposed to be the same name?

I suspect you haven't solved the problem at all, you have merely stumbled upon a workaround; which isn't the same thing at all.

Michael Kay
Saxonica

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.