[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting access to the entire attributes string
Scott,
http_url_post_xml() feeds the data it gets from the HTTP request into
Expat, and lets Expat parse it. The original XML code is not passed to
your application, only the result that came from parsing it.
You could potentially rebuild the string by spinning through the
attributes and doing a little string manipulation to put the tag name
and attributes back together... but the original data is not
available.
You could, of course, use http_url_post(), this simply saves the XML
data to a file. Then you'd have all of the source, and could use
http_parse_xml_Stmf() to parse it.
I wonder, though, why you'd want to parse the XML but then want to get
the original XML code instead of a parsed response? That seems like a
strange thing.
On 5/20/2014 3:58 PM, Scott Mildenberger wrote:
I have looked through the archives but can't find an issue like I am
trying to solve.
I have a web service that I am calling with http_url_post_xml() that
returns XML and one of the elements is like this (from SoapUI):
<Entry Id="91" Version="18" TruckName="1050T"....lots more....
JbusParamsAudit="7071999"/>
It contains no value and only attributes, there can be up to 350 of
them. I know how to use http_nextXmlAttr() to parse out the attributes
but for the time being I would like to just store this raw response.
Later I can worry about parsing out the attributes I want. I have been
unable to figure out how to get ahold of the text for that entire
entry? Do I need to change to using http_url_get_raw() and parse the
response myself? I would like to stick with http_url_post_xml if
possible because it simplifies getting other elements in the response.
The data comes out daily and is only available for a limited time, that
is why I just want to store the raw response for now so I don't lose
any data until I have a complete solution in place.
Any suggestions on how to get the text of the entire `Entry' element?
Thanks,
Scott Mildenberger
Programmer/Analyst
Davis Transport Inc.
Missoula, MT
406-728-5510 x128
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
[1]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
References
1. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------