---
title: CFXMLParserGetContext
framework: Core Foundation
role: symbol
role_heading: Function
platforms: [macOS 10.0+]
path: corefoundation/cfxmlparsergetcontext
---

# CFXMLParserGetContext

Returns the context for an XML parser.

## Declaration

```occ
extern void CFXMLParserGetContext(CFXMLParserRef parser, CFXMLParserContext *context);
```

## Parameters

- `parser`: The XML parser to examine.
- `context`: On return, a pointer to the context structure for parser.

## Discussion

Discussion If you set a context for the parser, it will be passed to you as a parameter in each of the parser callback functions. The context data structure is application defined and associated with a parser using one of the CFXMLParserCreate... functions.

## See Also

### CFXMLParser Miscellaneous Functions

- [CFXMLParserAbort](corefoundation/cfxmlparserabort.md)
- [CFXMLParserCopyErrorDescription](corefoundation/cfxmlparsercopyerrordescription.md)
- [CFXMLParserCreate](corefoundation/cfxmlparsercreate.md)
- [CFXMLParserCreateWithDataFromURL](corefoundation/cfxmlparsercreatewithdatafromurl.md)
- [CFXMLParserGetCallBacks](corefoundation/cfxmlparsergetcallbacks.md)
- [CFXMLParserGetDocument](corefoundation/cfxmlparsergetdocument.md)
- [CFXMLParserGetLineNumber](corefoundation/cfxmlparsergetlinenumber.md)
- [CFXMLParserGetLocation](corefoundation/cfxmlparsergetlocation.md)
- [CFXMLParserGetSourceURL](corefoundation/cfxmlparsergetsourceurl.md)
- [CFXMLParserGetStatusCode](corefoundation/cfxmlparsergetstatuscode.md)
- [CFXMLParserGetTypeID](corefoundation/cfxmlparsergettypeid.md)
- [CFXMLParserParse](corefoundation/cfxmlparserparse.md)
