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 » Having trouble with Positional Fields within XML...

Post new topic  Reply to topic
 Having trouble with Positional Fields within XML... « View previous topic :: View next topic » 
Author Message
saini
PostPosted: Tue Sep 20, 2005 2:38 pm    Post subject: Having trouble with Positional Fields within XML... Reply with quote

Novice

Joined: 28 Feb 2002
Posts: 24

I have an interesting problem! I have a requirement to generate the following XML in a compute node.

<Test>
<F1>test1</F1>
<F2>test2</F2>
<F1>test3</F1>
<F2>test4</F2>
</Test>

No matter what I try I get the following XML:
<Test>
<F1>test1</F1>
<F1>test3</F1>
<F2>test2</F2>
<F2>test4</F2>
</Test>

I know both the above XML's are the same (non positional), however, Is there a way to force the parser to produce the 1st output.
I am using MB 5 with CSD5 on windows 2000 server. Is there even a way to override default behaviour?

Thanks for any help.
Best Regards,
NS
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Sep 20, 2005 7:46 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

R u using a message set ??

Can you show us your code ??
Back to top
View user's profile Send private message Send e-mail
saini
PostPosted: Wed Sep 21, 2005 3:28 am    Post subject: Reply with quote

Novice

Joined: 28 Feb 2002
Posts: 24

I have tried:

SET OutputRoot.XML.Test.F1 = 'test1';
SET OutputRoot.XML.Test.F2 = 'test2';
SET OutputRoot.XML.Test.F1[2] = 'test3';
SET OutputRoot.XML.Test.F2[2] = 'test4';

I also tried:

SET OutputRoot.XML.Test.F1 = 'test1';
CREATE NEXTSIBLING OF OutputRoot.XML.Test.F1 TYPE NameValue NAME 'F2' Value 'test2';
SET OutputRoot.XML.Test.F1[2] = 'test3';
CREATE NEXTSIBLING OF OutputRoot.XML.Test.F1[2] TYPE NameValue NAME 'F2' Value 'test4';
Back to top
View user's profile Send private message
mgk
PostPosted: Wed Sep 21, 2005 3:40 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi,

why not do this [not tested]:

Code:
CREATE FIELD OutputRoot.XML.Test ;

DECLARE myRef REFERENCE TO OutputRoot.XML.Test ;

CREATE LASTCHILD OF myRef TYPE NameValue NAME 'F1' Value 'test1';
CREATE LASTCHILD OF myRef TYPE NameValue NAME 'F2' Value 'test2';
CREATE LASTCHILD OF myRef TYPE NameValue NAME 'F1' Value 'test3';
CREATE LASTCHILD OF myRef TYPE NameValue NAME 'F2' Value 'test4';


This will create the elements in the order specified

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Sep 21, 2005 4:16 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Shouldn't this itself work

SET OutputRoot.XML.Test.F1[1] = 'test1';
SET OutputRoot.XML.Test.F1[2] = 'test3';
SET OutputRoot.XML.Test.F2[1] = 'test2';
SET OutputRoot.XML.Test.F2[2] = 'test4';

Saini, from ur first snippet of code I would like to say that "the order you want the output in, is the order in which to code the fields"

Regards.
Back to top
View user's profile Send private message Send e-mail
javaforvivek
PostPosted: Wed Sep 21, 2005 4:19 am    Post subject: Reply with quote

Master

Joined: 14 Jun 2002
Posts: 282
Location: Pune,India

I have given the answer elsewhere :
http://www.mqseries.net/phpBB2/viewtopic.php?t=23916
_________________
Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
saini
PostPosted: Wed Sep 21, 2005 4:27 am    Post subject: Reply with quote

Novice

Joined: 28 Feb 2002
Posts: 24

The following worked:

CREATE FIELD OutputRoot.XML.Test;
DECLARE myREF REFERENCE TO OutputRoot.XML.Test;
CREATE LASTCHILD OF myREF TYPE Name NAME 'F1';
CREATE LASTCHILD OF myREF TYPE Name NAME 'F2';
CREATE LASTCHILD OF myREF TYPE Name NAME 'F1';
CREATE LASTCHILD OF myREF TYPE Name NAME 'F2';
SET myREF.F1 = 'test1';
SET myREF.F2 = 'test2';
SET myREF.F1[2] = 'test3';
SET myREF.F2[2] = 'test4';


Thanks to MGK for the suggestion!
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 » Having trouble with Positional Fields within XML...
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.