You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Henry Zongaro (JIRA)" <xa...@xml.apache.org> on 2004/12/16 17:07:14 UTC

[jira] Updated: (XALANJ-1846) Assertion fails in set:difference (2 matching nodesets, one created by a key)

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

Henry Zongaro updated XALANJ-1846:
----------------------------------

    Priority: Major

> Assertion fails in set:difference (2 matching nodesets, one created by a key)
> -----------------------------------------------------------------------------
>
>          Key: XALANJ-1846
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-1846
>      Project: XalanJ2
>         Type: Bug
>   Components: XPath
>     Versions: CurrentCVS
>  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://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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org