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 » Creating XML with two root elements

Post new topic  Reply to topic Goto page 1, 2  Next
 Creating XML with two root elements « View previous topic :: View next topic » 
Author Message
sammy_910
PostPosted: Mon Apr 16, 2012 5:00 am    Post subject: Creating XML with two root elements Reply with quote

Apprentice

Joined: 16 Dec 2010
Posts: 33

Hi,

Currently I am trying to create an XML having two root elements using compute node in WMB.I tried using MRM domain but havent been successful so far.

Could anyone help me with how to approach this problem?Would java code be a possible solution?

Regards,
Back to top
View user's profile Send private message
Esa
PostPosted: Mon Apr 16, 2012 5:04 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

Have you tried creating two OutputRoots? That should work.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 16, 2012 5:07 am    Post subject: Re: Creating XML with two root elements Reply with quote

Grand High Poobah

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

sammy_910 wrote:
Currently I am trying to create an XML having two root elements


Given that a well-formed XML document has a single root element (the clue is in the name) why are you trying to do this? Given that all XML parsers which conform to the W3C standard will refuse to parse it?

If you're trying to create 2 XML documents in a single step inside WMB that's a different and much more achieveable objective.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 16, 2012 5:08 am    Post subject: Reply with quote

Grand High Poobah

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

Esa wrote:
Have you tried creating two OutputRoots? That should work.


It will work. The OP will then post back about 30 seconds later along the lines of "I created 2 XML documents with 2 OutputRoot but when I try to output it WMB throws an error about multiple root elements".
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Esa
PostPosted: Mon Apr 16, 2012 5:28 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

Vitor wrote:

It will work. The OP will then post back about 30 seconds later along the lines of "I created 2 XML documents with 2 OutputRoot but when I try to output it WMB throws an error about multiple root elements".


Dear Vitor, you happen to be wrong here. Just a couple of weeks ago I got slapped with a trout by mgk when I claimed the same thing.

I tested this. You get a message with 2 root elements and it is put in the output queue with no problems.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 16, 2012 5:29 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Currently I am trying to create an XML having two root elements
There is no such thing. If it has two root tags then it is not well-formed XML. Why do you want to do this?
Quote:
Have you tried creating two OutputRoots? That should work.
It might work, but I'm not going along with this until I hear a good reason why it is necessary.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 16, 2012 5:37 am    Post subject: Reply with quote

Grand High Poobah

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

Esa wrote:
Dear Vitor, you happen to be wrong here. Just a couple of weeks ago I got slapped with a trout by mgk when I claimed the same thing.


Post the link. It might work with BLOB or (maybe) MRM but not XMLNSC.

Esa wrote:
I tested this. You get a message with 2 root elements and it is put in the output queue with no problems.


And the XML writer didn't blink, but placed a message in the queue which had a payload of an XML document with 2 roots? An XML document which is not well formed?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 16, 2012 5:52 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
And the XML writer didn't blink, but placed a message in the queue which had a payload of an XML document with 2 roots? An XML document which is not well formed?
Each OutputRoot.XMLNSC will own its own instance of the XMLNSC parser. So each instance of XMLNSC is writing a single-rooted XML document. The effect of writing the entire output tree is to write a double-rooted XML document using two different XMLNSC parsers.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Apr 16, 2012 5:53 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
Esa wrote:
Dear Vitor, you happen to be wrong here. Just a couple of weeks ago I got slapped with a trout by mgk when I claimed the same thing.


Post the link. It might work with BLOB or (maybe) MRM but not XMLNSC


I support Esa's contention that a logical message tree that has two separate instances of OutputRoot.XMLNSC will be output by any of the Output nodes.

note that this is entirely different than one instance of OutputRoot.XMLNSC with TWO root elements under XMLNSC.

I.e
Code:
OutputRoot
     XMLNSC
           Root1
     XMLNSC
           Root2

Will "work", whereas
Code:
OutputRoot
    XMLNSC
           Root1
           Root2

Will not.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 16, 2012 5:54 am    Post subject: Reply with quote

Grand High Poobah

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

kimbert wrote:
Quote:
And the XML writer didn't blink, but placed a message in the queue which had a payload of an XML document with 2 roots? An XML document which is not well formed?
Each OutputRoot.XMLNSC will own its own instance of the XMLNSC parser. So each instance of XMLNSC is writing a single-rooted XML document. The effect of writing the entire output tree is to write a double-rooted XML document using two different XMLNSC parsers.


So it does. The things you learn.

Still not sure why you'd want to though, or what use the output is.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sammy_910
PostPosted: Mon Apr 16, 2012 6:08 am    Post subject: Reply with quote

Apprentice

Joined: 16 Dec 2010
Posts: 33

The requirement is at the Target end...

We are migrating parts of existing code from age old ICS to WMB.ICS does this currently using some java code.But I tried this in WMB to no avail.

Regards,
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Apr 16, 2012 6:16 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

sammy_910 wrote:
But I tried this in WMB to no avail.

How?

You've been told how to do it so it 'works'.

The target system is still broken.
Back to top
View user's profile Send private message
sammy_910
PostPosted: Mon Apr 16, 2012 7:07 am    Post subject: Reply with quote

Apprentice

Joined: 16 Dec 2010
Posts: 33

Tried using the MRM message domain and as suggested before by trying to create two OutputRoots.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 16, 2012 7:11 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Tried using the MRM message domain and as suggested before by trying to create two OutputRoots.
So you are using the MRM domain to output an XML message?

Any particular reason why you are not using XMLNSC?
Back to top
View user's profile Send private message
sammy_910
PostPosted: Mon Apr 16, 2012 7:14 am    Post subject: Reply with quote

Apprentice

Joined: 16 Dec 2010
Posts: 33

Quote:
Any particular reason why you are not using XMLNSC?


Because XMLNSC gives a parsing error of an invalid XML document
Back to top
View user's profile Send private message
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 » Creating XML with two root elements
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.