| Author | 
		  Message
		 | 
		
		  | Jain | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 11:24 am    Post subject: Copying Input XML to output xml | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 12:10 pm    Post subject: Re: Copying Input XML to output xml | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Jain | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 12:24 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 1:20 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kimbert | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 1:21 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | ganesh | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 2:02 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Master
 
 Joined: 18 Jul 2010 Posts: 294
  
  | 
		  
		    
			  
				| Why not SET OutputRoot = InputRoot; | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | ganesh | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 3:22 pm    Post subject: Re: Copying Input XML to output xml | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Jain | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 6:14 pm    Post subject: Re: Copying Input XML to output xml | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | ganesh | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 7:46 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Jain | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 9:23 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kimbert | 
		  
		    
			  
				 Posted: Wed Jul 09, 2014 11:37 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |