| Author | 
		  Message
		 | 
		
		  | Getson | 
		  
		    
			  
				 Posted: Thu Jan 24, 2002 2:14 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 17 Jul 2001 Posts: 9 Location: Toronto, Canada 
  | 
		  
		    
			  
				Does anybody know how to add a non-printing character to data in an XML field using ESQL? 
 
I would like to insert a linefeed character into my data and so tried this code:
 
SET OutputRoot.XML.Msg = 'First line' || CAST(0X0A AS CHAR) || 'second line';
 
 
(the ASCII linefeed character is x0A or the 10th character of the set)
 
what I received was:
 
<Msg>First line10second line</Msg>
 
 
I think I can do it by manipulating the message as a BLOB but that is significantly more work.
 
Does anyone have another approach?
 
 
D | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | amigupta1978 | 
		  
		    
			  
				 Posted: Thu Jan 24, 2002 2:40 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 22 Jan 2002 Posts: 132 Location: India 
  | 
		  
		    
			  
				hi..
 
u can try using Root.XML.TAGNAME.(XML.CDataSection)=ur spl characters.
 
 
amit | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Getson | 
		  
		    
			  
				 Posted: Thu Jan 24, 2002 4:11 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 17 Jul 2001 Posts: 9 Location: Toronto, Canada 
  | 
		  
		    
			  
				Thanks but no go. I got the same result.
 
The issue here is that ESQL converts the hex value to an integer instead of interpreting it as an ASCII character.
 
I did get this to work by converting the message to BLOB and concatenating the linefeed (x0A) character in the BLOB data.  A pain, but it worked.
 
Other ideas are always welcome. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mpuetz | 
		  
		    
			  
				 Posted: Fri Jan 25, 2002 7:11 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services 
  | 
		  
		    
			  
				How about this ?
 
 
DECLARE linefeed CHAR;
 
 
SET linefeed = '
 
';
 
 
SET OutputRoot.XML.text = '1st line' || linefeed || '2nd line';
 
 
 _________________ Mathias Puetz
 
 
IBM/Central WebSphere Services
 
WebSphere Business Integration Specialist | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | lbrett | 
		  
		    
			  
				 Posted: Fri Jan 25, 2002 1:37 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 24 Jan 2002 Posts: 20
  
  | 
		  
		    
			  
				Hi, 
 
 
You can also try using the asis tag.
 
 
SET OutputRoot.XML.Msg.(XML.AsisElementContent) = 'First line' || CAST(0X0A AS CHAR) || 'second line'; 
 
 
Regards | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | MiLi | 
		  
		    
			  
				 Posted: Fri Jan 27, 2006 1:02 am    Post subject: Can someone post a solution | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 07 Oct 2005 Posts: 51
  
  | 
		  
		    
			  
				Hi
 
 
I'm intrested if someone got a solution? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | MiLi | 
		  
		    
			  
				 Posted: Fri Jan 27, 2006 2:12 am    Post subject: Solution | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 07 Oct 2005 Posts: 51
  
  | 
		  
		    
			  
				I found a solution from another thread
 
 
   
	| Code: | 
   
  
	
 
      DECLARE CR CHAR CAST(CAST(X'0A' AS BLOB) AS CHAR CCSID InputRoot.MQMD.CodedCharSetId ); 
 
      DECLARE LF CHAR CAST(CAST(X'0D' AS BLOB) AS CHAR CCSID InputRoot.MQMD.CodedCharSetId ); 
 
      DECLARE CRLF CHAR LF ||CR; 
 
 
SET Environment.ExceptionString = OVERLAY(ExceptionString PLACING CRLF FROM (lineBrakePossition) FOR 0);
 
 | 
   
 
 
 
Enjoy _________________ IBM Certified System Administrator - WebSphere MQ V6.0
 
IBM Instructor - WebSphere MQ, WebSphere Message Broker | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |