* xmlUnlinkNode: * @cur: the node * * Unlink a node from its tree. * * The node is not freed. Unless it is reinserted, it must be managed * manually and freed eventually by calling xmlFreeNode. */
| 3837 | * manually and freed eventually by calling xmlFreeNode. |
| 3838 | */ |
| 3839 | void |
| 3840 | xmlUnlinkNode(xmlNodePtr cur) { |
| 3841 | if (cur == NULL) |
| 3842 | return; |
| 3843 | |
| 3844 | if (cur->type == XML_NAMESPACE_DECL) |
| 3845 | return; |
| 3846 | |
| 3847 | if (cur->type == XML_DTD_NODE) { |
| 3848 | xmlDocPtr doc = cur->doc; |
| 3849 | |
| 3850 | if (doc != NULL) { |
| 3851 | if (doc->intSubset == (xmlDtdPtr) cur) |
| 3852 | doc->intSubset = NULL; |
| 3853 | if (doc->extSubset == (xmlDtdPtr) cur) |
| 3854 | doc->extSubset = NULL; |
| 3855 | } |
| 3856 | } |
| 3857 | |
| 3858 | if (cur->type == XML_ENTITY_DECL) |
| 3859 | xmlRemoveEntity((xmlEntityPtr) cur); |
| 3860 | |
| 3861 | xmlUnlinkNodeInternal(cur); |
| 3862 | } |
| 3863 | |
| 3864 | #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) |
| 3865 | /** |
no test coverage detected