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 tag

Post new topic  Reply to topic
 accessing xml tag « View previous topic :: View next topic » 
Author Message
Lillian
PostPosted: Thu Dec 28, 2006 5:30 am    Post subject: accessing xml tag Reply with quote

Centurion

Joined: 15 Apr 2002
Posts: 102

Below is a trace output from a compute node. I need to access the surname field which is within an xml string of the element 'Tag'. ie an xml within an xml.

I am still using 2.1( busy with upgrade)
any ideas?

(0x1000010)XML = (
(0x1000000)Tag = (
(0x2000000) = '<?xml version="1.0" encoding="UTF-8"?>
<commissionStatement xmlns:srs="liberty/srs"> <surname>AAAAAAAAAA</surname>
</commissionStatement>'
Back to top
View user's profile Send private message
special_agent_Queue
PostPosted: Thu Dec 28, 2006 5:42 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

What have you tried?
Back to top
View user's profile Send private message
Lillian
PostPosted: Thu Dec 28, 2006 5:51 am    Post subject: Reply with quote

Centurion

Joined: 15 Apr 2002
Posts: 102

I am currenting substringing using the posion of the tag name. Just wondering if there is a cleaner way
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Dec 28, 2006 6:11 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That's not valid XML.

If you wish to "embed" XML data inside an XML document, and you *don't* want the embedded data to be treated as XML data, then you should put it in a CDATA section.

If you *do* want it to be treated as XML data, then you shouldn't consider it to be "embedded" in anyway, and it should simply be child tags (and not a complete document, per se).

In addition, you won't be ABLE to process this XML data within MQSI 2.1 as XML data - because it's got namespaces in it and 2.1 can't handle namespaces.

Don't bother with this flow or this data in 2.1, build it in your upgrade (which is hopefully v6).
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Lillian
PostPosted: Thu Dec 28, 2006 11:49 pm    Post subject: Reply with quote

Centurion

Joined: 15 Apr 2002
Posts: 102

The sample given was a trace output (not actual xml) of the mq message where the data is embedded in the cdata portion. I need to know how to access the field within the cdata.

Is there a better way than finding the position of the tag name and substringing the value into a variable? even in version 6.0?
Back to top
View user's profile Send private message
special_agent_Queue
PostPosted: Fri Dec 29, 2006 6:26 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

So, what you're saying, is that you DO want to process that cdata. In that case, why don't you parse it?

Something like...
Code:
CREATE LASTCHILD OF Environment.Variables.TempXML DOMAIN ('XML') PARSE(InputRoot.Tag.(XML.CDataSection).*[1], ccsid, encoding);
(Of course this hasn't been tested.)

After you do that, then you can access the embedded data like you would with the rest of the message tree.

(And once you move to v6, you can use DOMAIN('XMLNSC') [only if you are using XMLNSC of course] and FolderBitStream! )
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Dec 29, 2006 7:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I don't think 2.1 supports the Create Field PARSE option.

I really doubt 2.1 will parse XML data that has namespaces in it.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Bill.Matthews
PostPosted: Fri Dec 29, 2006 8:06 am    Post subject: Reply with quote

Master

Joined: 23 Sep 2003
Posts: 232
Location: IBM (Retired)

jefflowrey wrote:
I don't think 2.1 supports the Create Field PARSE option.

I really doubt 2.1 will parse XML data that has namespaces in it.


The Create Field PARSE was introduced in v 2.1 in the spring of 2002.
_________________
Bill Matthews
Back to top
View user's profile Send private message
special_agent_Queue
PostPosted: Fri Dec 29, 2006 8:17 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

jefflowrey wrote:
I don't think 2.1 supports the Create Field PARSE option.

I really doubt 2.1 will parse XML data that has namespaces in it.

I guess I was only half paying attention.

Although, you could just use the double quotes to get around the namespace issue. ie "srs:surname" (not recommended)

However, this is a non-issue since you are upgrading to v6 anyway, and can therefore use xmlnsc.
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 tag
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.