[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Parsing XML with a value that contains a double quote
I've increased the size of the variables that hold the response data
and write it into a temporary file in the IFS, and will run it again a
little later to see what happens. When I send the request now, I'm
getting a "You have already submitted this request" response from the
web service's test server. Funny.
Thanks for your help, everyone. I really appreciate your patience!
Merry Christmas,
Kim Gibson
From: Kim Gibson
Sent: Tuesday, December 21, 2010 1:44 PM
To: 'ftpapi@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: Parsing XML with a value that contains a double quote
Oh man. My bad---it's not the double quote that's giving me a
problem---Rick nailed it--I'm exceeding a length.
// ----------------------------------------------
// Parse the SOAP document (the one in soapfile)
// Inside it will be another XML document that's
// embedded within -- save that to a separate
// file in the IFS.
// ----------------------------------------------
Embfile = http_tempfile();
if (http_parse_xml_stmf( soapfile
: HTTP_XML_CALC
: *null
: %paddr(SaveEmbed)
: %addr(embfile) ) < 0);
callp close(fd);
unlink(soapfile);
unlink(embfile);
http_crash();
endif;
I've attached the temporary file that I drug from the IFS to my PC,
and renamed to an XML document. I'm embarrassed to say I only looked
at the file in Internet Explorer, not Notepad, and assumed the double
quote in the value was the issue. Obviously, it's not, as the last
line is an incomplete tag (resulting in an unclosed tag error--doh!).
So now I'm looking at a size limitation. The response received from my
SOAP request certainly have the possibility of being huge.
Any quick ideas on solutions?? I'm doing some research on this end,
and chances are the solution will be absurdly simple.
Thanks for your help,
Kim Gibson
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[[1]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Kim Gibson
Sent: Tuesday, December 21, 2010 12:53 PM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Parsing XML with a value that contains a double quote
I've posted recently with the subject line "Example 18 and an Unparsed
Character Response". I'm using
[2]http://www.scottklement.com/httpapi/bankrout.txt as a template to take
the unparsed response & write it to the IFS, then calling
http_parse_xml_stmf, and it's working beautifully, with one exception.
There is a value within a tag that I'm receiving in the response that
has a double quote, and this is messing up the parsing. This is the tag
& value:
<PrescriptionLabel>BD INSULIN SYR 0.5 ML
30GX1/2"</PrescriptionLabel>
The double quote is messing things up---I get an error:
XML parse failed at line 2, col 65517: unclosed token
Any suggestions how to handle this?
Thanks so much,
Kim Gibson
References
1. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
2. http://www.scottklement.com/httpapi/bankrout.txt
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------