Project

Profile

Help

inconsistency of instance of versus treat as

Added by Anonymous over 19 years ago

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

Michael, consider the following xquery: fn:root(<e/>) treat as document-node() , fn:root(<e/>) instance of document-node() It evaluates to <e/>, false Actually I would have expected an error for the treat as expression. Thanks, Marc


Replies (2)

RE: inconsistency of instance of versus treat as - Added by Anonymous over 19 years ago

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

The subject line is probably misleading. I have the impression that some optimization assumes that fn:root returns a document node. Hence the treat as is not performed at runtime?

RE: inconsistency of instance of versus treat - Added by Anonymous over 19 years ago

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

It seems the signature of the root() function is incorrectly declared in StandardFunction.java (around line 527). It should read: e = register("root", Root.class, 0, 0, 1, Type.NODE_TYPE, StaticProperty.ALLOWS_ZERO_OR_ONE); Michael Kay

    (1-2/2)

    Please register to reply