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

# CFXMLParserAddChildCallBack

Callback function invoked by the parser to notify your application of parent/child relationships between XML structures.

```
typealias CFXMLParserAddChildCallBack = (CFXMLParser?, UnsafeMutableRawPointer?, UnsafeMutableRawPointer?, UnsafeMutableRawPointer?) -> Void
```

## Parameters

`parser`

The CFXMLParser object making the callback.

`parent`

The program-defined value representing the XML element to whom `child` is being added. This value was returned by the [`CFXMLParserCreateXMLStructureCallBack`](/documentation/CoreFoundation/CFXMLParserCreateXMLStructureCallBack) callback when this element’s open tag was detected.

`child`

The program-defined value representing the XML element that is being added to `parent`. This value was returned by the [`CFXMLParserCreateXMLStructureCallBack`](/documentation/CoreFoundation/CFXMLParserCreateXMLStructureCallBack) callback when this element’s open tag was detected.

`info`

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

## Discussion

If the [`CFXMLParserCreateXMLStructureCallBack`](/documentation/CoreFoundation/CFXMLParserCreateXMLStructureCallBack) function returns NULL for a given structure, that structure is omitted entirely, and this callback will *not* be called for either a NULL child or parent.

---

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)