---
name: "ne_xml_parse_response"
section: "3"
platform: "linux"
package: "neon"
version: "0.37.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ne_xml_parse_response"
---

# ne\_xml\_parse\_response(3)

helper functions for parsing XML responses

## NAME

ne\_xml\_parse\_response, ne\_xml\_dispatch\_request, ne\_xml\_dispatchif\_request - helper functions for parsing XML responses

## 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

The **ne\_xml\_parse\_response** function reads an HTTP response body and processes it using the given XML parser. The function must be called **ne\_begin\_request** has returned successfully for the request, and then invokes **ne\_read\_response\_block** until the entire response body has been read. On successful return, **ne\_end\_request** must be called to finalise response processing.

The **ne\_xml\_dispatch\_request** and **ne\_xml\_dispatchif\_request** functions is equivalent to calling [**ne\_request\_dispatch**(3)](/ne_request_dispatch/3.md) 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 the *acceptor* callback 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..

## RETURN VALUE

All functions documented here return zero on success, or an NE\_\* error code on failure.

## HISTORY

**ne\_xml\_dispatchif\_request** is available in neon 0.36.0 and later.

## SEE ALSO

[**ne\_xml\_create**(3)](/ne_xml_create/3.md), [**ne\_request\_dispatch**(3)](/ne_request_dispatch/3.md)

## COPYRIGHT

Copyright © 2001-2026 Joe Orton\

## REFERENCES

- 1\.

  RFC 7303

  https://www.rfc-editor.org/rfc/rfc7303
