web stats
Mirth Community - View Single Post - Escapes and new lines.
View Single Post
  #2  
Old 02-08-2010, 11:12 PM
simidau simidau is offline
OBX.2 Kenobi
 
Join Date: Feb 2008
Posts: 62
simidau
Default

The whole story on this is the message data comes in a batch file. I then use a channel to split that batch file (it's a strange XML batch beast with the messages inside CDATA tags.
So when I split the messages up I do a replace on the message string (before)
Like this.
prepareString is the message as a string. Channel2 now receives the data in a way that the channel is expecting.

Code:
	prepareString = prepareString.replace(/<escape\ V="\.br"\/>/gi, "\\\.br\\");
	prepareString = prepareString.replace(/<escape\ V="\.in[0-9]{1,3}"\/>/gi, "");
	var messageString = new XML(prepareString);
	router.routeMessage('Channel2', messageString);
Hope this helps someone else

Cheers
Reply With Quote