XPTY0019 error in basex 6.2.7 that did not appear in 6.2.3
This query:
declare variable $metadata as xs:anyAtomicType :=
doc('libx2_meta')/metadata;
let $roots := $metadata/roots[@document="libx2_feed"]/id
return ...produces
[XPTY0019] Context node required for roots[@document = "libx2_feed"]; xs:untypedAtomic found.
in BaseX 6.2.7, but it works in 6.2.3
Is this correct?
Substituting the declare variable with a let $metadata := ... works, so no showstopper here.
On a related note, declaring a function "as xs:anyAtomicType()*" behaves differently in 6.2.7 than in 6.2.3. I suppose the correct semantics for this is to cast the result to an anyAtomicType; 6.2.3 did not do that but 6.2.7 does.
- Godmar
Hi again...
Quoted text · Godmar Back · 3 lines
Am 25.09.2010 19:15, schrieb Godmar Back: > declare variable $metadata as xs:anyAtomicType := > doc('libx2_meta')/metadata;
As you are querying the *element* metadata, the result can't be atomic (see [1]). Seems like BaseX 6.2.3 didn't do enough type checks so that could slip through.
Quoted text · Godmar Back · 3 lines
> declare variable $metadata as node() := ... or just > declare variable $metadata := ...
would also du what you want.
Quoted text · Godmar Back · 4 lines
> On a related note, declaring a function "as xs:anyAtomicType()*" behaves > differently in 6.2.7 than in 6.2.3. I suppose the correct semantics for > this is to cast the result to an anyAtomicType; 6.2.3 did not do that > but 6.2.7 does.
Sounds plausible, but I'd have to read the specs to be sure...
Cheers Leo __________ [1] http://www.w3.org/TR/xpath-datamodel/#types-hierarchy
Quoted text · Leonard Wörteler · 2 lines
Am 25.09.2010 23:12, schrieb Leonard Wörteler: > would also du what you want.
sed 's/du/do'
Leo
2010/9/25 Leonard Wörteler <leonard.woerteler at uni-konstanz.de>
Quoted text · Leonard Wörteler · 8 lines
> Hi again... > > Am 25.09.2010 19:15, schrieb Godmar Back: > > declare variable $metadata as xs:anyAtomicType := > > doc('libx2_meta')/metadata; > > As you are querying the *element* metadata, the result can't be atomic >
I realized that. I think the person writing the queries was confused about what atomic meant. Still, 6.2.3 did not do those type checks/conversions.
- Godmar
Written for BaseX 6. BaseX may have changed since: please check the current documentation.