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 attributes in namespace assigned XML -> Sol

Post new topic  Reply to topic
 Accessing XML attributes in namespace assigned XML -> Sol « View previous topic :: View next topic » 
Author Message
Rodeo
PostPosted: Wed Apr 11, 2007 8:47 am    Post subject: Accessing XML attributes in namespace assigned XML -> Sol Reply with quote

Apprentice

Joined: 11 Apr 2007
Posts: 30

I am trying to access an attribute inside an XML document that has namespace assigned. The structure of XML put on the queue is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:EXPERIMENT xmlns:ns0="http://www.yahoo.com">
<RESULT>
<RESPONSE1>POSITIVE</RESPONSE1>
<RESPONSE2>NEGATIVE</RESPONSE2>
<ID>1</ID>
</RESULT>
</ns0:EXPERIMENT>

I tried the following in ESQL code in the filter node. :

DECLARE sp1 NAMESPACE "http://www.yahoo.com"

IF Root.XMLNSC.sp1:EXPERIMENT.sp1:RESULT.sp1:ID1 = '1' THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;

It doesn't access the field and returns false. This is with XMLNSC parser.

Any thoughts or suggestions?


Last edited by Rodeo on Wed Apr 11, 2007 11:02 am; edited 2 times in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Apr 11, 2007 8:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Only your EXPERIMENT element is qualified with the namespace, none of the child elements are.

Also there are no "attributes" in that XML, only elements.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Rodeo
PostPosted: Wed Apr 11, 2007 10:29 am    Post subject: Reply with quote

Apprentice

Joined: 11 Apr 2007
Posts: 30

Thanks Jefflowrey. That worked. Yup there are only elements in the XML and no attributes. sorry.
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 » Accessing XML attributes in namespace assigned XML -> Sol
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.