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 » Extract XML as BLOB

Post new topic  Reply to topic
 Extract XML as BLOB « View previous topic :: View next topic » 
Author Message
me.mehta
PostPosted: Fri May 06, 2011 3:45 am    Post subject: Extract XML as BLOB Reply with quote

Novice

Joined: 30 Dec 2010
Posts: 11

Hi,

I am new in WMB I have come across a problem. I need to extract value of and element which itself is another XML.

<NS1:data xmlns:NS1="http:///ext.com/1-0">
<ns2:anotherxml ns2="http:///example.com/">
<somedata>
</somedata>
</ns2:anotherxml>
</NS1:data>

I have to get the anotherxml as a blob and store in the database. I have written following code

DECLARE options INTEGER BITOR(RootBitStream, ValidateContent, ValidateValue);
SET xml = ASBITSTREAM(Root.XMLNSC.NS1:data.*,,1208,,,,options);

But its giving exception saying 'Text:CHARACTER:No root element was found while writing the XML message'

Can you please help me knowing how it can be achieved?

Thanks,
Me
Back to top
View user's profile Send private message
exerk
PostPosted: Fri May 06, 2011 4:12 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

New you may be but please take note that there is a specific WMB forum and in future post WMB-related questions in that forum...

...moving this post.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri May 06, 2011 4:23 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

RootBitStream means "assume that the element passed in is the root of the tree".

Root.XMLNSC.NS1:data is not the root of the tree.

It is a folder.

Also, Root.XMLNSC.NS1:data.* is "the set of children of the data element".

As in, more than one element. Which may be the root of several trees, but is not the root of one tree. Or even a single folder.

So you need to make sure you know what you are asking the Broker to do, and that it makes sense at both the Broker level and at a fundemental XML level (no XML document is allowed to have more than one root element... )
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri May 06, 2011 4:28 am    Post subject: Re: Extract XML as BLOB Reply with quote

Grand High Poobah

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

me.mehta wrote:
I am new in WMB I have come across a problem. I need to extract value of and element which itself is another XML.


The example document you've posted isn't 1 XML document inside another; it's a single document with 2 namespaces and perfectly straightforward.

You need to do 2 things:

1) Define the namespaces correctly within the ESQL so that the <data> & <anotherxml> (which I repeat doesn't look like another document to me) can be located correctly by the parser
2) Code the ESQL correctly so that the children of <data> are identified to the ABITSREAM function - that construction isn't doing what you think it is.

As with so many things, a user trace will provide you with valuable information as to what your code is doing.

If the example you've posted is just that, an example, and the "real" XML really does have 1 XML document inside another then you've got problems because that's not a well formed piece of XML.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Extract XML as BLOB
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.