[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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:
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|