<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFXMLParserOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@E@CFXMLParserOptions"
  },
  "title" : "CFXMLParserOptions"
}
-->

# CFXMLParserOptions

Options you can use to control the parser’s treatment of an XML document.

```
struct CFXMLParserOptions
```

## Overview

These are the various options you use to configure the parser. An option flag of 0 ([`kCFXMLParserNoOptions`](/documentation/CoreFoundation/CFXMLParserOptions/kCFXMLParserNoOptions)) leaves the XML as “intact” as possible (reports all structures; performs no replacements). Hence, to make the parser do the most work, returning only the pure element tree, set the option flag to [`allOptions`](/documentation/CoreFoundation/CFXMLParserOptions/allOptions).

## Topics

### Constants

[`validateDocument`](/documentation/CoreFoundation/CFXMLParserOptions/validateDocument)

Validates the document against its grammar from the DTD, reporting any errors. Currently not supported.

[`skipMetaData`](/documentation/CoreFoundation/CFXMLParserOptions/skipMetaData)

Silently skip over metadata constructs (the DTD and comments).

[`replacePhysicalEntities`](/documentation/CoreFoundation/CFXMLParserOptions/replacePhysicalEntities)

Replaces declared entities like `&lt`;. Note that other than the 5 predefined entities (`lt`, `gt`, `quot`, `amp`, `apos`), these must be defined in the DTD. Currently not supported.

[`skipWhitespace`](/documentation/CoreFoundation/CFXMLParserOptions/skipWhitespace)

[`resolveExternalEntities`](/documentation/CoreFoundation/CFXMLParserOptions/resolveExternalEntities)

Resolves all external entities.

[`addImpliedAttributes`](/documentation/CoreFoundation/CFXMLParserOptions/addImpliedAttributes)

Where the DTD specifies implied attribute-value pairs for a particular element, add those pairs to any occurrences of the element in the element tree. Currently not supported.

[`allOptions`](/documentation/CoreFoundation/CFXMLParserOptions/allOptions)

Makes the parser do the most work, returning only the pure elementtree.

[`kCFXMLParserNoOptions`](/documentation/CoreFoundation/CFXMLParserOptions/kCFXMLParserNoOptions)

Leaves the XML as “intact” as possible (reports all structures; performs no replacements).



---

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)