| Author | 
		  Message
		 | 
		
		  | m_wip | 
		  
		    
			  
				 Posted: Tue Apr 06, 2004 9:26 pm    Post subject: Problem in parsing the Input XML | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 06 Apr 2004 Posts: 8
  
  | 
		  
		    
			  
				The following XML is coming in as input - 
 
<?xml version = "1.0" encoding = "UTF-8"?>
 
<TestMessage>	
 
	<Node1>Sample</Node1>
 
	<Node2>Test</Node2>
 
</TestMessage>
 
 
I'm trying to parse the same and create an output message using the Compute node,
 
SET OutputRoot=InputRoot;
 
 
SET OutputRoot.XML.TestMessage.Node1 = InputRoot.XML.TestMessage.Node1;
 
 
SET OutputRoot.XML.TestMessage.Node2 = 'Test Out';
 
 
The output xml message generated is - 
 
<TestMessage>
 
<Node2>Test Out</Node2>
 
</TestMessage>
 
 
Unfortunately it is not taking the Node1 value from the Input Message and not creating the node Node1 as well!
 
Any help is appreciated. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Duke | 
		  
		    
			  
				 Posted: Tue Apr 06, 2004 11:05 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 09 Mar 2004 Posts: 49 Location: Belgium 
  | 
		  
		    
			  
				Hello,
 
 
Do you have specified anywhere that the domain is XML (for example in the MQ Input Node)? _________________ Pierre Richelle
 
 
Engineer
 
IBM Certified MQSeries Developper V5.3
 
IBM Certified WMQ Administration V6 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | m_wip | 
		  
		    
			  
				 Posted: Wed Apr 07, 2004 1:58 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 06 Apr 2004 Posts: 8
  
  | 
		  
		    
			  
				| Yes I did, but still the output message doesn't get generated with the Node2 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | DJN | 
		  
		    
			  
				 Posted: Wed Apr 07, 2004 4:03 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 14 Apr 2003 Posts: 47
  
  | 
		  
		    
			  
				I had a similar problem ..... try inserting the schema name after the '.XML' in the input path.
 
 
ex. InputRoot.XML.schemaname.fieldname | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Duke | 
		  
		    
			  
				 Posted: Wed Apr 07, 2004 4:11 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Apprentice
 
 Joined: 09 Mar 2004 Posts: 49 Location: Belgium 
  | 
		  
		    
			  
				Try with 
 
OutputRoot.XML.(XML.Tag)... = InputRoot.XML......(XML.Content);
 
 
Do you have tried with the debugger?
 
 
Why do you copy all the inputRoot at the begin and not only the header? _________________ Pierre Richelle
 
 
Engineer
 
IBM Certified MQSeries Developper V5.3
 
IBM Certified WMQ Administration V6 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Missam | 
		  
		    
			  
				 Posted: Wed Apr 07, 2004 6:06 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Chevalier
 
 Joined: 16 Oct 2003 Posts: 424
  
  | 
		  
		    
			  
				| The Best way to figure it out whats going wrong is to debug the flow. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fschofer | 
		  
		    
			  
				 Posted: Wed Apr 07, 2004 6:16 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Knight
 
 Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany 
  | 
		  
		    
			  
				Probably InputRoot.XML.TestMessage.Node1 resolves to NULL and causes the deletion of OutputRoot.XML.TestMessage.Node1.
 
 
Please try this:
 
SET OutputRoot.XML.TestMessage.Node1 = COALESCE(InputRoot.XML.TestMessage.Node1, 'Input is NULL');
 
 
You can best find such errors with a debug trace 
 
and its always good to put trace nodes before and after your compute node | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |