Posted: Tue Apr 26, 2016 10:38 pm Post subject: Updating OutputRoot.XMLNSC using MBElement
Voyager
Joined: 05 Sep 2014 Posts: 76
I have a scenario where I need to create an XMLNSC where a tag may repeat. For e.g. a portion of whole XMLNSC (with repeating elements) will look as following..
I am trying to use evaluateXPath(String paramString) from com.ibm.broker.plugin.MBElement API where the paramString is CommandMessage/Metadata/PODInfo/Tracking/DocumentCodes/DocumentCode[2][set-value('528beddc-0c83-11e6-a625-35be7142b59a')]
But this does not evaluate properly and I always end up in getting a single <DocumentCode> in my output XMLNSC. Is there anything wrong the way I am setting up XPath?
Posted: Wed Apr 27, 2016 3:45 am Post subject: Re: Updating OutputRoot.XMLNSC using MBElement
Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
gappodi wrote:
I am trying to use evaluateXPath(String paramString) from com.ibm.broker.plugin.MBElement API where the paramString is CommandMessage/Metadata/PODInfo/Tracking/DocumentCodes/DocumentCode[2][set-value('528beddc-0c83-11e6-a625-35be7142b59a')]
But this does not evaluate properly and I always end up in getting a single <DocumentCode> in my output XMLNSC. Is there anything wrong the way I am setting up XPath?
Can someone please provide help here ?
Your Xpath is explicitly asking for the 2nd DocumentCode element.
Also, your chosen approach is probably the most difficult of all the options. Other options include:
- a Compute node with
Code:
SET OutputRoot.XMLNSC.CommandMessage.Metadata.PODInfo.Tracking.DocumentCodes.DocumentCode[2] = '528beddc-0c83-11e6-a625-35be7142b59a';
- A JavaCompute node using XPath to find the parent node, and createElementAsLastChild(...) to create the DocumentCode elements.
- A JavaCompute node programmed using JAXB classes ( requires you to have an XSD for the output message )
- A Mapping node that sets the value using an Assign transformation ( requires you to have an XSD for the output message )
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum