---
title: CFXMLParserAddChildCallBack
framework: Core Foundation
role: symbol
role_heading: Type Alias
path: corefoundation/cfxmlparseraddchildcallback
---

# CFXMLParserAddChildCallBack

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

## Declaration

```swift
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 doc://com.apple.corefoundation/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 doc://com.apple.corefoundation/documentation/CoreFoundation/CFXMLParserCreateXMLStructureCallBack callback when this element’s open tag was detected.
- `info`: The program-defined context data you specified in the doc://com.apple.corefoundation/documentation/CoreFoundation/CFXMLParserContext structure when creating the parser.

## Discussion

Discussion If the 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.

## See Also

### Callbacks

- [CFXMLParserCopyDescriptionCallBack](corefoundation/cfxmlparsercopydescriptioncallback.md)
- [CFXMLParserCreateXMLStructureCallBack](corefoundation/cfxmlparsercreatexmlstructurecallback.md)
- [CFXMLParserEndXMLStructureCallBack](corefoundation/cfxmlparserendxmlstructurecallback.md)
- [CFXMLParserHandleErrorCallBack](corefoundation/cfxmlparserhandleerrorcallback.md)
- [CFXMLParserReleaseCallBack](corefoundation/cfxmlparserreleasecallback.md)
- [CFXMLParserResolveExternalEntityCallBack](corefoundation/cfxmlparserresolveexternalentitycallback.md)
- [CFXMLParserRetainCallBack](corefoundation/cfxmlparserretaincallback.md)
