> Yes. But my question is : why did the BaseX compiler ran the query let $idd
> := $elt[d]/@id ?

The query is valid, because $elt could have an element named d. For
example, the following query returns the value of $elt:

  let $elt := <u><d/></u>
  return $elt[d]

Does this help?
Christian



> Shouldn't it raise a compilation error ?
>
>
>
> 2017-10-09 17:49 GMT+02:00 Christian Grün <christian.gr...@gmail.com>:
>>
>> Dear Jean-Marc,
>>
>> > let $idd := $elt[d]/@id
>>
>> Shouldn’t it be '$d' instead of 'd' ?
>>
>>   let $idd := $elt[$d]/@id
>>
>> Cheers,
>> Christian
>>
>>
>>
>> > return ($elt[$d]/@id,$idd)
>> >
>> > output : id="yolo".
>> >
>> > (Hence missing the second "yolo", because the correct query is : let
>> > $idd :=
>> > $elt[$d]/@id)
>> >
>> > However I can't figure out why the BaseX compiler ran this query ?
>> > Shouldn't
>> > it refused the compilation and point out this error ?
>> >
>> > Cheers,
>> >
>> > Jean-Marc
>> >
>> >
>> >
>
>

Reply via email to