Focal Point
[CLOSED] Escaping the É character for Return via XML

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2071098382

May 12, 2008, 05:18 PM
gweller
[CLOSED] Escaping the É character for Return via XML
I have a report that I am returning to an HTML page via an XML call. I have several database values that have a É character. I have quickly found that the XML request will not return this value and have tried to use the STRREP function to change this to a É with no luck...

Any pointers on how I can transform this?

This is what I have tried...

STRREP(78,FULLNAME,1,'É',8,'&|Eacute;',78,FULLNAME_2);

This message has been edited. Last edited by: Kerry,


WebFOCUS 8201M/Windows Platform
May 13, 2008, 02:30 AM
Tony A
I think that you have to use the Unicode character in XML rather than the special construct of É, but what are you doing with the XML upon receipt? Are you processing it via a XSL etc.? If so, I'm not sure how you progress.

T

This message has been edited. Last edited by: Tony A,



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
May 13, 2008, 03:11 PM
gweller
Here is my solution...

STRREP(90, STRREP(78,FULLNAME,1, HEXBYT (201,'A1'), 8,'&|eacute;',78,'A78') ,1, HEXBYT (200,'A1'), 8,'&|egrave;',90,'A90');


WebFOCUS 8201M/Windows Platform
June 29, 2010, 04:04 PM
gweller
Update on this,

I went into my DEFINE FUNCTION that handles this functionality to add another translation. I added the following

VAL3/A256 = STRREP(256,VAL2,1, HEXBYT(39,'A1'), 6,'&|apos;',256,'A256');

Converting an apostraphe to ' to allow for the proper display of data to XML.

After running my code at closer inspection somewhere along the way my ' turned into

 & amp ; apos ; 

ampersand_amp_semicolon_apos_semicolon (damn you html)

which of course is not correct. It seems as though the returned data only occurs when outputting to XML format.

Does anyone know how to correct this? I am afraid that any portion of my function that is using this same technique is also now extinct.

Thanks


WebFOCUS 8201M/Windows Platform
June 29, 2010, 10:38 PM
Dan Satchell
I doubt this is the problem - just a recommendation. I noticed in both your examples that you are replacing a single character with multiple characters, but using the same length for both input and output fields. Make sure you have sufficient space in your output field to handle the extra characters. This may not be much of a problem if you have only one occurrence of the single character in the input field. But if you have several, you could be replacing a few single characters with dozens of extra characters.

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05