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 the Root element name in a generic way using XMLNS

Post new topic  Reply to topic
 Accessing the Root element name in a generic way using XMLNS « View previous topic :: View next topic » 
Author Message
keenlearner
PostPosted: Thu Mar 22, 2007 4:24 am    Post subject: Accessing the Root element name in a generic way using XMLNS Reply with quote

Acolyte

Joined: 24 Aug 2006
Posts: 62

Hi Guys
i am using XMLNS paser to parse a XML message with namespaces.
my sample message looks like as below

Quote:
<Q1:QP_LIST_HEADERS_B
xmlns:Q1="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/QP_LIST_HEADERS_B" version="3.0.0" verb="Create" locale="en_US" delta="false">
<Q1:LIST_HEADER_ID>6018</Q1:LIST_HEADER_ID>
<Q1:CREATION_DATE>23/10/2006</Q1:CREATION_DATE>
<Q1:CREATED_BY>1116</Q1:CREATED_BY>


I want to access the root element name in a generic way. For eaxmple if we use XL parser we can do it as below
Code:
InputRoot.XML.(XML.Element)[1]


Can any one please let me know how to do it using XMLNS parser

I have tried

Code:
1.InputRoot.XMLNS.*:*[1];


Code:
Declare refInputRoot TO InputRoot.XMLNS;
Move refInputRoot LASTCHILD;
Back to top
View user's profile Send private message
sourdas2
PostPosted: Thu Mar 22, 2007 5:05 am    Post subject: Reply with quote

Voyager

Joined: 21 Apr 2006
Posts: 90
Location: Kolkata,India

Use
Code:

FIELDNAME(InputRoot.XMLNS.(XML.Element)[1])
[/code]
_________________
Thanks and Warm Regards
Sourav
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
jefflowrey
PostPosted: Thu Mar 22, 2007 5:42 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Also,
Code:
InputRoot.XMLNS.(XML.Element)[1]


It's only when you get to XMLNSC that you have to change things like XML.Element or XML.Attribute.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
keenlearner
PostPosted: Thu Mar 22, 2007 9:32 pm    Post subject: Reply with quote

Acolyte

Joined: 24 Aug 2006
Posts: 62

Thanks a lot for your help. It works
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 the Root element name in a generic way using XMLNS
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.