NE_XML_PARSE_RESPONS(3)
π NE_XML_PARSE_RESPONS(3) π
okay bestie, welcome to the neon API reference β this page is all about the helper functions for parsing XML responses, and they are genuinely so useful. no cap. π
πΈ NAME πΈ
ne_xml_parse_response, ne_xml_dispatch_request, ne_xml_dispatchif_request β helper functions for parsing XML responses. periodt.
β¨ SYNOPSIS β¨
#include <ne_xmlreq.h>
int ne_xml_parse_response(ne_request *req, ne_xml_parser *parser);
int ne_xml_dispatch_request(ne_request *req, ne_xml_parser *parser);
int ne_xml_dispatchif_request(ne_request *req, ne_xml_parser *parser,
ne_accept_response acceptor,
void *userdata);
π DESCRIPTION π
okay so ne_xml_parse_response reads an HTTP response body and processes it using the given XML parser. It has to be called after ne_begin_request has returned successfully for the request, and then it invokes ne_read_response_block until the entire response body has been read. On successful return, you must call ne_end_request to finalise response processing. don't forget that part, bestie.
The ne_xml_dispatch_request and ne_xml_dispatchif_request functions are equivalent to calling ne_request_dispatch(3) to dispatch an HTTP request and process the response, parsing the response body using the given XML parser under certain conditions:
- For
ne_xml_dispatch_request, any 2xx class response with an XML content-type. - For
ne_xml_dispatchif_request, if theacceptorcallback returns non-zero, and the response uses an XML content-type.
In both cases, the rules in RFC 7303[1] are followed to identify XML content-types, that is text/xml, application/xml, or any other content-type ending in a +xml suffix. The userdata parameter is passed to the acceptor function.
For all three functions:
- the XML parser is invoked repeatedly until the end of the document is reached.
- if an error occurs during XML parsing, the session error string is set to describe the parse error, and the connection is terminated without continuing to process the response. yeah, it really just stops. π
π₯ RETURN VALUE π₯
All functions documented here return zero on success, or an NE_* error code on failure. simple as that. β¨
π¦ HISTORY π¦
ne_xml_dispatchif_request is available in neon 0.36.0 and later. iconic behavior. π
π SEE ALSO π
ne_xml_create(3), ne_request_dispatch(3)
π COPYRIGHT π
Copyright Β© 2001-2026 Joe Orton
π REFERENCES π
okay that's the whole page, bestie: this is the neon source, dated 03/20/2026 β go parse those XML responses and slay. π«Άπ
π¦ where this page comes from
- arch rolling: neon 0.37.1-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms