xml - How to convert a element node to document in xquery -


i have xml.

let $a := <a>              <b>asd</b>              <c>bvn</c>           </a> 

if give return $a/a/b not work element node.

so need convert element node document node. in order make work.

i cant change xpath. anyway result using same xpath '/a/b'?

you can create document node if need to

let $a := <a>              <b>asd</b>              <c>bvn</c>           </a> let $a := document{$a} return $a/a/b 

or directly

let $a := document {             <a>                 <b>asd</b>                 <c>bvn</c>             </a>             }  return $a/a/b 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -