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... 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.
declare variable $metadata as node() := ... or just declare variable $metadata := ... would also du what you want.
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
2010/9/25 Leonard Wörteler <leonard.woerteler@uni-konstanz.de>
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
participants (2)
-
Godmar Back -
Leonard Wörteler