This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3701 - fn-union-node-args-003
Summary: fn-union-node-args-003
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Ravindranath (Ravi) Chennoju
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-12 12:39 UTC by Tim Mills
Modified: 2010-03-16 15:53 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2006-09-12 12:39:04 UTC
$input-context/bib/book[3]/title | root($input-context/bib/book[3]/title)

fails static typechecking because root takes node()?, not node()*.
Comment 1 Andrew Eisenberg 2006-09-14 16:52:45 UTC
One way to allow this expression to pass staic type checking would be to filter the operand of fn:root:

$input-context/bib/book[3]/title | root(($input-context/bib/book[3]/title)[1])
Comment 2 Michael Kay 2006-09-14 17:02:56 UTC
>One way to allow this expression to pass staic type checking would be to filter
the operand of fn:root:

$input-context/bib/book[3]/title | root(($input-context/bib/book[3]/title)[1])

This really demonstrates worst possible practice. To get the query through static  cardinality checking, you change the expression in such a way that there is no cardinality checking at all, whether static or dynamic. If static type checking is going to encourage people to do this sort of thing, then it is a really bad idea.
Comment 3 Ravindranath (Ravi) Chennoju 2006-09-26 17:53:51 UTC
Fixed the test using fn:exactly-one function:
$input-context/bib/book[3]/title | root(fn:exactly-one($input-context/bib/book[3]/title))