Index: mxml-file.c =================================================================== --- mxml-file.c (Revision 406) +++ mxml-file.c (Arbeitskopie) @@ -1652,6 +1652,17 @@ *bufptr = '\0'; + if (parent==NULL && first!=NULL) + { + /* + * There can only be one root element! + */ + + mxml_error("<%s> cannot be a second root node after <%s>", + buffer, first->value.element.name); + goto error; + } + if ((node = mxmlNewElement(parent, buffer)) == NULL) { /* @@ -1709,6 +1720,17 @@ *bufptr = '\0'; + if (parent==NULL && first!=NULL) + { + /* + * There can only be one root element! + */ + + mxml_error("<%s> cannot be a second root node after <%s>", + buffer, first->value.element.name); + goto error; + } + if ((node = mxmlNewElement(parent, buffer)) == NULL) { /* @@ -1765,6 +1787,17 @@ *bufptr = '\0'; + if (parent==NULL && first!=NULL) + { + /* + * There can only be one root element! + */ + + mxml_error("<%s> cannot be a second root node after <%s>", + buffer, first->value.element.name); + goto error; + } + if ((node = mxmlNewElement(parent, buffer)) == NULL) { /* @@ -1840,6 +1873,17 @@ *bufptr = '\0'; + if (parent==NULL && first!=NULL) + { + /* + * There can only be one root element! + */ + + mxml_error("<%s> cannot be a second root node after <%s>", + buffer, first->value.element.name); + goto error; + } + if ((node = mxmlNewElement(parent, buffer)) == NULL) { /* @@ -1920,6 +1964,17 @@ * Handle open tag... */ + if (parent==NULL && first!=NULL) + { + /* + * There can only be one root element! + */ + + mxml_error("<%s> cannot be a second root node after <%s>", + buffer, first->value.element.name); + goto error; + } + if ((node = mxmlNewElement(parent, buffer)) == NULL) { /*