cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying an XML file retieved from a blob in rte

Former Member
0 Kudos

I'm seeking advice on how to display an .xml file, retrieved from the database as a blob, in PB's rich text edit, without losing the xml format. I'm using PB12.5.

The application reads in and process data from .xml files. I also store the .xml file's content as a blob along with other particulars of the .xml document. This 'save document' function uses the same code to save text documents that are also processed by the application.

Once saved, the User can open a response window to display the ‘content’ of saved documents.

To display text documents, the blob is retrieved using embedded SQL and converted to a string with

ls_string = TRIM(String(blob_text, EncodingANSI!))

The string is pasted into the rte display using the code below, which works ok for formatted text documents, but not for XML - the content is retrieved but the formatting is lost.

ls_richtext = '{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fnil\fcharset0 Calibri;}}{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang7\f0\fs22 ' + ls_string + '\par}'

li_rc = rte_text.PasteRTF(ls_richtext)

Should I be using something other thatn 'EncodingANSI! ?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks again, Chris

Former Member
0 Kudos

Just another thought ... what about using the iNET object to interact with an XML website ( http://www.webtoolkitonline.com/xml-formatter.html ) or calling a web service to format your XML string and then return it to your PB application?

Former Member
0 Kudos

Also ... FYI: http://www.rgagnon.com/pbdetails/pb-0186.html

Former Member
0 Kudos

Hi William;

Have you tried ...

ls_string = TRIM(String(blob_text, EncodingUTF16LE!))

Regards ... Chris

Former Member
0 Kudos

Thanks for your interest, Chris.

Yes, I'd tried EncodingUTF16LE but got hieroglyphics.

EncodingUTF8! and encodingansi! both presented the data but not formatted.

As an interim measure, I've presented the xml in a MS Word ole, which displays the data in a structured format but minus the tags. So the data can be comprehended albeit without the tags which offer a clue to what the data items are about.