Project

Profile

Help

Bug #1252

closed

Fatal error for example from the XQuery Specification

Added by Anonymous over 19 years ago. Updated about 12 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
XQuery conformance
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Legacy ID:
sf-1030451
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

SourceForge user: guggis

If you feed the XQuery engine with the recursion

example from section G.4 of the XQuery specification,

i.e. with

(: ----------------- snip ---------------------- :)

xquery version "1.0";

declare function local:swizzle($n as node()) as node()

{

typeswitch($n)

 case $a as attribute(color)

   return element color { fn:string($a) } 

 case $es as element(size) 

   return attribute size { fn:string($es) } 

 case $e as element() 

   return element 

     { fn:local-name($e) } 

     { for $c in $e/(* | @*) return local:swizzle($c) } 

 case $d as document-node() 

   return document 

     { for $c in $d/* return local:swizzle($c) } 

 default return $n 

};

(: ----------------- /snip ---------------------- :)

you get the following fatal error:

java.lang.IllegalStateException: Children of an

ExprInstruction must themselves be ExprInstructions

    at net.sf.saxon.instruct.Element.analyze

(Element.java:98)

    at net.sf.saxon.instruct.TraceInstruction.analyze

(TraceInstruction.java:171)

    at net.sf.saxon.expr.LetExpression.analyze

(LetExpression.java:55)

    at net.sf.saxon.expr.IfExpression.analyze

(IfExpression.java:75)

    at net.sf.saxon.expr.IfExpression.analyze

(IfExpression.java:76)

    at net.sf.saxon.expr.IfExpression.analyze

(IfExpression.java:76)

    at net.sf.saxon.expr.LetExpression.analyze

(LetExpression.java:55)

    at net.sf.saxon.query.XQueryFunction.compile

(XQueryFunction.java:81)

    at 

net.sf.saxon.query.StaticQueryContext.fixupGlobalFuncti

ons(StaticQueryContext.java:803)

    at net.sf.saxon.query.QueryParser.parseQuery

(QueryParser.java:89)

    at 

net.sf.saxon.query.QueryParser.makeXQueryExpression

(QueryParser.java:45)

    at 

net.sf.saxon.query.QueryProcessor.compileQuery

(QueryProcessor.java:145)

    at 

net.sf.saxon.query.QueryProcessor.compileQuery

(QueryProcessor.java:172)

    at net.sf.saxon.Query.doMain(Query.java:292)

    at net.sf.saxon.Query.main(Query.java:58)

Fatal error during transformation: Children of an

ExprInstruction must themselves be ExprInstructions


Files

swizzle.xq (9.56 KB) swizzle.xq Anonymous, 2004-09-18 20:29
Actions #1

Updated by Anonymous over 19 years ago

SourceForge user: mhkay

Logged In: YES

user_id=251681

This appears to be a duplicate of 981277.

There's bright yellow box on the "submit new bug" page that

asks you not to make an entry here except for confirmed

bugs. Apart from anything else, SourceForge is very

unreliable about notifying me of new entries in this section

(which is why it has taken several days for me to respond -

I only noticed the entry by chance). Please submit suspected

bugs using the saxon-help list or forum, or the "support

requests" tracker.

Michael Kay

Please register to edit this issue

Also available in: Atom PDF