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 » Copying Input XML to output xml

Post new topic  Reply to topic
 Copying Input XML to output xml « View previous topic :: View next topic » 
Author Message
Jain
PostPosted: Wed Jul 09, 2014 11:24 am    Post subject: Copying Input XML to output xml Reply with quote

Novice

Joined: 11 Nov 2011
Posts: 21

I'm having input XML as follows
<Envelope xmlns="http://www.ABC.com">
<Body>
<Error>text</Error>
<Body>
</Envelope>
Assuming that XML is correct I'm trying to copy this XML to outputroot
Set outputroot.xmlnsc = inputroot.xmlnsc
The above statement is giving correct result but when I'm doing
Set outputroot.xmlnsc = inputroot.xmlnsc.Envelope
Output is blank. Can someone help me?
I also tried
Set outputroot.xmlnsc = inputroot.xmlnsc.*
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Wed Jul 09, 2014 12:10 pm    Post subject: Re: Copying Input XML to output xml Reply with quote

Grand High Poobah

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

Jain wrote:
Can someone help me?


Envelope is in a namespace which you don't quote.

Jain wrote:

I also tried
Set outputroot.xmlnsc = inputroot.xmlnsc.*


Which again is not referencing a namespace. Try InputRoot.XMLNSC.*:*
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Jain
PostPosted: Wed Jul 09, 2014 12:24 pm    Post subject: Reply with quote

Novice

Joined: 11 Nov 2011
Posts: 21

Will it work? Because although namespace is declared but not using like Env:Envelope in the incoming xml

<Envelope xmlns="http://www.ABC.com">
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Wed Jul 09, 2014 1:20 pm    Post subject: Reply with quote

Grand High Poobah

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

Jain wrote:
Will it work? Because although namespace is declared but not using like Env:Envelope in the incoming xml


Why not just try it?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jul 09, 2014 1:21 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Add a Trace node and set the pattern to ${Root}
Examine the tree structure carefully.
If you still cannot work out the problem then post the Trace node output ( and please use code tags to preserve the formatting ).
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
ganesh
PostPosted: Wed Jul 09, 2014 2:02 pm    Post subject: Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

Why not SET OutputRoot = InputRoot;
Back to top
View user's profile Send private message
ganesh
PostPosted: Wed Jul 09, 2014 3:22 pm    Post subject: Re: Copying Input XML to output xml Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

Jain wrote:
I'm having input XML as follows
<Envelope xmlns="http://www.ABC.com">
<Body>
<Error>text</Error>
<Body>
</Envelope>
Assuming that XML is correct I'm trying to copy this XML to outputroot
Set outputroot.xmlnsc = inputroot.xmlnsc
The above statement is giving correct result but when I'm doing
Set outputroot.xmlnsc = inputroot.xmlnsc.Envelope
Output is blank. Can someone help me?
I also tried
Set outputroot.xmlnsc = inputroot.xmlnsc.*


The xml you have pasted is not a valid xml, check the Body tag.
Back to top
View user's profile Send private message
Jain
PostPosted: Wed Jul 09, 2014 6:14 pm    Post subject: Re: Copying Input XML to output xml Reply with quote

Novice

Joined: 11 Nov 2011
Posts: 21

ganesh wrote:
Jain wrote:
I'm having input XML as follows
<Envelope xmlns="http://www.ABC.com">
<Body>
<Error>text</Error>
</Body>
</Envelope>
Assuming that XML is correct I'm trying to copy this XML to outputroot
Set outputroot.xmlnsc = inputroot.xmlnsc
The above statement is giving correct result but when I'm doing
Set outputroot.xmlnsc = inputroot.xmlnsc.Envelope
Output is blank. Can someone help me?
I also tried
Set outputroot.xmlnsc = inputroot.xmlnsc.*


The xml you have pasted is not a valid xml, check the Body tag.


Plz assume XML is correct. I want to copy the msg present inside Error tag
Back to top
View user's profile Send private message Send e-mail
ganesh
PostPosted: Wed Jul 09, 2014 7:46 pm    Post subject: Reply with quote

Master

Joined: 18 Jul 2010
Posts: 294

Jain wrote:
Will it work? Because although namespace is declared but not using like Env:Envelope in the incoming xml

<Envelope xmlns="http://www.ABC.com">


Did you mean to declare xmlns as a namespace or an attribute?

From your xml xmlns is an attribute, namespace should be declared like xmlns:xxx="http://www.ABC.com".

http://www.w3schools.com/xml/xml_namespaces.asp
Back to top
View user's profile Send private message
Jain
PostPosted: Wed Jul 09, 2014 9:23 pm    Post subject: Reply with quote

Novice

Joined: 11 Nov 2011
Posts: 21

kimbert wrote:
Add a Trace node and set the pattern to ${Root}
Examine the tree structure carefully.
If you still cannot work out the problem then post the Trace node output ( and please use code tags to preserve the formatting ).

Code:
the exact xml is <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
   <Header/>
   <Body>
      <Error>text</Error>
  </Body>
</Envelope>

part of the trace log(didn't post exact log due to some issue)
 <Text>XML Writing Errors have occurred</Text>
- <ParserException>
  <File>/build/S700_P/src/MTI/MTIforBroker/GenXmlParser4/ImbXMLNSCWriter.cpp</File>
  <Line>889</Line>
  <Function>ImbXMLNSCWriter::writeMisc</Function>
  <Type />
  <Name />
  <Label />
  <Catalog>BIPmsgs</Catalog>
  <Severity>3</Severity>
  <Number>5016</Number>
  <Text>Unexpected XML type at this point in document.</Text>
- <Insert>
  <Type>5</Type>
  <Text>Version[1.0]</Text>
  </Insert>
- <Insert>
  <Type>5</Type>
  <Text>attributeType</Text>
when used
SET OutputRoot.XMLNSC = InputRoot.XMLNSC.*:*;
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Wed Jul 09, 2014 11:37 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Looks as if you are getting errors from XMLNSC when it tries to write the message tree. I strongly suggest that you
a) get the full text of the error ( the ExceptionList tree only gives you a 1-line summary ) and
b) read it very carefully, and try everything that it suggests

If you cannot find the full text of the error, you can use the mqsiexplain command, or take a user trace.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
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 » Copying Input XML to output 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.