Wrap it, in a cdata function...
this is from a PDF creation script I use...
eval w1 = '<![CDATA['+%trim(phpoid)+']]>';
eval data =""
'<fo:table-cell border-bottom- '+e+
'border-width="0.5pt" background-color="white">'+e+
'<fo:block text-align="end" font-size="12pt">Purchase Order: '+
'<fo:inline font-weight="bold">'+w1+'</fo:inline>'+e+
'</fo:block>'+e+
'</fo:table-cell>'+e+
'</fo:table-row>'+e+
'</fo:table-body>'+e+
'</fo:table>'+e;
exsr writefile;
-----Original Message-----
From: owner-ftpapi@xxxxxxxxxxxxx [SMTP:owner-ftpapi@xxxxxxxxxxxxx] On Behalf Of rbelz@xxxxxxxxxxx
Sent: Thursday, February 10, 2005 6:59 PM
To: ftpapi@xxxxxxxxxxxxx
Subject: posting ampersand in xml
Don't know if this is a HTTP API problem or not.? I'm hoping someone has seen this issue before and can help me.?
?
We? run a RPG program that constructs an xml string from DB2/400 data.?? This xml string is then passed to? a program that executes the? http_url_post_raw function? posting the string to a java servlet.? This works fine unless the string contains an ampersand character.?? For example, the RPG program (using? http_url_post_raw) passes this xml string to the servlet correctly: "<data><id>1234</id><company>SMITH INC </company></data>".? However if the string is equal to "<data><id>3456</id><company>SMITH & WESSON</company></data>" then the program only? sends the first 34
? characters to the servlet.?
?
If the xml string? contains an ampersand sign then the string is truncated at the ampersand sign.? This truncation causes a problem on the web side because the XML string? is incomplete.? Our first impression is that the? utility's http_url_post_raw is? encoding the spaces in the string correctly but not the ampersand sign.? We have seen some literature that says the ampersand needs to be replaced with "&" - we have tried that in the program? that constructs the xml string? but that has not worked.
?
Thanks in advance for any help!
?
This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy the message.