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 » add value to XMLNSC.Attribute

Post new topic  Reply to topic
 add value to XMLNSC.Attribute « View previous topic :: View next topic » 
Author Message
mpong
PostPosted: Tue Jun 14, 2016 1:11 am    Post subject: add value to XMLNSC.Attribute Reply with quote

Disciple

Joined: 22 Jan 2010
Posts: 164

Hello All,

Requirement is to generate a output as below but I am yet to get thru.

<param name="InputValue">test</param>

Here is what I have tried:

1) [code]SET Myreference.param.(XMLNSC.Attribute)name='InputValue';[/code]

O/P: <param name="InputValue"></param>

2) [code]SET Myreference.param.(XMLNSC.Attribute)name='InputValue' value=inRef.FieldName;[/code]
SYNTAX ERROR

3) [code]SET Myreference.param.(XMLNSC.Attribute)"name='InputValue' " value=inRef.FieldName;[/code]

O/P:<param name='InputValue'="test"</param>

The output is not the expected one. Please suggest what am I missing here.
Back to top
View user's profile Send private message
mpong
PostPosted: Tue Jun 14, 2016 1:47 am    Post subject: Reply with quote

Disciple

Joined: 22 Jan 2010
Posts: 164

Resolved:

First I have to set the value to param and then adding attributes is solved the issue.

Thanks!
Back to top
View user's profile Send private message
maurito
PostPosted: Tue Jun 14, 2016 2:11 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

mpong wrote:
Resolved:

First I have to set the value to param and then adding attributes is solved the issue.

Thanks!

yes, you need to SETs, one to set the Attribute of the element, the other to set the value of the element
Back to top
View user's profile Send private message
timber
PostPosted: Tue Jun 14, 2016 2:21 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

Quote:
you need two SETs, one to set the Attribute of the element, the other to set the value of the element
Not true. In ESQL you can simply write
Code:
Set OutputRoot.XMLNSC.rootTagName.(XMLNSC.Attribute)attrName = 'attributeValue';


If you're using Java, it's usually a little more complex, and you may need two separate statements. Unless you're smart and you use the JAXB option.
Back to top
View user's profile Send private message
maurito
PostPosted: Tue Jun 14, 2016 7:18 pm    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

timber wrote:
Quote:
you need two SETs, one to set the Attribute of the element, the other to set the value of the element
Not true. In ESQL you can simply write
Code:
Set OutputRoot.XMLNSC.rootTagName.(XMLNSC.Attribute)attrName = 'attributeValue';


If you're using Java, it's usually a little more complex, and you may need two separate statements. Unless you're smart and you use the JAXB option.


Yes, it is true.
Code:
Set OutputRoot.XMLNSC.rootTagName.(XMLNSC.Attribute)attrName = 'attributeValue';


That only sets the attribute value, and not the element value.
Code:

<rootTagName attrName="attributeValue"></rootTagName>

But if you want to set attribute value and element value you need to sets.


you also need

Code:

SET OutputRoot.XMLNSC.rootTagName VALUE = 'a value';

Code:

<rootTagName attrName="attributeValue">a value</rootTagName>
Back to top
View user's profile Send private message
timber
PostPosted: Wed Jun 15, 2016 5:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

Yes, you're quite right. I thought you were claiming that it's not possible to set the attribute value at the same time as specifying XMLNSC.Attribute. Sorry for the confusion.
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 » add value to XMLNSC.Attribute
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.