escaped xml

Hi,

I’ve have a piece of data that is provided in an xml document and contains escaped characters - e.g.

(?P<keyStr>\S{12,})

This is actually a python regular expression, which looks like this when not escaped

(?P<keyStr>\S{12,})

I’m having a lot of difficulty getting SmartClient to render correctly when displaying it in a TreeGrid field. It currently renders as

(?P\S{12,})

I have tried overriding ‘formatCellValue’, but the problem appears to be lower level than this -

formatCellValue: function(value, record, rowNum, colNum) {
  isc.Log.logInfo("formatting global cell:" + value + ", " + unescape(value));
  return unescape(value);
}

yields the following log output

19:53:46.965:TMR9:INFO:Log:formatting global cell:(?P<keyStr>\S{12,}), (?P<keyStr>\S{12,})

which shows that the value is already correctly formatted. Can you recommend a way to have this rendered correctly? Thanks,

Colin

The result of formatCellValue() is expected to be HTML.

ok - thanks, pretty obvious I guess. For other’s who are trying the same thing -

formatCellValue: function(value, record, rowNum, colNum) {
  return htmlEscape(value);
}

//  Global escape function

function htmlEscape(htmlText) {
  return htmlText.replace(/\&/g,'&'+'amp;').replace(/</g,'&'+'lt;').replace(/>/g,'&'+'gt;').replace(/\'/g,'&'+'apos;').replace(/\"/g,'&'+'quot;');
}

Thanks,

Colin