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

# CFXMLParserGetLocation

Returns the character index of the current parse location.

```
extern CFIndex CFXMLParserGetLocation(CFXMLParserRef parser);
```

## Parameters

`parser`

The XML parser to examine.

## Return Value

The character index of the current parse location.

## Discussion

This function is typically used in conjunction with the [`CFXMLParserHandleErrorCallBack`](/documentation/CoreFoundation/CFXMLParserHandleErrorCallBack) function so that error location information can be reported.

---

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)