How to display a property containing html without encoding all special characters

I have a class thus:-

Class RMH.ClinDoc.Response.GetEPRDisplayResponse Extends Ens.Response [ProcedureBlock]

{

Property GetEPRDisplayResult As %XML.String;

}

The property GetEPRDisplayResult  contains  html content.

When I write out the property in a terminal,  all the html special character content is encoded e.g. '<' is &lt;  '>' is &gt ; etc....

I want to display this html in a browser and have it render as normal.

So my question is how to I store html content in a cache object such that it renders correctly in a browser?

To make things more complicated this data comes into Healthshare as an xml payload and is correlated into an instance of the above class

Thanks

Regards Mike

  • 0
  • 0
  • 175
  • 1
  • 2

Answers

Use $ZCVT() function for decoding,

set y="<html><body><h1>Greater = &gt; lower 0= &lt; Ampersand = &amp; OK</h1></body></html>"

write $zcvt(y,"I","HTML")
<html><body><h1>greater = > lower 0= < Ampersand = & OK</h1></body></html>

Attention all &..; have to be in lower case 

See doc $ZCONVERT()

Thanks Robert,  that is exactly what we needed.

Try to replace %XML.String with %String(MAXLEN="");