I am trying to replace a node in an xml using the following code
String xquery_replace="xquery replace node CIDEM/ShopFloor/foo[/CIDEM/ShopFloor/ShopFloorID=1] with "+new_gbXML;
session.execute(xquery_replace);
So i want for example to change the foo node of the first ShopFloor node
The xml has the following content
<CIDEM>
<ShopFloor>
<ShopFloorID>1</ShopFloorID>
<foo bar="2">
<baz>there</baz>
</foo>
</ShopFloor>
<ShopFloor>
<ShopFloorID>2</ShopFloorID>
<foo bar="5">
<baz>there</baz>
</foo>
</ShopFloor>
</CIDEM>
And I am receiving the following error "[XUTY0008] Single element, text, attribute, comment or pi expected as replace target."
Any idea why?
CIDEM/ShopFloor[ShopFloorID="1"]/foo
when addressing thefoo
node of the FIRSTShopFloorID
– John