Support > and  .

This commit is contained in:
Michael R Sweet 2003-06-04 01:26:34 +00:00
parent 0855089dcd
commit 79c27ac3e2
3 changed files with 13 additions and 6 deletions

View File

@ -5,6 +5,8 @@ README - 06/03/2003
CHANGES IN Mini-XML 0.93
- mxmlLoadFile() now correctly handles comments.
- mxmlLoadFile() now supports the "gt" and "nbsp"
character entities.
CHANGES IN Mini-XML 0.92

View File

@ -10,7 +10,8 @@
</HEAD>
<BODY>
<P CLASS="title" ALIGN="CENTER"><A HREF="../index.html">Back to Home Page</A></P>
<P CLASS="title" ALIGN="CENTER">[&nbsp;<A
HREF="../index.html">Back to Home Page</A>&nbsp;]</P>
<H1 CLASS="title" ALIGN="CENTER">Mini-XML Home Page</H1>

View File

@ -1,5 +1,5 @@
/*
* "$Id: mxml-file.c,v 1.3 2003/06/04 01:23:21 mike Exp $"
* "$Id: mxml-file.c,v 1.4 2003/06/04 01:26:34 mike Exp $"
*
* File loading code for mini-XML, a small XML-like file parsing library.
*
@ -251,7 +251,7 @@ mxmlLoadFile(mxml_node_t *top, /* I - Top node */
{
/*
* Add character entity to current buffer... Currently we only
* support &lt;, &amp;, &#nnn;, and &#xXXXX;...
* support &lt;, &amp;, &gt;, &nbsp;, &#nnn;, and &#xXXXX;...
*/
char entity[64], /* Entity string */
@ -289,10 +289,14 @@ mxmlLoadFile(mxml_node_t *top, /* I - Top node */
else
ch = strtol(entity + 2, NULL, 10);
}
else if (!strcmp(entity, "&lt"))
ch = '<';
else if (!strcmp(entity, "&amp"))
ch = '&';
else if (!strcmp(entity, "&gt"))
ch = '>';
else if (!strcmp(entity, "&lt"))
ch = '<';
else if (!strcmp(entity, "&nbsp"))
ch = 0xa0;
else
{
fprintf(stderr, "Entity name \"%s;\" not supported under parent <%s>!\n",
@ -668,5 +672,5 @@ mxml_write_string(const char *s, /* I - String to write */
/*
* End of "$Id: mxml-file.c,v 1.3 2003/06/04 01:23:21 mike Exp $".
* End of "$Id: mxml-file.c,v 1.4 2003/06/04 01:26:34 mike Exp $".
*/