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 » Use of Xpath to access XML tree within Java Node

Post new topic  Reply to topic
 Use of Xpath to access XML tree within Java Node « View previous topic :: View next topic » 
Author Message
jimc
PostPosted: Wed Mar 12, 2008 8:10 am    Post subject: Use of Xpath to access XML tree within Java Node Reply with quote

Newbie

Joined: 11 Mar 2008
Posts: 3

Hi,

I am creating a Java Node that will parse XML and translate to create a new message from scratch.

I was using XPATH to get a handle on elements I required. for example

List transactions = (List)inMessage.evaluateXPath("/Document/Chapter");
int count = transactions.size();


But I was never getting any values returned, so I printed the structure
using the following code and then displaying information in the new message.

String tagname = inRoot.evaluateXPath("*").toString();

However Xpath displayed is -below it seems to be showing the header info on message i.e
MbElement( type: 1000000 name: Properties )
MbElement( type: 1000000 name: MQMD )
MbElement( type: 1000000 name: MQRFH2 )

and not the XML structure i.e. Document/Chapter

<Document>
<Chapter>1</Chapter>
<Chapter>2</Chapter>
<Chapter>3</Chapter>
</Document>

Can anyone assist.

Thanks
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Mar 12, 2008 2:15 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I suspect that inRoot/inMessage is pointing at InputRoot. It should be pointing at InputRoot.XMLNSC ( assuming that you parsed the message using the XMLNSC domain ).
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 » Use of Xpath to access XML tree within Java Node
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.