I am trying to update a single value within an attribute containing XML using the value from another attribute. Below i am trying to update the value within LOV_TYPE to be "Corp Yard" (which is coming from an existing attribute. This is a snippet from the XML of which there are dozens of CUSTOMFIELD entities that are defined by the PROPERTYCODE.
I am totally new to XQuery and am using the XMLXQueryUpdater with the below settings:
XQuery Input: XQuery Expression
XQuery Expression:
for $node in attribute {fme:get-attribute("XML")}//CUSTOMFIELD where $node/PROPERTYCODE = "OWN-ORG" return (replace value of node $node/LOVSETTINGS/LOV_TYPE with {fme:get-attribute("New_Own_Org")},)
XML Input; Attribute specifying XML
XML Attribute: XML
Any help would be much appreciated.
<ns23:CUSTOMFIELD index="30" entity="OBJ" type="RENT">
<ns23:PROPERTYCODE>OWN-ORG</ns23:PROPERTYCODE>
<ns23:PROPERTYLABEL>Owning Organization</ns23:PROPERTYLABEL>
<ns23:CLASSID>
<ns23:CLASSCODE>*</ns23:CLASSCODE>
<ns23:ORGANIZATIONID>
<ns23:ORGANIZATIONCODE>*</ns23:ORGANIZATIONCODE>
</ns23:ORGANIZATIONID>
</ns23:CLASSID>
<ns23:ENTITYCODEFIELD entity="QUAL">
<ns23:CODEVALUE/>
</ns23:ENTITYCODEFIELD>
<ns23:LOVSETTINGS>
<ns23:LOV_TYPE>Engineering</ns23:LOV_TYPE>
<ns23:LOV_VALIDATE>+</ns23:LOV_VALIDATE>
</ns23:LOVSETTINGS>
</ns23:CUSTOMFIELD>