Project

Profile

Help

Incorrect XQTY0024 error condition?

Added by Anonymous almost 19 years ago

Legacy ID: #3279544 Legacy Poster: marcvc (marcvc)

Michael, With Saxon 8.5, consider the following query: let $a1 := attribute a1 { "a1" } let $a2 := attribute a2 { "a2" } return <e>{ $a1 }{ $a2 }</e> It returns as expected: <e a1="a1" a2="a2"/> Adding an additional let-clause: let $a1 := attribute a1 { "a1" } let $a2 := attribute a2 { "a2" } let $e := <e>{ $a1 }{ $a2 }</e> return $e Results in an error: XQTY0024: An attribute node (a2) cannot be created after the children of the containing element. Thanks, Marc


Replies (1)

RE: Incorrect XQTY0024 error condition? - Added by Anonymous almost 19 years ago

Legacy ID: #3279939 Legacy Poster: Michael Kay (mhkay)

This is a messy area. With the construct <a>{exp1}{exp2}</a> Saxon is actually generating an empty text node between the values of exp1 and exp2. It's not the same as <a>{exp1, exp2}</a> because no space is inserted in the case where both expressions produce atomic values. Then at run-time Saxon has to make sure the empty text node is ignored, and this isn't happening on one of the paths. A source fix is at https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1251889&amp;group_id=29872&amp;atid=397617 MK

    (1-1/1)

    Please register to reply