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 » XML Question

Post new topic  Reply to topic
 XML Question « View previous topic :: View next topic » 
Author Message
lung
PostPosted: Tue Aug 27, 2002 1:27 am    Post subject: XML Question Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Hi.

I am new to WMQI, and I have a question on XML messages.

Here is the scenario...

I have multiple XML messages, each tagged with a different XML root name. However, each of these messages share a similarity in having the same fields under a particular 'header'.

Here is the structure of the message...

<XMLRootName> <-- Different for all my XML messages
<Header> <-- Same
<TCode>01</TCode> <-- Same
...
...
...

Here is the problem. I am trying to access the TCode value in the message, but how do I so? I understand that usually it will just be 'XMLRootName.Header.TCode', but it does not work in this case since all my messages are having different XML root names!

I have tried 'InputBody.*[1].Header.TCode' and it works. However, it will not work when there are additional fields before the XML root name (this applies to those '<?xml version="1.0"?>' and '<!--MRM Generated XML Output on...--> fields).

So how do I address this issue? Is there an alternative method?

Thanks.
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
lillo
PostPosted: Tue Aug 27, 2002 3:51 am    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

Try the following code 'InputBody.*[LAST].Header.TCode'

I hope this help you.

Cheers,
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
Back to top
View user's profile Send private message
lung
PostPosted: Tue Aug 27, 2002 4:50 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

lillo wrote:
Try the following code 'InputBody.*[LAST].Header.TCode'


But that will point to the last field in the message. I'm trying to point to the first field under 'header'. Thanks.
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
lillo
PostPosted: Tue Aug 27, 2002 9:54 pm    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

You are right, InputBody.*[LAST] will point to the last field in the XML message. Let see an example without header and with header.

1.- Without header: your message should look like
<XMLRootName> <-- Different for all my XML messages
<Header> <-- Same
<TCode>01</TCode> <-- Same
...
...
</XMLRootName>

Then InputBody.*[LAST] will refer to XMLRootName

2.- With header: your message should look like
<?xml version="1.0"?>
<XMLRootName> <-- Different for all my XML messages
<Header> <-- Same
<TCode>01</TCode> <-- Same
...
...
</XMLRootName>

Then InputBody.*[LAST] will refer again to XMLRootName

I hope this clarify you something. Tell me if it does not help you.

Cheers,
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
Back to top
View user's profile Send private message
lung
PostPosted: Tue Aug 27, 2002 10:42 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

lillo,

Thanks for trying to help me here, but...
I am trying to refer to the 'TCode' field, not the 'XMLRootName'.

<?xml version="1.0"?> <-- may not be present in message
<XMLRootName>
<Header>
<TCode>01</Tcode> <-- present in all messages, i am trying to refer to this field
</Header>
... <-- all the other fields in the message, varies in length for all the messages
...
...
</XMLRootName>

So I don't think I can use InputBody.*[LAST] here...
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
lung
PostPosted: Tue Aug 27, 2002 10:48 pm    Post subject: Reply with quote

Master

Joined: 27 Aug 2002
Posts: 291
Location: Malaysia

Wait a minute...
lillo, I think I get what you mean.

I can use InputBody.*[LAST].Header.TxnCode , right?

Gotta try this now! Thanks!!
_________________
lung
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML Question
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.