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 » Accessing XML elements with namespace

Post new topic  Reply to topic
 Accessing XML elements with namespace « View previous topic :: View next topic » 
Author Message
CHF
PostPosted: Mon Feb 28, 2005 6:41 am    Post subject: Accessing XML elements with namespace Reply with quote

Master

Joined: 16 Dec 2003
Posts: 297

We have a generic message flow which looks for a xml field value and based on the value it forwards the message to respective queue.

The problem I am facing is that, I want it to be generic (dynamic).

The XML have namespace, and the namespace can be anything... so how can I access the xml field without hardcoding the namespace.

XML can be anything

<abc:field1 xmlns:abc = "http://schemas.com/abc/">
<abc:sub-field1>value1</adc:sub-field1>
</abc:field1>

<def:field1 xmlns:def = "http://schemas.com/abc/">
<def:sub-field1>value1</def:sub-field1>
</def:field1>

I don't want to hard code something like
InputRoot.XML."abc:field1" .............

Is there a way to access the xml element... I am using WMQI 2.1

Any ideas??
_________________
CHF
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
jefflowrey
PostPosted: Mon Feb 28, 2005 6:48 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

2.1 doesn't really support namespaces properly anyway.

So treat it as a BLOB message, and use POSITION and SUBSTRING to find and extract what you want.

Or read about anonymous field references and FIELDNAME.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
CHF
PostPosted: Mon Feb 28, 2005 6:55 am    Post subject: Reply with quote

Master

Joined: 16 Dec 2003
Posts: 297

I am also thinking abt reading as a BLOB and look for the element....

What about WBIMB5, can I do anything on WBIMB5
_________________
CHF
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
jefflowrey
PostPosted: Mon Feb 28, 2005 7:48 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

CHF wrote:
What about WBIMB5, can I do anything on WBIMB5


You said you were using 2.1. But if you also have v5 available, then use that.

There was a posting here a few months ago about creating a dynamic namespace qualifier based on the namespace in the message. I don't recall how to do it, but a search should bring something up. Then you could hardcode your path using the qualifier like abcd, but not have a hardcoded value for what abcd maps to.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
CHF
PostPosted: Mon Feb 28, 2005 8:24 am    Post subject: Reply with quote

Master

Joined: 16 Dec 2003
Posts: 297

Thanks Jeff
_________________
CHF
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

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