[ http://nagoya.apache.org/jira/browse/XALANJ-1754?page=comments#action_55684 ] Henry Zongaro commented on XALANJ-1754: ---------------------------------------
My apologies! It was Santiago Pericas-Geertsen who fixed the problem. > Wrong evaluation of XPath expressions using key() > ------------------------------------------------- > > Key: XALANJ-1754 > URL: http://nagoya.apache.org/jira/browse/XALANJ-1754 > Project: XalanJ2 > Type: Bug > Components: XPath > Versions: 2.5Dx > Environment: Operating System: Windows NT/2K > Platform: PC > Reporter: Amir Rosen > Priority: Blocker > Attachments: test.xml, test.xsl > > key() expressions using 2 filters sometimes return the wrong result > (sometimes > return an empty nodeset and sometimes return the source document root) > for example the expression: > (key('object','obj1')[true()])[1] > should return the first node that matches the key (if such) when in fact it > returns the source document root. > test case: > ---------- > XML: > <?xml version="1.0" encoding="UTF-8"?> > <objects> > <object name="obj1"/> > </objects> > XSL: > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="1.0"> > <xsl:output method="xml" encoding="UTF-8"/> > <xsl:key name="object" match="objects/object" use="@name"/> > <xsl:template match="/"> > <body> > <xsl:copy-of select="(key('object','obj1')[true()])[1]"/> > </body> > </xsl:template> > </xsl:stylesheet> > RESULT: > <?xml version="1.0" encoding="UTF-8"?> > <body> > <objects> > <object name="obj1"/> > </objects> > </body> > EXPECTED RESULT: > <?xml version="1.0" encoding="UTF-8"?> > <body> > <object name="obj1"/> > </body> > ---------------------------------------- > For automatically generated XSLT it is sometimes very difficult to avoid such > expressions from being generated - so just not using this kind of expressions > is not a good solution or workaround. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://nagoya.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
