<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.8.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFXMLParserGetContext",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFXMLParserGetContext"
  },
  "title" : "CFXMLParserGetContext"
}
-->

# CFXMLParserGetContext

Returns the context for an XML parser.

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

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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)