[ http://issues.apache.org/jira/browse/XALANJ-1846?page=all ]

Brian Minchau updated XALANJ-1846:
----------------------------------

    Version: 2.6
                 (was: Latest Development Code)

> Assertion fails in set:difference (2 matching nodesets, one created by a key)
> -----------------------------------------------------------------------------
>
>          Key: XALANJ-1846
>          URL: http://issues.apache.org/jira/browse/XALANJ-1846
>      Project: XalanJ2
>         Type: Bug
>   Components: XPath
>     Versions: 2.6
>  Environment: Operating System: Windows NT/2K
> Platform: PC
>     Reporter: Pete Edwards
>     Assignee: Xalan Developers Mailing List

>
> I have found a problem that manifests itself in the set:difference extension
> function using Xalan 2.6.0. The error I get is
>   "Assertion fails: Can not get a DTM unless a DTMManager has been set"
> in org.apache.xpath.NodeSet.addNodes (line 441)
> In the sample below you get the exception, but it succeeds if you remove one 
> of 
> the continent elements from the input document. It seems to happen when the 
> two 
> sets in the difference are the same and one of them is produced using a key. 
> (It works if you simply difference two identical sets, or if the sets are 
> different)
> Example document:
>   <doc>
>     <continent>Europe</continent>
>   <!-- remove next line to see stylesheet succeed -->
>     <continent>Africa</continent>
>     <city name="Paris" continent="Europe"/>
>     <city name="Madrid" continent="Europe"/>
>     <city name="Cairo" continent="Africa"/>
>   </doc>
> Example stylesheet:
>   <xsl:stylesheet version="1.0"
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>     xmlns:set="http://exslt.org/sets";
>     xmlns:exsl="http://exslt.org/common";
>     extension-element-prefixes="set exsl"
>     exclude-result-prefixes="set exsl">
>     <xsl:key name="cityByContinent" match="//city" use="@continent"/>
>     <xsl:template match="/">
>       <out>
>         <xsl:variable name="continents" select="//continent"/>
>         <xsl:variable name="list"
>              select="key('cityByContinent', set:distinct($continents))"/>
>         <xsl:copy-of select="set:difference(//city, $list)"/>
>       </out>
>     </xsl:template>
>   </xsl:stylesheet>
> Please contact me if you need more info.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to