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

RE: XSLT key() - Saxon UnsupportedOperationException

Subject: RE: XSLT key() - Saxon UnsupportedOperationException
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 17 Jan 2003 19:04:23 -0000
xslt key document
This is a known bug in Saxon 6.5.2: see
http://sourceforge.net/tracker/index.php?func=detail&aid=601804&group_id
=29872&atid=397617

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Philippe Drix
> Sent: 17 January 2003 14:44
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  XSLT key() - Saxon UnsupportedOperationException
> 
> 
> Hi,
> I have a problem with evaluation of key() fonction.
> 
> I think my problem is a XSLT problem, not a Saxon bug, but 
> here the exception :
> 
> 
> 
> java.lang.UnsupportedOperationException: Cannot create 
> intensional node-set 
> with context dependencies:
> class com.icl.saxon.expr.PathExpression:128
>          at 
> com.icl.saxon.expr.NodeSetIntent.<init>(NodeSetIntent.java:26)
>          at 
> com.icl.saxon.expr.PathExpression.reduce(PathExpression.java:186)
>          at 
> com.icl.saxon.expr.PathExpression.enumerate(PathExpression.java:219)
>          at 
> com.icl.saxon.expr.NodeListExpression.enumerate(NodeListExpres
> sion.java:80)
>          at com.icl.saxon.style.XSLForEach.process(XSLForEach.java:69)
>          at 
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.
> java:630)
>          at com.icl.saxon.style.XSLForEach.process(XSLForEach.java:96)
>          at 
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.
> java:630)
>          at 
> com.icl.saxon.style.LiteralResultElement.process(LiteralResult
> Element.java:281)
>          at 
> com.icl.saxon.style.StyleElement.processChildren(StyleElement.
> java:630)
>          at 
> com.icl.saxon.style.XSLGeneralVariable.getSelectValue(XSLGener
> alVariable.java:235)
>          at 
> com.icl.saxon.style.XSLVariable.process(XSLVariable.java:89)
>          at 
> com.icl.saxon.style.XSLStyleSheet.process(XSLStyleSheet.java:626)
>          at 
> com.icl.saxon.Controller.transformDocument(Controller.java:1065)
>          at com.icl.saxon.Controller.transform(Controller.java:939)
>          at com.icl.saxon.StyleSheet.processFile(StyleSheet.java:516)
>          at com.icl.saxon.StyleSheet.doMain(StyleSheet.java:338)
>          at 
> com.icl.saxon.StyleSheet.main(StyleSheet.java:63)
> 
> 
> 
> The XSLT program is below. I have two XML documents, and a key to 
> construct, matching elements coming from these two documents.
> 
> 
> <xsl:variable name="styles" select="document( $stylesPathName )"/>
> 
> <xsl:key name="groupesdeFieldsParNom"
>           
> match="$styles/office:document-styles/office:master-styles/sty
> le:master-page//text:bookmark-ref/@text:ref-name" 
> 
>           use="." />
> 
> <xsl:key name="groupesdeFieldsParNom"
>           
> match="/office:document-content/office:body//text:bookmark-ref
> /@text:ref-name" 
> 
>           use="." />
> 
> 
> <xsl:variable name="theFields">
>      <fields>
>          <xsl:for-each select="
>              
> /office:document-content/office:body//text:bookmark-ref/@text:
ref-name[
>                generate-id() =
>                generate-id(
>                   key('groupesdeFieldsParNom', .)[1]
>                )
>              ]">
>              <xsl:copy-of select="parent::*"/>
>          </xsl:for-each>
> 
>          <xsl:for-each select="
>              
> $styles/office:document-styles/office:master-styles/style:mast
> er-page//text:bookmark-ref/@text:ref-name[
>                generate-id() =
>                generate-id(
>                   key('groupesdeFieldsParNom', .)[1]
>                )
>              ]">
>              <xsl:copy-of select="parent::*"/>
>          </xsl:for-each>
>      </fields>
> </xsl:variable>
> 
> 
> I think the problem arises on a call to key(), because the 
> context node is 
> not already known, while key() needs this context node, to 
> know what XML 
> tree is to be visited.
> 
> I tried some workarounds, without success. I guess I will 
> have to find out 
> another resolution method, but perhaps there is indeed a 
> workaround that I 
> have not already thought about.
> 
> Any idea ?
> 
> Regards -- Ph D
> 
> 
> 
> 
> ==
> Philippe Drix
>       ___________
> __| OBJECTIVA |___________________
> http://www.objectiva.fr
> 21-23, rue Aristide Briand - 92170 Vanves
> tel : +33 1 47 36 60 30
> fax : +33 1 47 36 61 93
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.