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

# CFXMLParserCreateXMLStructureCallBack

Callback function invoked when the parser encounters an XML open tag.

```
typealias CFXMLParserCreateXMLStructureCallBack = (CFXMLParser?, CFXMLNode?, UnsafeMutableRawPointer?) -> UnsafeMutableRawPointer?
```

## Parameters

`parser`

The CFXMLParser object making the callback.

`nodeDesc`

The CFXMLNode object that represents the XML structure encountered.

`info`

The program-defined context data you specified in the [`CFXMLParserContext`](/documentation/CoreFoundation/CFXMLParserContext) structure when creating the parser.

## Return Value

A program-defined value representing the new XML element or `NULL` to indicate that the given structure should be skipped. This value is passed to the other callbacks.

## Discussion

If NULL is returned for a given structure, only minimal parsing is done for that structure (enough to correctly determine its end, and to extract any data necessary for the remainder of the parse, such as Entity definitions). This callback (or any of the tree-creation callbacks) will not be called for any children of the skipped structure. The only exception is that the top-most element will always be reported even if NULL was returned for the document as a whole. For performance reasons, the node passed to this callback cannot be safely retained by the client; the node as a whole must be copied (using the [`CFXMLNodeCreateCopy`](/documentation/CoreFoundation/CFXMLNodeCreateCopy) function), or its contents must be extracted and copied. You are required to implement this callback for the parser to operate.

---

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)