| Author | 
		  Message
		 | 
		
		  | machinist | 
		  
		    
			  
				 Posted: Tue Sep 06, 2016 11:45 pm    Post subject: XML to text conversion | 
				     | 
			   
			 
		   | 
		
		
		    Novice
 
 Joined: 17 Feb 2016 Posts: 15 Location: India 
  | 
		  
		    
			  
				Hi All,
 
 
 
I need to convert incoming XML message to text message
 
Can anyone help me out,how can i do this ?
  Last edited by machinist on Wed Sep 07, 2016 1:25 am; edited 1 time in total | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mpong | 
		  
		    
			  
				 Posted: Wed Sep 07, 2016 12:00 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Disciple
 
 Joined: 22 Jan 2010 Posts: 164
  
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Wed Sep 07, 2016 3:41 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				What is a text message?
 
 
A message that is a text representation of the XML document?  IIB handles that without any code on your part?
 
 
A message in a specific format that does not resemble the XML document?
 
 
You can use any of the IIB transformation nodes to achieve this.  But you need to build a model of the text message. _________________ chmod  -R ugo-wx / | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | adubya | 
		  
		    
			  
				 Posted: Wed Sep 07, 2016 4:09 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Partisan
 
 Joined: 25 Aug 2011 Posts: 377 Location: GU12, UK 
  | 
		  
		    
			  
				ASBITSTREAM may help you out if you want to generate a text string representation of an incoming XML structure.
 
 
But it's not clear what you're after. _________________ Independent Middleware Consultant
 
andy@knownentity.com | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | machinist | 
		  
		    
			  
				 Posted: Thu Sep 08, 2016 2:44 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Novice
 
 Joined: 17 Feb 2016 Posts: 15 Location: India 
  | 
		  
		    
			  
				i am trying by using DFDL
 
 
1.i have created message model for output text message.
 
 
2.then i  have mapped input xml elements with output text message model
 
 
 and now i am testing it but its heavy and it takes time.
 
 
 
i need easier method like esql code which can convert XML to text.
 
output text file should be like this
 
 
010100100C 70117731190550866800000000  201505180591050 24103000020401346644443287                                                         000000000000400000 20150518000000000000000000   
 
L000004                                                                                                                                   000000000000404660           000000000000000000       
 
 
fixed length. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | timber | 
		  
		    
			  
				 Posted: Thu Sep 08, 2016 3:13 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 25 Aug 2015 Posts: 1292
  
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	| i am trying by using DFDL...and now i am testing it but its heavy and it takes time.  | 
   
 
Fair enough. Your output format looks simple, so you expected the format conversion to be a simple task.
 
But data formats are not simple. DFDL seems 'heavy' because it makes you think about all of the stuff that you might forget if you did the job using ESQL (or Java, or any other custom code). Like padding, left/right justification, number and data formats etc. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | machinist | 
		  
		    
			  
				 Posted: Sun Sep 11, 2016 9:51 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Novice
 
 Joined: 17 Feb 2016 Posts: 15 Location: India 
  | 
		  
		    
			  
				@timber can u please provide esql code for conversion xml to text conversion
 
 
    | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | timber | 
		  
		    
			  
				 Posted: Mon Sep 12, 2016 12:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 25 Aug 2015 Posts: 1292
  
  | 
		  
		    
			  
				| Why are you asking me? I would never use ESQL for this task. DFDL is the correct solution. Data format conversion is not as simple as it looks, and a model-based solution is almost always better than a code-based solution. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | smdavies99 | 
		  
		    
			  
				 Posted: Mon Sep 12, 2016 2:24 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land. 
  | 
		  
		    
			  
				
   
	| machinist wrote: | 
   
  
	
 
 
 and now i am testing it but its heavy and it takes time.
 
 
 | 
   
 
 
Life takes time and there is never enough hours in the day.
 
 
If you think testing this is 'heavy' then think what it would take to test flight critical software.
 
 
Stick at it and you will get there and in doing so learn a lot of skils to take you forward.
 
 
I don't think I would be alone in saying that testing is more preferable to ... say writing support documentation. _________________ WMQ User since 1999
 
MQSI/WBI/WMB/'Thingy' User since 2002
 
Linux user since 1995
 
 
 
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |