|
|
@ -3,7 +3,7 @@ |
|
|
|
* |
|
|
|
* |
|
|
|
* File loading code for Mini-XML, a small XML-like file parsing library. |
|
|
|
* File loading code for Mini-XML, a small XML-like file parsing library. |
|
|
|
* |
|
|
|
* |
|
|
|
* Copyright 2003-2007 by Michael Sweet. |
|
|
|
* Copyright 2003-2008 by Michael Sweet. |
|
|
|
* |
|
|
|
* |
|
|
|
* This program is free software; you can redistribute it and/or |
|
|
|
* This program is free software; you can redistribute it and/or |
|
|
|
* modify it under the terms of the GNU Library General Public |
|
|
|
* modify it under the terms of the GNU Library General Public |
|
|
@ -1843,12 +1843,15 @@ mxml_load_data( |
|
|
|
if (!first) |
|
|
|
if (!first) |
|
|
|
first = node; |
|
|
|
first = node; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!parent) |
|
|
|
|
|
|
|
{ |
|
|
|
parent = node; |
|
|
|
parent = node; |
|
|
|
|
|
|
|
|
|
|
|
if (cb) |
|
|
|
if (cb) |
|
|
|
type = (*cb)(parent); |
|
|
|
type = (*cb)(parent); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else if (buffer[0] == '!') |
|
|
|
else if (buffer[0] == '!') |
|
|
|
{ |
|
|
|
{ |
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -1910,8 +1913,19 @@ mxml_load_data( |
|
|
|
node = NULL; |
|
|
|
node = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (node && !first) |
|
|
|
if (node) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!first) |
|
|
|
first = node; |
|
|
|
first = node; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!parent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
parent = node; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cb) |
|
|
|
|
|
|
|
type = (*cb)(parent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (buffer[0] == '/') |
|
|
|
else if (buffer[0] == '/') |
|
|
|
{ |
|
|
|
{ |
|
|
@ -2111,8 +2125,6 @@ mxml_parse_element( |
|
|
|
valsize; /* Size of value string */ |
|
|
|
valsize; /* Size of value string */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Initialize the name and value buffers... |
|
|
|
* Initialize the name and value buffers... |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -2234,13 +2246,18 @@ mxml_parse_element( |
|
|
|
if (mxmlElementGetAttr(node, name)) |
|
|
|
if (mxmlElementGetAttr(node, name)) |
|
|
|
goto error; |
|
|
|
goto error; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (ch != EOF && mxml_isspace(ch)) |
|
|
|
|
|
|
|
ch = (*getc_cb)(p, encoding); |
|
|
|
|
|
|
|
|
|
|
|
if (ch == '=') |
|
|
|
if (ch == '=') |
|
|
|
{ |
|
|
|
{ |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Read the attribute value... |
|
|
|
* Read the attribute value... |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
if ((ch = (*getc_cb)(p, encoding)) == EOF) |
|
|
|
while ((ch = (*getc_cb)(p, encoding)) != EOF && mxml_isspace(ch)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ch == EOF) |
|
|
|
{ |
|
|
|
{ |
|
|
|
mxml_error("Missing value for attribute '%s' in element %s!", |
|
|
|
mxml_error("Missing value for attribute '%s' in element %s!", |
|
|
|
name, node->value.element.name); |
|
|
|
name, node->value.element.name); |
|
|
|