Thanks for responding Harald. Hopefully this will help clarify.
I am passing an XQuery string into the class SoftwareAG.Tamino.Api.TaminoQuery(xquery)
The xquery looks like this:
declare namespace xlink=‘XLink namespace’
update for $dm in collection(‘COLLECTION_NAME’)/dmodule
let $dmc := $dm/idstatus/dmaddres/dmc
let $dmcagedash := zstring-join(($dmc/age/modelic,$dmc/age/supeqvc,$dmc/age/ecscs,$dmc/age/eidc,$dmc/age/cidc,$dmc/age/discode,$dmc/age/discodev,$dmc/age/incode,$dmc/age/incodev,$dmc/age/itemloc), ‘-’)
let $dmcaveedash := string-join(($dmc/avee/modelic,$dmc/avee/sdc,$dmc/avee/chapnum,$dmc/avee/section,$dmc/avee/subsect,$dmc/avee/subject,$dmc/avee/discode,$dmc/avee/discodev,$dmc/avee/incode,$dmc/avee/incodev,$dmc/avee/itemloc), ‘-’)
let $dmcdash := string-join(($dmcagedash ,$dmcaveedash), ‘’)
let $issno := string-join((string($dm/idstatus/dmaddres/issno/@issno), string($dm/idstatus/dmaddres/issno/@inwork)), ‘-’)
let $dmcdash_issno := string-join(($dmcdash, $issno), ‘_’)
let $old := $dm//content/descript/para0/subpara1/subpara2[3]/para/randlist/item[5]/text()[1]
let $new := element item{‘test update’} where $dmcdash_issno = ‘NSSMS-K-C2-0-0-00-03-A-161-A-Z_001-’
do (replace $old with $new)
This query (for simple xpaths) does work, its used for many other updates. The problem is that when you try to pass an XQuery to update ONLY the first “text” node of a “mixed content” node, the query fails.
Here’s an example of a path that works:
//content/descript/para0/subpara1/subpara2[3]/para/randlist/item[5]
…Which replaces all the content with the new value.
This does not work:
//content/descript/para0/subpara1/subpara2[3]/para/randlist/item[5]/text()[1]
… And it IS a fully qualified xpath pointing to only the first “text” node
The question is, why cant Tamino’s xquery engine understand “text()[N]”
and if its not Tamino, what would be the correct syntax?
Thanks again
#webMethods#Tamino#API-Management