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 » How to navigate to every field value in an XML ?

Post new topic  Reply to topic Goto page 1, 2  Next
 How to navigate to every field value in an XML ? « View previous topic :: View next topic » 
Author Message
my_mqmb
PostPosted: Tue Dec 22, 2015 12:07 am    Post subject: How to navigate to every field value in an XML ? Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

I have requirement of navigating to every XML tag's value if it and doing some operation on it , like searching for a character in it ?

How to navigate and reach every value ? What is the best suggested approach ?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Dec 22, 2015 12:25 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

How about a Mapping node?
Not the easiest solution to code for but will (IMHO) be the best.
You will soon become an xpath expert!!!!!

But honestly, the requirement sounds rather dumb.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
maurito
PostPosted: Tue Dec 22, 2015 12:28 am    Post subject: Re: How to navigate to every field value in an XML ? Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

my_mqmb wrote:
I have requirement of navigating to every XML tag's value if it and doing some operation on it , like searching for a character in it ?

How to navigate and reach every value ? What is the best suggested approach ?

There is a procedure called 'navigate' in the product documentation which does just that. You will need to modify it to adapt it to your needs. Search for CREATE PROCEDURE and look at the examples
Back to top
View user's profile Send private message
timber
PostPosted: Tue Dec 22, 2015 1:48 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

What is the business requirement behind this technical requirement?
Back to top
View user's profile Send private message
my_mqmb
PostPosted: Tue Dec 22, 2015 3:51 am    Post subject: Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

I need to check for any non English character in any tags value and then change the encoding accordingly .
Back to top
View user's profile Send private message
maurito
PostPosted: Tue Dec 22, 2015 4:38 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

my_mqmb wrote:
I need to check for any non English character in any tags value and then change the encoding accordingly .


And what is your definition of "non English character" ?
Back to top
View user's profile Send private message
my_mqmb
PostPosted: Tue Dec 22, 2015 5:17 am    Post subject: Reply with quote

Voyager

Joined: 08 Jun 2011
Posts: 84

maurito wrote:


And what is your definition of "non English character" ?



Sometimes we are getting arabic characters in the data .
I need to scan through the entire XML . I am looking for the navigate procedure too as you suggested .

I noticed in that procedure the xml tag value are always of the type 33554432

Reached Field... Type:33554432

any clue ? Can i use FIELDTYPE = 33554432 to browse only tag values while drilling down all through the XML ?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 22, 2015 5:35 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

my_mqmb wrote:
any clue ? Can i use FIELDTYPE = 33554432 to browse only tag values while drilling down all through the XML ?


You're better off using the actual constant values rather than the numeric equivalents.

The section "Field types for Path expressions" is the most relevant for you.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
maurito
PostPosted: Tue Dec 22, 2015 5:40 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

Vitor wrote:
my_mqmb wrote:
any clue ? Can i use FIELDTYPE = 33554432 to browse only tag values while drilling down all through the XML ?


You're better off using the actual constant values rather than the numeric equivalents.

The section "Field types for Path expressions" is the most relevant for you.

or even better, understand about CCSIDs and code pages. Talk to whoever gave you the requirement and ask what is the code page of the data coming in.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 22, 2015 5:44 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

maurito wrote:
or even better, understand about CCSIDs and code pages. Talk to whoever gave you the requirement and ask what it the code page of the data coming in.




What are you doing with these Arabic characters when you find them? What are you changing them to?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Dec 22, 2015 6:22 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

If you really want to look at every character - why not process the message as a BLOB - convert the blob to a string - use the very good string handling functions in ESQL to do whatever you want, then put it back to BLOB and use a RCD node to re-parse it as XML.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
maurito
PostPosted: Tue Dec 22, 2015 6:29 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

zpat wrote:
If you really want to look at every character - why not process the message as a BLOB - convert the blob to a string - use the very good string handling functions in ESQL to do whatever you want, then put it back to BLOB and use a RCD node to re-parse it as XML.


Because a 'character' could be 1 , 2 or 3 bytes long ( and being Arabic , probably are ), and how would the OP know ?
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Dec 22, 2015 6:36 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

When I say character, I mean each byte.

I assume the OP knows what he is looking for?
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
maurito
PostPosted: Tue Dec 22, 2015 6:43 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

zpat wrote:
When I say character, I mean each byte.

I assume the OP knows what he is looking for?


so let's suppose the input contains the euro currency sign, in UTF-8 = x'e282ac' , what are you proposing to do by looking at the bytes individually ?
x'e2' = a with a circumflex accent in ascii.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 22, 2015 12:17 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Guys, let's not get ahead of ourselves. Obviously there is a completely flawed technical requirement here that has its origin in a business requirement none of us understands.

Let the OP give us the business requirement and maybe we can offer some type of solution...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to navigate to every field value in an XML ?
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.