Improoving debug in ixml.

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@410 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2008-06-04 21:43:21 +00:00
parent 0e7e47d5bd
commit 2a4701328c

View File

@ -34,6 +34,7 @@
#include <stdlib.h>
#include "ixmldebug.h"
#include "ixmlparser.h"
@ -438,19 +439,23 @@ int ixmlDocument_createElementNSEx(
{
IXML_Element *newElement = NULL;
int errCode = IXML_SUCCESS;
int line = 0;
if (doc == NULL || namespaceURI == NULL || qualifiedName == NULL) {
line = __LINE__;
errCode = IXML_INVALID_PARAMETER;
goto ErrorHandler;
}
errCode = ixmlDocument_createElementEx(doc, qualifiedName, &newElement);
if (errCode != IXML_SUCCESS) {
line = __LINE__;
goto ErrorHandler;
}
// set the namespaceURI field
newElement->n.namespaceURI = strdup(namespaceURI);
if (newElement->n.namespaceURI == NULL) {
line = __LINE__;
ixmlElement_free(newElement);
newElement = NULL;
errCode = IXML_INSUFFICIENT_MEMORY;
@ -459,6 +464,7 @@ int ixmlDocument_createElementNSEx(
// set the localName and prefix
errCode = ixmlNode_setNodeName((IXML_Node *)newElement, qualifiedName);
if (errCode != IXML_SUCCESS) {
line = __LINE__;
ixmlElement_free(newElement);
newElement = NULL;
errCode = IXML_INSUFFICIENT_MEMORY;
@ -469,6 +475,11 @@ int ixmlDocument_createElementNSEx(
ErrorHandler:
*rtElement = newElement;
if (errCode != IXML_SUCCESS) {
IxmlPrintf("(%s::ixmlDocument_createElementNSEx): Error %d, line %d\n",
__FILE__, errCode, line);
}
return errCode;
}