XQuery vs X-Query: problems with ino:id.

Hi there,

I am using XQuery to replace some of many of old X-Queries. The problem I am getting now is that the nodes retrieved using XQuery will not have the attribute ino:id in the returned nodes. I know that it can be obtained using tf:getInoId(), but how do I append the ino:id attribute to the node?

See, an X-Query “/user” returns <user ino:id=1 …/>
Now, the equivalent XQuery: “for $b in input()/user return $b” will return <user …/>.

Is there any way I can still obtain the same node, say by appending the ino:id attribute to the $b variable?

Any suggestions?

Thanks.

– Juan

Hello Juan,

I see 2 possibilities:

1) wrapping element with ino:id e.g.
This is quite straightforward.
Here is an example:

declare namespace tf = "http://namespaces.softwareag.com/tamino/TaminoFunction"
declare namespace ino = "http://namespaces.softwareag.com/tamino/response2"

for $bib in input()/bib
return

{$bib}




2) adding ino:id to an existing element.
This is more complex, especially when it comes
to support special nodes like comments etc.
Here is an example:

declare namespace tf = "http://namespaces.softwareag.com/tamino/TaminoFunction"
declare namespace ino = "http://namespaces.softwareag.com/tamino/response2"

for $bib in input()/bib
return

{
($bib/, $bib/@)
}



Best regards
Walter

Thank you very much, that was what I needed!

– Juan