3.2.0

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)
January 2,
You should be able to use the Javascript encode functions. Check out encodeURI
Karl Thoroddsen
January 2,

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)
January 3,
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
January 3,
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)
January 4,
Thanks Alex. I'll try that.
Karl Thoroddsen
January 4,

This topic is archived.

See also:


Back to support forum