* xmlCopyNamespaceList: * @cur: the first namespace * * Copy a namespace list. * * Returns the head of the copied list or NULL if a memory * allocation failed. */
| 3965 | * allocation failed. |
| 3966 | */ |
| 3967 | xmlNsPtr |
| 3968 | xmlCopyNamespaceList(xmlNsPtr cur) { |
| 3969 | xmlNsPtr ret = NULL; |
| 3970 | xmlNsPtr p = NULL,q; |
| 3971 | |
| 3972 | while (cur != NULL) { |
| 3973 | q = xmlCopyNamespace(cur); |
| 3974 | if (q == NULL) { |
| 3975 | xmlFreeNsList(ret); |
| 3976 | return(NULL); |
| 3977 | } |
| 3978 | if (p == NULL) { |
| 3979 | ret = p = q; |
| 3980 | } else { |
| 3981 | p->next = q; |
| 3982 | p = q; |
| 3983 | } |
| 3984 | cur = cur->next; |
| 3985 | } |
| 3986 | return(ret); |
| 3987 | } |
| 3988 | |
| 3989 | static xmlAttrPtr |
| 3990 | xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) { |
no test coverage detected