Contents tagged with Hack

  • Retrieving position() value of node by using XQuery alone

    You can only use the position() function within an xquery predicate and can't use it to return the position value of the node itself, which is a shame, but a couple of good workarounds have been published. However I had a requirement (don't ask why!) to return the position() of the node as a value within the xml itself.

    My requirement was to return an existing xml structure but to also include the position of a particular node as an additional attribute of that node. My other goal was to keep …