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

Re: Different results on different server

Subject: Re: Different results on different server
From: Joelle Tegwen <tegwe002@xxxxxxx>
Date: Wed, 07 Oct 2009 14:56:15 -0500
Re:  Different results on different server
My use of . in the key is probably due to not *really* understanding how it works. I'll remember your advice about using keys for future development. Thanks.

I changed my stylesheet to
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" verion="4.0" omit-xml-declaration="yes" encoding="iso-8859-1" indent="yes"/> <xsl:key name="project" match="project" use="."/>
<xsl:key name="project_id" match="project" use="@project_id"/>
<xsl:variable name="projects"
select="//project[generate-id() = generate-id(key('project', .))]"/>
<xsl:variable name="projects_id"
select="//project[generate-id() = generate-id(key('project_id', @project_id))]"/>
<xsl:template match="/staff">
<xsl:comment><xsl:value-of select="system-property('xsl:vendor')"/></xsl:comment> <xsl:value-of select="count($projects)"/><xsl:text> - </xsl:text>
<xsl:value-of
select="count(//project[generate-id() = generate-id(key('project', .))])"/><xsl:text> - </xsl:text>
<xsl:value-of select="count($projects_id)"/><xsl:text> - </xsl:text>
<xsl:value-of
select="count(//project[generate-id() = generate-id(key('project_id', @project_id))])"/>
</xsl:template>
</xsl:transform>


(to test your thought that it might be the key).

Dev:
<!--libxslt-->5 - 5 - 5 - 5

Test <!--libxslt-->0 - 5 - 0 - 5

Does this help?

Thanks
J
Add somewhere in your stylesheet:

<xsl:comment><xsl:value-of
select="system-property('xsl:vendor')"/></xsl:comment>

and please report what the two processors say.

Given that the project element is:

        <project project_id="5">
         <title>Separated Project</title>
         <acronym></acronym>
         <project_type> Project</project_type>
         <short_desc>This project is separated</short_desc>
        </project>

it's very odd to use "." (the string value of the project element) as the
key. It should work in theory, but it's sufficiently odd that this is
probably where the bug lies. I would have expected to see something like
use="@project_id".

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay

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.