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

# CFXMLParserCreateWithDataFromURL

Creates a new XML parser for the specified XML data at the specified URL.

```
extern CFXMLParserRefCFXMLParserCreateWithDataFromURL(CFAllocatorRef allocator, CFURLRef dataSource, CFOptionFlags parseOptions, CFIndex versionOfNodes, CFXMLParserCallBacks *callBacks, CFXMLParserContext *context);
```

## Parameters

`allocator`

The allocator to use to allocate memory for the new object. Pass `NULL` or kCFAllocatorDefault to use the current default allocator.

`dataSource`

The URL from which to load the XML data. The URL is used to resolve any relative references found in XML Data. It must be a valid CFURL object; `NULL` is an unacceptable value.

`parseOptions`

Flags which control how the XML data will be parsed. See [`CFXMLParserOptions`](/documentation/CoreFoundation/CFXMLParserOptions) for the list of available options.

`versionOfNodes`

Determines which version of CFXMLNode objects are produced by the parser.

`callBacks`

Callbacks called by the parser as the XML is processed. The callbacks are called as each XML tag is encountered, when an external entity needs to be resolved, and when an error occurs. See [`CFXMLParserCallBacks`](/documentation/CoreFoundation/CFXMLParserCallBacks) and the individual callbacks for more details. Do not pass `NULL`.

`context`

Determines what, if any, information pointer is passed to the callbacks as the parse progresses; may be `NULL`.

## Return Value

The newly created parser. Ownership follows the [The Create Rule](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-103029).

## Discussion

---

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)