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 » Find XML tag in XML Tree

Post new topic  Reply to topic
 Find XML tag in XML Tree « View previous topic :: View next topic » 
Author Message
Feysn
PostPosted: Mon Aug 08, 2005 11:30 pm    Post subject: Find XML tag in XML Tree Reply with quote

Apprentice

Joined: 04 Jun 2004
Posts: 33
Location: Wilrijk

Anyone who knows how to find a Tag in a XML tree without knowing where it is, without knowing the structure of the tree.

Can it be done with a Select statement or do I really have to browse through the whole tree to find it. And how should that select statement then look like.


Remark: The XML structure mostly is with large namespaces (SAP idoc's).

Thanks A lot for the help
Back to top
View user's profile Send private message Visit poster's website
elvis_gn
PostPosted: Tue Aug 09, 2005 12:28 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

I don't think that is possible.

If you go for a select you will have to go to each child complex tag and check if it has the simple tag. That is a hectic job.

IF you are interested in getting the values within the tags only, then I suggest you use the BLOB, do a BLOB to String, and do a Substring to find the tag and the value between the first occurance of > and < after your tag....

Save this to the local environment and then send it to compute with MRM domain....

I dont know if this is a great idea but i guess it can work...U could wait for a better solution....which I am equally interested in...
Back to top
View user's profile Send private message Send e-mail
Feysn
PostPosted: Tue Aug 09, 2005 12:36 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jun 2004
Posts: 33
Location: Wilrijk

Thanks a lot elvis_gn,

The reason I asking is because I initially wanted to store the XPATH in a database then i could browse to the element. But I in case of an xml document with large namespace it is not workable.

Code:
 

SET Environment.XPATH[] =(SELECT XPATH FROM database.table )

EVAL('SET OutputRoot.Element = ' || Environment.XPATH[1 ...n ]||';');



If you should have smal MRM trees it is doable.

I also tried to dynamically declare Namespaces but within the eval statement you can't use DECLARE.
Back to top
View user's profile Send private message Visit poster's website
mgk
PostPosted: Tue Aug 09, 2005 1:14 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

You can use DECLARE within the EVAL statement, you just have to have multiple lines of ESQL within the same EVAL statement.
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
Feysn
PostPosted: Tue Aug 09, 2005 1:44 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jun 2004
Posts: 33
Location: Wilrijk

mgk wrote:
You can use DECLARE within the EVAL statement, you just have to have multiple lines of ESQL within the same EVAL statement.


Can you give an example because I tried the following

Code:
 

-- SELECT NSNAME, NS  FROM Table in database

-- Loop through Namespaces

EVAL ('DECLARE ' ||  NSNAME || ' NAMESPACE ''' || NS || ''';');



And this didn't work. In the debugger It jumped back to the CREATE module line did nothing and then went allong with the following statement.
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Tue Aug 09, 2005 3:36 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Mgk's point was that the declare is only valid within the scope of the eval statement. So you would have to include all statements that use the namespace inside the eval.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Feysn
PostPosted: Tue Aug 09, 2005 3:41 am    Post subject: Reply with quote

Apprentice

Joined: 04 Jun 2004
Posts: 33
Location: Wilrijk

jefflowrey, thanks I'll try it right away
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

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