ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Updating OutputRoot.XMLNSC using MBElement

Post new topic  Reply to topic
 Updating OutputRoot.XMLNSC using MBElement « View previous topic :: View next topic » 
Author Message
gappodi
PostPosted: Tue Apr 26, 2016 10:38 pm    Post subject: Updating OutputRoot.XMLNSC using MBElement Reply with quote

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..

<?xml version="1.0" encoding="UTF-8"?>
<CommandMessage>
<Metadata>
<PODInfo>
<Tracking>
<DocumentCodes>
<DocumentCode>473ab05f-0b01-11e6-a625-35be7142b59a</DocumentCode>
<DocumentCode>473ab05f-0b01-11e6-a625-35be7142b59a</DocumentCode>
<DocumentCode>473ab05f-0b01-11e6-a625-35be7142b59a</DocumentCode>

</DocumentCodes>
...
....
....


<CommandMessage>


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 ?
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Wed Apr 27, 2016 3:45 am    Post subject: Re: Updating OutputRoot.XMLNSC using MBElement Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 364
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.
Back to top
View user's profile Send private message
timber
PostPosted: Wed Apr 27, 2016 8:21 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

joebuckeye is correct.

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 )
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Updating OutputRoot.XMLNSC using MBElement
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.