| 2694 | } |
| 2695 | |
| 2696 | static void |
| 2697 | xmlRemoveEntity(xmlEntityPtr ent) { |
| 2698 | xmlDocPtr doc = ent->doc; |
| 2699 | xmlDtdPtr intSubset, extSubset; |
| 2700 | |
| 2701 | if (doc == NULL) |
| 2702 | return; |
| 2703 | intSubset = doc->intSubset; |
| 2704 | extSubset = doc->extSubset; |
| 2705 | |
| 2706 | if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) || |
| 2707 | (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) || |
| 2708 | (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY)) { |
| 2709 | if (intSubset != NULL) { |
| 2710 | if (xmlHashLookup(intSubset->entities, ent->name) == ent) |
| 2711 | xmlHashRemoveEntry(intSubset->entities, ent->name, NULL); |
| 2712 | } |
| 2713 | if (extSubset != NULL) { |
| 2714 | if (xmlHashLookup(extSubset->entities, ent->name) == ent) |
| 2715 | xmlHashRemoveEntry(extSubset->entities, ent->name, NULL); |
| 2716 | } |
| 2717 | } else if ((ent->etype == XML_INTERNAL_PARAMETER_ENTITY) || |
| 2718 | (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)) { |
| 2719 | if (intSubset != NULL) { |
| 2720 | if (xmlHashLookup(intSubset->pentities, ent->name) == ent) |
| 2721 | xmlHashRemoveEntry(intSubset->entities, ent->name, NULL); |
| 2722 | } |
| 2723 | if (extSubset != NULL) { |
| 2724 | if (xmlHashLookup(extSubset->pentities, ent->name) == ent) |
| 2725 | xmlHashRemoveEntry(extSubset->entities, ent->name, NULL); |
| 2726 | } |
| 2727 | } |
| 2728 | } |
| 2729 | |
| 2730 | static int |
| 2731 | xmlNodeSetDoc(xmlNodePtr node, xmlDocPtr doc) { |
no test coverage detected