:: Forum >>

How to handle special characters in XML data

Hi,

Can you please show me how to handle special characters in XML data?

I want to be able to receive and display the user < > ' " and all the rest.

Do you have a encode/decode URI Component?

Thanks.

Joe (SandDisk-SCS)
Tuesday, January 2, 2007
You should be able to use the Javascript encode functions. Check out encodeURI
Karl Thoroddsen
Tuesday, January 2, 2007

I use XML as the input for the grid and the grid itself doesn't do decode.

Is there a better way then just parse the XML and run decode for each cell?
Joe (SandDisk-SCS)
Wednesday, January 3, 2007
That is a good point. I have noticed that behaviour as well. Certain cells can go haywire if the text contains as you said '<' or '>'

Karl Thoroddsen
Wednesday, January 3, 2007
AW.Formats.String does encode html control chars while AW.Format.HTML pass them through as is. You should have something like -

var string = new AW.Formats.String;
...
var obj = new AW.UI.Grid;
obj.setCellFormat(string);
...

http://www.activewidgets.com/aw.ui.grid/cell-format.html

Alex (ActiveWidgets)
Thursday, January 4, 2007
Thanks Alex. I'll try that.
Karl Thoroddsen
Thursday, January 4, 2007

This topic is archived.


Back to support forum

Forum search