1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-02-27 17:57:22 +03:00

Big changes, seems that 1.2.0 wasn't commited, here is 1.3.0, Daniel

This commit is contained in:
Daniel Veillard 1999-06-22 21:49:07 +00:00
parent 05240da818
commit 14fff064e5
49 changed files with 3477 additions and 1520 deletions

View File

@ -1,3 +1,19 @@
Tue Jun 22 23:46:32 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* released 1.3.0 with xmlEncodeEntities restoring old behaviour
and xmlEncodeEntitiesReentrant with the correct one :-\
Mon Jun 21 14:07:53 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* commit of my internal XML base changes, quite a lot of
changes, cleanups, better entities support, framework for
new I/O and charset detection and handling
* Fixed the configure/Makefile stuff to generate shared libs
with the proper version info, so we jumped on rev from
0.0.0 to 1.2.0 ! The binary interfaces have been broken,
xmlEncodeEntities() result need to be freed now, and a string
xmlParserVersion provide the current library version.
Tue Jun 15 14:24:19 1999 Raph Levien <raph@acm.org>
* parser.c: fixed a buffer overrun for when you have a very long

View File

@ -2,7 +2,9 @@
SUBDIRS = doc
INCLUDES = -I@srcdir@ @CORBA_CFLAGS@
INCLUDES = -I@srcdir@ @CORBA_CFLAGS@ $(VERSION_FLAGS)
VERSION_FLAGS = -DLIBXML_VERSION=\"@LIBXML_VERSION@\"
noinst_PROGRAMS=tester testSAX
@ -10,6 +12,8 @@ bin_SCRIPTS=xml-config
lib_LTLIBRARIES = libxml.la
libxml_la_LDFLAGS = -version-info @LIBXML_VERSION_INFO@
libxml_la_SOURCES = \
SAX.c \
entities.c \
@ -29,6 +33,7 @@ xmlinc_HEADERS = \
debugXML.h \
xml-error.h \
tree.h \
xmlIO.h \
valid.h
DEPS = $(top_builddir)/libxml.la

5
SAX.c
View File

@ -808,10 +808,13 @@ void
comment(void *ctx, const CHAR *value)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlNodePtr ret;
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.comment(%s)\n", value);
#endif
xmlNewDocComment(ctxt->myDoc, value);
ret = xmlNewDocComment(ctxt->myDoc, value);
xmlAddChild(ctxt->node, ret);
}
xmlSAXHandler xmlDefaultSAXHandler = {

View File

@ -2,7 +2,22 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.2)
AC_INIT(entities.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(libxml, 1.1.0)
LIBXML_MAJOR_VERSION=1
LIBXML_MINOR_VERSION=3
LIBXML_MICRO_VERSION=0
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
AC_SUBST(LIBXML_MAJOR_VERSION)
AC_SUBST(LIBXML_MINOR_VERSION)
AC_SUBST(LIBXML_MICRO_VERSION)
AC_SUBST(LIBXML_VERSION)
AC_SUBST(LIBXML_VERSION_INFO)
VERSION=$LIBXML_VERSION
AM_INIT_AUTOMAKE(libxml, $VERSION)
AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])

View File

@ -15,13 +15,30 @@ TEXT="#000000"
CLASS="BOOK"
><DIV
CLASS="TITLEPAGE"
><H1
><TABLE
WIDTH="100%"
BORDER="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TH
ALIGN="center"
VALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="7"
><P
CLASS="TITLE"
><A
NAME="AEN2"
>Gnome XML Library Reference Manual</A
></H1
><HR></DIV
></P
></FONT
></TH
></TR
></TABLE
></DIV
><DIV
CLASS="TOC"
><DL
@ -30,7 +47,7 @@ CLASS="TOC"
>Table of Contents</B
></DT
><DT
>1. <A
><A
HREF="libxml.html"
>Gnome XML Library</A
></DT
@ -40,32 +57,32 @@ HREF="libxml.html"
><A
HREF="gnome-xml-parser.html"
>parser</A
> &#8212; one line description goes here.</DT
> &#8212; </DT
><DT
><A
HREF="gnome-xml-tree.html"
>tree</A
> &#8212; one line description goes here.</DT
> &#8212; </DT
><DT
><A
HREF="gnome-xml-entities.html"
>entities</A
> &#8212; one line description goes here.</DT
> &#8212; </DT
><DT
><A
HREF="gnome-xml-valid.html"
>valid</A
> &#8212; one line description goes here.</DT
> &#8212; </DT
><DT
><A
HREF="gnome-xml-xml-error.html"
>xml-error</A
> &#8212; one line description goes here.</DT
> &#8212; </DT
><DT
><A
HREF="gnome-xml-parserinternals.html"
>parserInternals</A
> &#8212; one line description goes here.</DT
> &#8212; </DT
></DL
></DD
></DL
@ -73,49 +90,70 @@ HREF="gnome-xml-parserinternals.html"
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
><BR><BR><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="34%"
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&nbsp;</B
></FONT
></TD
><TD
WIDTH="33%"
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&nbsp;</B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
VALIGN="top"
><A
HREF="libxml.html"
>Next</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
><TR
><TD
WIDTH="33%"
COLSPAN="2"
ALIGN="left"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
COLSPAN="2"
ALIGN="right"
VALIGN="top"
>Gnome XML Library</TD
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Gnome XML Library</B
></FONT
></TD
></TR
></TABLE
></DIV

View File

@ -25,61 +25,111 @@ CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
COLSPAN="4"
ALIGN="center"
>Gnome XML Library Reference Manual</TH
><FONT
COLOR="#FFFFFF"
SIZE="5"
>Gnome XML Library Reference Manual</FONT
></TH
></TR
><TR
><TD
WIDTH="10%"
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
VALIGN="bottom"
><A
HREF="gnome-xml-tree.html"
>Prev</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="80%"
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
VALIGN="bottom"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="10%"
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="libxml.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
VALIGN="bottom"
><A
HREF="gnome-xml-valid.html"
>Next</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
></DIV
><H1
>entities</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN3492"
NAME="AEN3522"
></A
><H2
>Name</H2
>entities &#8212; one line description goes here.</DIV
>entities &#8212; </DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN3495"
NAME="AEN3525"
></A
><H2
>Synopsis</H2
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -115,7 +165,7 @@ HREF="gnome-xml-entities.html#XML-INTERNAL-PREDEFINED-ENTITY"
typedef <A
HREF="gnome-xml-entities.html#XMLENTITYPTR"
>xmlEntityPtr</A
>
>;
#define <A
HREF="gnome-xml-entities.html#XML-MIN-ENTITIES-TABLE"
>XML_MIN_ENTITIES_TABLE</A
@ -123,7 +173,7 @@ HREF="gnome-xml-entities.html#XML-MIN-ENTITIES-TABLE"
typedef <A
HREF="gnome-xml-entities.html#XMLENTITIESTABLEPTR"
>xmlEntitiesTablePtr</A
>
>;
void <A
HREF="gnome-xml-entities.html#XMLADDDOCENTITY"
>xmlAddDocEntity</A
@ -266,7 +316,7 @@ HREF="gnome-xml-entities.html#XMLENTITIESTABLEPTR"
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3544"
NAME="AEN3574"
></A
><H2
>Description</H2
@ -276,14 +326,14 @@ NAME="AEN3544"
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3547"
NAME="AEN3577"
></A
><H2
>Details</H2
><HR><DIV
><DIV
CLASS="REFSECT2"
><A
NAME="AEN3549"
NAME="AEN3579"
></A
><H3
><A
@ -292,7 +342,7 @@ NAME="XML-INTERNAL-GENERAL-ENTITY"
>XML_INTERNAL_GENERAL_ENTITY</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -309,7 +359,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3554"
NAME="AEN3584"
></A
><H3
><A
@ -318,7 +368,7 @@ NAME="XML-EXTERNAL-GENERAL-PARSED-ENTITY"
>XML_EXTERNAL_GENERAL_PARSED_ENTITY</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -335,7 +385,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3559"
NAME="AEN3589"
></A
><H3
><A
@ -344,7 +394,7 @@ NAME="XML-EXTERNAL-GENERAL-UNPARSED-ENTITY"
>XML_EXTERNAL_GENERAL_UNPARSED_ENTITY</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -361,7 +411,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3564"
NAME="AEN3594"
></A
><H3
><A
@ -370,7 +420,7 @@ NAME="XML-INTERNAL-PARAMETER-ENTITY"
>XML_INTERNAL_PARAMETER_ENTITY</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -387,7 +437,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3569"
NAME="AEN3599"
></A
><H3
><A
@ -396,7 +446,7 @@ NAME="XML-EXTERNAL-PARAMETER-ENTITY"
>XML_EXTERNAL_PARAMETER_ENTITY</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -413,7 +463,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3574"
NAME="AEN3604"
></A
><H3
><A
@ -422,7 +472,7 @@ NAME="XML-INTERNAL-PREDEFINED-ENTITY"
>XML_INTERNAL_PREDEFINED_ENTITY</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -439,7 +489,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3579"
NAME="AEN3609"
></A
><H3
><A
@ -448,7 +498,7 @@ NAME="XMLENTITYPTR"
>xmlEntityPtr</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -465,7 +515,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3584"
NAME="AEN3614"
></A
><H3
><A
@ -474,7 +524,7 @@ NAME="XML-MIN-ENTITIES-TABLE"
>XML_MIN_ENTITIES_TABLE</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -491,7 +541,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3589"
NAME="AEN3619"
></A
><H3
><A
@ -500,7 +550,7 @@ NAME="XMLENTITIESTABLEPTR"
>xmlEntitiesTablePtr</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -517,16 +567,16 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3594"
NAME="AEN3624"
></A
><H3
><A
NAME="XMLADDDOCENTITY"
></A
>xmlAddDocEntity()</H3
>xmlAddDocEntity ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -568,7 +618,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -682,16 +732,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3634"
NAME="AEN3664"
></A
><H3
><A
NAME="XMLADDDTDENTITY"
></A
>xmlAddDtdEntity()</H3
>xmlAddDtdEntity ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -733,7 +783,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -847,16 +897,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3674"
NAME="AEN3704"
></A
><H3
><A
NAME="XMLGETPREDEFINEDENTITY"
></A
>xmlGetPredefinedEntity()</H3
>xmlGetPredefinedEntity ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -884,7 +934,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -928,16 +978,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3695"
NAME="AEN3725"
></A
><H3
><A
NAME="XMLGETDOCENTITY"
></A
>xmlGetDocEntity()</H3
>xmlGetDocEntity ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -971,7 +1021,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1032,16 +1082,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3721"
NAME="AEN3751"
></A
><H3
><A
NAME="XMLGETDTDENTITY"
></A
>xmlGetDtdEntity()</H3
>xmlGetDtdEntity ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1074,7 +1124,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1135,16 +1185,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3747"
NAME="AEN3777"
></A
><H3
><A
NAME="XMLENCODEENTITIES"
></A
>xmlEncodeEntities()</H3
>xmlEncodeEntities ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1180,7 +1230,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1241,16 +1291,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3774"
NAME="AEN3804"
></A
><H3
><A
NAME="XMLCREATEENTITIESTABLE"
></A
>xmlCreateEntitiesTable()</H3
>xmlCreateEntitiesTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1275,7 +1325,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1302,16 +1352,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3790"
NAME="AEN3820"
></A
><H3
><A
NAME="XMLCOPYENTITIESTABLE"
></A
>xmlCopyEntitiesTable()</H3
>xmlCopyEntitiesTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1339,7 +1389,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1383,16 +1433,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3811"
NAME="AEN3841"
></A
><H3
><A
NAME="XMLFREEENTITIESTABLE"
></A
>xmlFreeEntitiesTable()</H3
>xmlFreeEntitiesTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1417,7 +1467,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1446,16 +1496,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3827"
NAME="AEN3857"
></A
><H3
><A
NAME="XMLDUMPENTITIESTABLE"
></A
>xmlDumpEntitiesTable()</H3
>xmlDumpEntitiesTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1484,7 +1534,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1530,58 +1580,103 @@ VALIGN="TOP"
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
><BR><BR><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
VALIGN="top"
><A
HREF="gnome-xml-tree.html"
>Prev</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="34%"
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
VALIGN="top"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
>Home</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="33%"
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="libxml.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
VALIGN="top"
><A
HREF="gnome-xml-valid.html"
>Next</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
><TR
><TD
WIDTH="33%"
COLSPAN="2"
ALIGN="left"
VALIGN="top"
>tree</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="libxml.html"
>Up</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>tree</B
></FONT
></TD
><TD
WIDTH="33%"
COLSPAN="2"
ALIGN="right"
VALIGN="top"
>valid</TD
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>valid</B
></FONT
></TD
></TR
></TABLE
></DIV

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -25,61 +25,111 @@ CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
COLSPAN="4"
ALIGN="center"
>Gnome XML Library Reference Manual</TH
><FONT
COLOR="#FFFFFF"
SIZE="5"
>Gnome XML Library Reference Manual</FONT
></TH
></TR
><TR
><TD
WIDTH="10%"
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
VALIGN="bottom"
><A
HREF="gnome-xml-entities.html"
>Prev</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="80%"
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
VALIGN="bottom"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="10%"
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="libxml.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
VALIGN="bottom"
><A
HREF="gnome-xml-xml-error.html"
>Next</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
></DIV
><H1
>valid</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN3853"
NAME="AEN3883"
></A
><H2
>Name</H2
>valid &#8212; one line description goes here.</DIV
>valid &#8212; </DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN3856"
NAME="AEN3886"
></A
><H2
>Synopsis</H2
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -95,7 +145,7 @@ HREF="gnome-xml-valid.html#XML-MIN-NOTATION-TABLE"
typedef <A
HREF="gnome-xml-valid.html#XMLNOTATIONTABLEPTR"
>xmlNotationTablePtr</A
>
>;
#define <A
HREF="gnome-xml-valid.html#XML-MIN-ELEMENT-TABLE"
>XML_MIN_ELEMENT_TABLE</A
@ -103,7 +153,7 @@ HREF="gnome-xml-valid.html#XML-MIN-ELEMENT-TABLE"
typedef <A
HREF="gnome-xml-valid.html#XMLELEMENTTABLEPTR"
>xmlElementTablePtr</A
>
>;
#define <A
HREF="gnome-xml-valid.html#XML-MIN-ATTRIBUTE-TABLE"
>XML_MIN_ATTRIBUTE_TABLE</A
@ -111,7 +161,7 @@ HREF="gnome-xml-valid.html#XML-MIN-ATTRIBUTE-TABLE"
typedef <A
HREF="gnome-xml-valid.html#XMLATTRIBUTETABLEPTR"
>xmlAttributeTablePtr</A
>
>;
<A
HREF="gnome-xml-tree.html#XMLNOTATIONPTR"
>xmlNotationPtr</A
@ -327,7 +377,7 @@ HREF="gnome-xml-valid.html#XMLATTRIBUTETABLEPTR"
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3923"
NAME="AEN3953"
></A
><H2
>Description</H2
@ -337,14 +387,14 @@ NAME="AEN3923"
><DIV
CLASS="REFSECT1"
><A
NAME="AEN3926"
NAME="AEN3956"
></A
><H2
>Details</H2
><HR><DIV
><DIV
CLASS="REFSECT2"
><A
NAME="AEN3928"
NAME="AEN3958"
></A
><H3
><A
@ -353,7 +403,7 @@ NAME="XML-MIN-NOTATION-TABLE"
>XML_MIN_NOTATION_TABLE</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -370,7 +420,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3933"
NAME="AEN3963"
></A
><H3
><A
@ -379,7 +429,7 @@ NAME="XMLNOTATIONTABLEPTR"
>xmlNotationTablePtr</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -396,7 +446,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3938"
NAME="AEN3968"
></A
><H3
><A
@ -405,7 +455,7 @@ NAME="XML-MIN-ELEMENT-TABLE"
>XML_MIN_ELEMENT_TABLE</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -422,7 +472,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3943"
NAME="AEN3973"
></A
><H3
><A
@ -431,7 +481,7 @@ NAME="XMLELEMENTTABLEPTR"
>xmlElementTablePtr</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -448,7 +498,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3948"
NAME="AEN3978"
></A
><H3
><A
@ -457,7 +507,7 @@ NAME="XML-MIN-ATTRIBUTE-TABLE"
>XML_MIN_ATTRIBUTE_TABLE</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -474,7 +524,7 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3953"
NAME="AEN3983"
></A
><H3
><A
@ -483,7 +533,7 @@ NAME="XMLATTRIBUTETABLEPTR"
>xmlAttributeTablePtr</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -500,16 +550,16 @@ CLASS="PROGRAMLISTING"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3958"
NAME="AEN3988"
></A
><H3
><A
NAME="XMLADDNOTATIONDECL"
></A
>xmlAddNotationDecl()</H3
>xmlAddNotationDecl ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -549,7 +599,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -644,16 +694,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN3994"
NAME="AEN4024"
></A
><H3
><A
NAME="XMLCOPYNOTATIONTABLE"
></A
>xmlCopyNotationTable()</H3
>xmlCopyNotationTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -681,7 +731,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -725,16 +775,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4015"
NAME="AEN4045"
></A
><H3
><A
NAME="XMLFREENOTATIONTABLE"
></A
>xmlFreeNotationTable()</H3
>xmlFreeNotationTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -759,7 +809,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -788,16 +838,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4031"
NAME="AEN4061"
></A
><H3
><A
NAME="XMLDUMPNOTATIONTABLE"
></A
>xmlDumpNotationTable()</H3
>xmlDumpNotationTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -826,7 +876,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -872,16 +922,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4052"
NAME="AEN4082"
></A
><H3
><A
NAME="XMLNEWELEMENTCONTENT"
></A
>xmlNewElementContent()</H3
>xmlNewElementContent ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -910,7 +960,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -971,16 +1021,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4077"
NAME="AEN4107"
></A
><H3
><A
NAME="XMLCOPYELEMENTCONTENT"
></A
>xmlCopyElementContent()</H3
>xmlCopyElementContent ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1008,7 +1058,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1052,16 +1102,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4098"
NAME="AEN4128"
></A
><H3
><A
NAME="XMLFREEELEMENTCONTENT"
></A
>xmlFreeElementContent()</H3
>xmlFreeElementContent ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1086,7 +1136,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1115,16 +1165,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4114"
NAME="AEN4144"
></A
><H3
><A
NAME="XMLADDELEMENTDECL"
></A
>xmlAddElementDecl()</H3
>xmlAddElementDecl ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1161,7 +1211,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1256,16 +1306,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4149"
NAME="AEN4179"
></A
><H3
><A
NAME="XMLCOPYELEMENTTABLE"
></A
>xmlCopyElementTable()</H3
>xmlCopyElementTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1293,7 +1343,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1337,16 +1387,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4170"
NAME="AEN4200"
></A
><H3
><A
NAME="XMLFREEELEMENTTABLE"
></A
>xmlFreeElementTable()</H3
>xmlFreeElementTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1371,7 +1421,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1400,16 +1450,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4186"
NAME="AEN4216"
></A
><H3
><A
NAME="XMLDUMPELEMENTTABLE"
></A
>xmlDumpElementTable()</H3
>xmlDumpElementTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1438,7 +1488,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1484,16 +1534,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4207"
NAME="AEN4237"
></A
><H3
><A
NAME="XMLCREATEENUMERATION"
></A
>xmlCreateEnumeration()</H3
>xmlCreateEnumeration ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1521,7 +1571,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1566,16 +1616,16 @@ of error.</TD
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4228"
NAME="AEN4258"
></A
><H3
><A
NAME="XMLFREEENUMERATION"
></A
>xmlFreeEnumeration()</H3
>xmlFreeEnumeration ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1600,7 +1650,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1629,16 +1679,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4244"
NAME="AEN4274"
></A
><H3
><A
NAME="XMLCOPYENUMERATION"
></A
>xmlCopyEnumeration()</H3
>xmlCopyEnumeration ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1666,7 +1716,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1711,16 +1761,16 @@ of error.</TD
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4265"
NAME="AEN4295"
></A
><H3
><A
NAME="XMLADDATTRIBUTEDECL"
></A
>xmlAddAttributeDecl()</H3
>xmlAddAttributeDecl ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1766,7 +1816,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1912,16 +1962,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4314"
NAME="AEN4344"
></A
><H3
><A
NAME="XMLCOPYATTRIBUTETABLE"
></A
>xmlCopyAttributeTable()</H3
>xmlCopyAttributeTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -1949,7 +1999,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -1993,16 +2043,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4335"
NAME="AEN4365"
></A
><H3
><A
NAME="XMLFREEATTRIBUTETABLE"
></A
>xmlFreeAttributeTable()</H3
>xmlFreeAttributeTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -2027,7 +2077,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -2056,16 +2106,16 @@ VALIGN="TOP"
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4351"
NAME="AEN4381"
></A
><H3
><A
NAME="XMLDUMPATTRIBUTETABLE"
></A
>xmlDumpAttributeTable()</H3
>xmlDumpAttributeTable ()</H3
><TABLE
BORDER="0"
BGCOLOR="#E8E8F8"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
@ -2094,7 +2144,7 @@ CLASS="INFORMALTABLE"
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFE0E0"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
@ -2140,58 +2190,103 @@ VALIGN="TOP"
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
><BR><BR><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
VALIGN="top"
><A
HREF="gnome-xml-entities.html"
>Prev</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="34%"
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
VALIGN="top"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
>Home</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="33%"
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="libxml.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
VALIGN="top"
><A
HREF="gnome-xml-xml-error.html"
>Next</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
><TR
><TD
WIDTH="33%"
COLSPAN="2"
ALIGN="left"
VALIGN="top"
>entities</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="libxml.html"
>Up</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>entities</B
></FONT
></TD
><TD
WIDTH="33%"
COLSPAN="2"
ALIGN="right"
VALIGN="top"
>xml-error</TD
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>xml-error</B
></FONT
></TD
></TR
></TABLE
></DIV

View File

@ -35,6 +35,8 @@
<ANCHOR id ="HASINTERNALSUBSETSAXFUNC" href="gnome-xml/gnome-xml-parser.html#HASINTERNALSUBSETSAXFUNC">
<ANCHOR id ="HASEXTERNALSUBSETSAXFUNC" href="gnome-xml/gnome-xml-parser.html#HASEXTERNALSUBSETSAXFUNC">
<ANCHOR id ="XMLSAXHANDLERPTR" href="gnome-xml/gnome-xml-parser.html#XMLSAXHANDLERPTR">
<ANCHOR id ="XMLDEFAULTSAXLOCATOR" href="gnome-xml/gnome-xml-parser.html#XMLDEFAULTSAXLOCATOR">
<ANCHOR id ="XMLDEFAULTSAXHANDLER" href="gnome-xml/gnome-xml-parser.html#XMLDEFAULTSAXHANDLER">
<ANCHOR id ="XMLSTRDUP" href="gnome-xml/gnome-xml-parser.html#XMLSTRDUP">
<ANCHOR id ="XMLSTRNDUP" href="gnome-xml/gnome-xml-parser.html#XMLSTRNDUP">
<ANCHOR id ="XMLSTRCHR" href="gnome-xml/gnome-xml-parser.html#XMLSTRCHR">
@ -88,6 +90,9 @@
<ANCHOR id ="XMLDOCPTR" href="gnome-xml/gnome-xml-tree.html#XMLDOCPTR">
<ANCHOR id ="XMLBUFFER" href="gnome-xml/gnome-xml-tree.html#XMLBUFFER">
<ANCHOR id ="XMLBUFFERPTR" href="gnome-xml/gnome-xml-tree.html#XMLBUFFERPTR">
<ANCHOR id ="BASEDTD" href="gnome-xml/gnome-xml-tree.html#BASEDTD">
<ANCHOR id ="OLDXMLWDCOMPATIBILITY" href="gnome-xml/gnome-xml-tree.html#OLDXMLWDCOMPATIBILITY">
<ANCHOR id ="XMLINDENTTREEOUTPUT" href="gnome-xml/gnome-xml-tree.html#XMLINDENTTREEOUTPUT">
<ANCHOR id ="XMLBUFFERCREATE" href="gnome-xml/gnome-xml-tree.html#XMLBUFFERCREATE">
<ANCHOR id ="XMLBUFFERFREE" href="gnome-xml/gnome-xml-tree.html#XMLBUFFERFREE">
<ANCHOR id ="XMLBUFFERDUMP" href="gnome-xml/gnome-xml-tree.html#XMLBUFFERDUMP">
@ -279,3 +284,7 @@
<ANCHOR id ="XML-SUBSTITUTE-PEREF" href="gnome-xml/gnome-xml-parserinternals.html#XML-SUBSTITUTE-PEREF">
<ANCHOR id ="XML-SUBSTITUTE-BOTH" href="gnome-xml/gnome-xml-parserinternals.html#XML-SUBSTITUTE-BOTH">
<ANCHOR id ="XMLDECODEENTITIES" href="gnome-xml/gnome-xml-parserinternals.html#XMLDECODEENTITIES">
<ANCHOR id ="NODEPUSH" href="gnome-xml/gnome-xml-parserinternals.html#NODEPUSH">
<ANCHOR id ="NODEPOP" href="gnome-xml/gnome-xml-parserinternals.html#NODEPOP">
<ANCHOR id ="INPUTPUSH" href="gnome-xml/gnome-xml-parserinternals.html#INPUTPUSH">
<ANCHOR id ="INPUTPOP" href="gnome-xml/gnome-xml-parserinternals.html#INPUTPOP">

View File

@ -22,87 +22,89 @@ CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
COLSPAN="4"
ALIGN="center"
>Gnome XML Library Reference Manual</TH
><FONT
COLOR="#FFFFFF"
SIZE="5"
>Gnome XML Library Reference Manual</FONT
></TH
></TR
><TR
><TD
WIDTH="10%"
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
VALIGN="bottom"
><A
HREF="book1.html"
>Prev</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="80%"
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
VALIGN="bottom"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="10%"
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&nbsp;</B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
VALIGN="bottom"
><A
HREF="gnome-xml-parser.html"
>Next</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="LIBXML"
>Chapter 1. Gnome XML Library</A
>Gnome XML Library</A
></H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="gnome-xml-parser.html"
>parser</A
> &#8212; one line description goes here.</DT
><DT
><A
HREF="gnome-xml-tree.html"
>tree</A
> &#8212; one line description goes here.</DT
><DT
><A
HREF="gnome-xml-entities.html"
>entities</A
> &#8212; one line description goes here.</DT
><DT
><A
HREF="gnome-xml-valid.html"
>valid</A
> &#8212; one line description goes here.</DT
><DT
><A
HREF="gnome-xml-xml-error.html"
>xml-error</A
> &#8212; one line description goes here.</DT
><DT
><A
HREF="gnome-xml-parserinternals.html"
>parserInternals</A
> &#8212; one line description goes here.</DT
></DL
></DIV
>The parser general interfaces
Manipulation the tree generated by the parser
Routines for handling entities
@ -112,55 +114,94 @@ HREF="gnome-xml-parserinternals.html"
</DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
><BR><BR><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
VALIGN="top"
><A
HREF="book1.html"
>Prev</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="34%"
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
VALIGN="top"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
>Home</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="33%"
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&nbsp;</B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
VALIGN="top"
><A
HREF="gnome-xml-parser.html"
>Next</A
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
><TR
><TD
WIDTH="33%"
COLSPAN="2"
ALIGN="left"
VALIGN="top"
>Gnome XML Library Reference Manual</TD
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Gnome XML Library Reference Manual</B
></FONT
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
COLSPAN="2"
ALIGN="right"
VALIGN="top"
>parser</TD
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>parser</B
></FONT
></TD
></TR
></TABLE
></DIV

View File

@ -227,9 +227,6 @@ Single
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
2325 2775 1725 3375
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
2250 3600 3000 3600
2 4 0 1 0 7 0 0 -1 0.000 0 0 7 0 0 5
11250 4725 11250 4050 10275 4050 10275 4725 11250 4725
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 1 0 2
@ -282,6 +279,9 @@ Single
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
3000 4875 2625 4875
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
5100 2775 3525 3375
4 0 0 0 0 0 16 0.0000 4 150 420 3000 2250 next\001
4 0 0 0 0 0 16 0.0000 4 180 450 3975 2775 prev\001
4 0 0 0 0 0 16 0.0000 4 210 630 5100 2025 parent\001

View File

@ -20,7 +20,7 @@ href="http://www.w3.org/DOM/">DOM</a> interfaces.</p>
XML is a standard for markup based structured documents, here is <a
name="example">an example</a>:</p>
<pre>&lt;?xml version="1.0"?>
&lt;EXAMPLE prop1="gnome is great" prop2="&amp;linux; too">
&lt;EXAMPLE prop1="gnome is great" prop2="&amp;amp; linux too">
&lt;head>
&lt;title>Welcome to Gnome&lt;/title>
&lt;/head>
@ -36,7 +36,7 @@ The first line specify that it's an XML document and gives useful informations
about it's encoding. Then the document is a text format whose structure is
specified by tags between brackets. <strong>Each tag opened have to be
closed</strong> XML is pedantic about this, not that for example the image
tage has no content (just an attribute) and is closed by ending up the tag
tag has no content (just an attribute) and is closed by ending up the tag
with <code>/></code>.</p>
<h2>The tree output</h2>
@ -285,7 +285,213 @@ presents on other programs like this:</p>
<p>
This should help greatly doing things like modifying a gnumeric spreadsheet
embedded in a GWP document for example.</p>
<h3><a name="Example">A real example</a></h3>
<p>
Here is a real size example, where the actual content of the application data
is not kept in the DOM tree but uses internal structures. It is based on
a proposal to keep a database of jobs related to Gnome, with an XML based
storage structure. Here is an <a href="gjobs.xml">XML encoded jobs base</a>:
<pre>
&lt;?xml version="1.0"?>
&lt;gjob:Helping xmlns:gjob="http://www.gnome.org/some-location">
&lt;gjob:Jobs>
&lt;gjob:Job>
&lt;gjob:Project ID="3"/>
&lt;gjob:Application>GBackup&lt;/gjob:Application>
&lt;gjob:Category>Development&lt;/gjob:Category>
&lt;gjob:Update>
&lt;gjob:Status>Open&lt;/gjob:Status>
&lt;gjob:Modified>Mon, 07 Jun 1999 20:27:45 -0400 MET DST&lt;/gjob:Modified>
&lt;gjob:Salary>USD 0.00&lt;/gjob:Salary>
&lt;/gjob:Update>
&lt;gjob:Developers>
&lt;gjob:Developer>
&lt;/gjob:Developer>
&lt;/gjob:Developers>
&lt;gjob:Contact>
&lt;gjob:Person>Nathan Clemons&lt;/gjob:Person>
&lt;gjob:Email>nathan@windsofstorm.net&lt;/gjob:Email>
&lt;gjob:Company>
&lt;/gjob:Company>
&lt;gjob:Organisation>
&lt;/gjob:Organisation>
&lt;gjob:Webpage>
&lt;/gjob:Webpage>
&lt;gjob:Snailmail>
&lt;/gjob:Snailmail>
&lt;gjob:Phone>
&lt;/gjob:Phone>
&lt;/gjob:Contact>
&lt;gjob:Requirements>
The program should be released as free software, under the GPL.
&lt;/gjob:Requirements>
&lt;gjob:Skills>
&lt;/gjob:Skills>
&lt;gjob:Details>
A GNOME based system that will allow a superuser to configure
compressed and uncompressed files and/or file systems to be backed
up with a supported media in the system. This should be able to
perform via find commands generating a list of files that are passed
to tar, dd, cpio, cp, gzip, etc., to be directed to the tape machine
or via operations performed on the filesystem itself. Email
notification and GUI status display very important.
&lt;/gjob:Details>
&lt;/gjob:Job>
&lt;/gjob:Jobs>
&lt;/gjob:Helping>
</pre>
<p>
While loading the XML file into an internal DOM tree is a matter of calling
only a couple of functions, browsing the tree to gather the informations
and generate the internals structures is harder, and more error prone.
</p>
<p>
The suggested principle is to be tolerant with respect to the input
structure. For example the ordering of the attributes is not significant,
Cthe XML specification is clear about it. It's also usually a good idea
to not be dependant of the orders of the childs of a given node, unless it
really makes things harder. Here is some code to parse the informations
for a person:
</p>
<pre>
/*
* A person record
*/
typedef struct person {
char *name;
char *email;
char *company;
char *organisation;
char *smail;
char *webPage;
char *phone;
} person, *personPtr;
/*
* And the code needed to parse it
*/
personPtr parsePerson(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) {
personPtr ret = NULL;
DEBUG("parsePerson\n");
/*
* allocate the struct
*/
ret = (personPtr) malloc(sizeof(person));
if (ret == NULL) {
fprintf(stderr,"out of memory\n");
return(NULL);
}
memset(ret, 0, sizeof(person));
/* We don't care what the top level element name is */
cur = cur->childs;
while (cur != NULL) {
if ((!strcmp(cur->name, "Person")) &amp;&amp; (cur->ns == ns))
ret->name = xmlNodeListGetString(doc, cur->childs, 1);
if ((!strcmp(cur->name, "Email")) &amp;&amp; (cur->ns == ns))
ret->email = xmlNodeListGetString(doc, cur->childs, 1);
cur = cur->next;
}
return(ret);
}
</pre>
<p>
Here is a couple of things to notice:</p>
<ul>
<li> Usually a recursive parsing style is the more convenient one,
XML data being by nature subject to repetitive constructs and usualy exibit
highly stuctured patterns.
<li> The two arguments of type <em>xmlDocPtr</em> and <em>xmlNsPtr</em>, i.e.
the pointer to the global XML document and the namespace reserved to the
application. Document wide information are needed for example to decode
entities and it's a good coding practice to define a namespace for your
application set of data and test that the element and attributes you're
analyzing actually pertains to your application space. This is done by a simple
equality test (cur->ns == ns).
<li> To retrieve text and attributes value, it is suggested to use
the function <em>xmlNodeListGetString</em> to gather all the text and
entity reference nodes generated by the DOM output and produce an
single text string.
</ul>
<p>
Here is another piece of code used to parse another level of the structure:
</p>
<pre>
/*
* a Description for a Job
*/
typedef struct job {
char *projectID;
char *application;
char *category;
personPtr contact;
int nbDevelopers;
personPtr developers[100]; /* using dynamic alloc is left as an exercise */
} job, *jobPtr;
/*
* And the code needed to parse it
*/
jobPtr parseJob(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) {
jobPtr ret = NULL;
DEBUG("parseJob\n");
/*
* allocate the struct
*/
ret = (jobPtr) malloc(sizeof(job));
if (ret == NULL) {
fprintf(stderr,"out of memory\n");
return(NULL);
}
memset(ret, 0, sizeof(job));
/* We don't care what the top level element name is */
cur = cur->childs;
while (cur != NULL) {
if ((!strcmp(cur->name, "Project")) &amp;&amp; (cur->ns == ns)) {
ret->projectID = xmlGetProp(cur, "ID");
if (ret->projectID == NULL) {
fprintf(stderr, "Project has no ID\n");
}
}
if ((!strcmp(cur->name, "Application")) &amp;&amp; (cur->ns == ns))
ret->application = xmlNodeListGetString(doc, cur->childs, 1);
if ((!strcmp(cur->name, "Category")) &amp;&amp; (cur->ns == ns))
ret->category = xmlNodeListGetString(doc, cur->childs, 1);
if ((!strcmp(cur->name, "Contact")) &amp;&amp; (cur->ns == ns))
ret->contact = parsePerson(doc, ns, cur);
cur = cur->next;
}
return(ret);
}
</pre>
<p>
One can notice that once used to it, writing this kind of code
is quite simple, but boring. Ultimately, it could be possble to write
stubbers taking either C data structure definitions, a set of XML examples
or an XML DTD and produce the code needed to import and export the
content between C data and XML storage. This is left as an exercise to
the reader :-)</p>
<p>
Feel free to use <a href="gjobread.c">the code for the full C parsing
example</a> as a template,
<a href="mailto:Daniel.Veillard@w3.org">Daniel Veillard</a>
</body>
</html>

View File

@ -12,7 +12,7 @@
* [US-ASCII] Coded Character Set--7-bit American Standard Code for
* Information Interchange, ANSI X3.4-1986.
*
* Original code from "Martin J. Duerst" <duerst@w3.org>
* Original code for IsoLatin1 and UTF-16 by "Martin J. Duerst" <duerst@w3.org>
*
* See Copyright for the status of this software.
*
@ -20,6 +20,8 @@
*/
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include "encoding.h"
/*
@ -311,3 +313,168 @@ xmlParseCharEncoding(const char* name)
if (!strcmp(upper, "EUC-JP")) return(XML_CHAR_ENCODING_EUC_JP);
return(XML_CHAR_ENCODING_ERROR);
}
/****************************************************************
* *
* Char encoding handlers *
* *
****************************************************************/
/* the size should be growable, but it's not a big deal ... */
#define MAX_ENCODING_HANDLERS 50
static xmlCharEncodingHandlerPtr *handlers = NULL;
static int nbCharEncodingHandler = 0;
/*
* The default is UTF-8 for XML, that's also the default used for the
* parser internals, so the default encoding handler is NULL
*/
static xmlCharEncodingHandlerPtr xmlDefaultCharEncodingHandler = NULL;
/**
* xmlNewCharEncodingHandler:
* @name: the encoding name, in UTF-8 format (ASCCI actually)
* @input: the xmlCharEncodingInputFunc to read that encoding
* @output: the xmlCharEncodingOutputFunc to write that encoding
*
* Create and registers an xmlCharEncodingHandler.
* Returns the xmlCharEncodingHandlerPtr created (or NULL in case of error).
*/
xmlCharEncodingHandlerPtr
xmlNewCharEncodingHandler(const char *name, xmlCharEncodingInputFunc input,
xmlCharEncodingOutputFunc output) {
xmlCharEncodingHandlerPtr handler;
char upper[500];
int i;
char *up = 0;
/*
* Keep only the uppercase version of the encoding.
*/
if (name == NULL) {
fprintf(stderr, "xmlNewCharEncodingHandler : no name !\n");
return(NULL);
}
for (i = 0;i < 499;i++) {
upper[i] = toupper(name[i]);
if (upper[i] == 0) break;
}
upper[i] = 0;
up = strdup(upper);
if (up == NULL) {
fprintf(stderr, "xmlNewCharEncodingHandler : out of memory !\n");
return(NULL);
}
/*
* allocate and fill-up an handler block.
*/
handler = (xmlCharEncodingHandlerPtr)
malloc(sizeof(xmlCharEncodingHandler));
if (handler == NULL) {
fprintf(stderr, "xmlNewCharEncodingHandler : out of memory !\n");
return(NULL);
}
handler->input = input;
handler->output = output;
handler->name = up;
/*
* registers and returns the handler.
*/
xmlRegisterCharEncodingHandler(handler);
return(handler);
}
/**
* xmlInitCharEncodingHandlers:
*
* Initialize the char encoding support, it registers the default
* encoding supported.
* NOTE: while public theis function usually don't need to be called
* in normal processing.
*/
void
xmlInitCharEncodingHandlers(void) {
if (handlers != NULL) return;
handlers = (xmlCharEncodingHandlerPtr *)
malloc(MAX_ENCODING_HANDLERS * sizeof(xmlCharEncodingHandlerPtr));
if (handlers == NULL) {
fprintf(stderr, "xmlInitCharEncodingHandlers : out of memory !\n");
return;
}
xmlNewCharEncodingHandler("UTF-8", NULL, NULL);
xmlNewCharEncodingHandler("UTF-16", UTF16ToUTF8, UTF8ToUTF16);
xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, UTF8Toisolat1);
}
/**
* xmlRegisterCharEncodingHandler:
* @handler: the xmlCharEncodingHandlerPtr handler block
*
* Register the char encoding handler, surprizing, isn't it ?
*/
void
xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler) {
if (handlers == NULL) xmlInitCharEncodingHandlers();
if (handler == NULL) {
fprintf(stderr, "xmlRegisterCharEncodingHandler: NULL handler !\n");
return;
}
if (nbCharEncodingHandler >= MAX_ENCODING_HANDLERS) {
fprintf(stderr,
"xmlRegisterCharEncodingHandler: Too many handler registered\n");
fprintf(stderr, "\tincrease MAX_ENCODING_HANDLERS : %s\n", __FILE__);
return;
}
handlers[nbCharEncodingHandler++] = handler;
}
/**
* xmlGetCharEncodingHandler:
* @enc: an xmlCharEncoding value.
*
* Search in the registrered set the handler able to read/write that encoding.
*
* Returns the handler or NULL if not found
*/
xmlCharEncodingHandlerPtr
xmlGetCharEncodingHandler(xmlCharEncoding enc) {
if (handlers == NULL) xmlInitCharEncodingHandlers();
return(NULL);
}
/**
* xmlGetCharEncodingHandler:
* @enc: a string describing the char encoding.
*
* Search in the registrered set the handler able to read/write that encoding.
*
* Returns the handler or NULL if not found
*/
xmlCharEncodingHandlerPtr
xmlFindCharEncodingHandler(const char *name) {
char upper[500];
int i;
if (handlers == NULL) xmlInitCharEncodingHandlers();
if (name == NULL) return(xmlDefaultCharEncodingHandler);
if (name[0] == 0) return(xmlDefaultCharEncodingHandler);
for (i = 0;i < 499;i++) {
upper[i] = toupper(name[i]);
if (upper[i] == 0) break;
}
upper[i] = 0;
for (i = 0;i < nbCharEncodingHandler; i++)
if (!strcmp(name, handlers[i]->name))
return(handlers[i]);
return(NULL);
}

View File

@ -25,6 +25,9 @@
extern "C" {
#endif
/**
* Predefined values for some standard encodings
*/
typedef enum {
XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */
XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */
@ -51,8 +54,57 @@ typedef enum {
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
} xmlCharEncoding;
extern xmlCharEncoding xmlDetectCharEncoding(const unsigned char* in);
extern xmlCharEncoding xmlParseCharEncoding(const char* name);
/**
* xmlCharEncodingInputFunc:
* @out: a pointer ot an array of bytes to store the UTF-8 result
* @outlen: the lenght of @out
* @in: a pointer ot an array of chars in the original encoding
* @inlen: the lenght of @in
*
* Take a block of chars in the original encoding and try to convert
* it to an UTF-8 block of chars out.
*
* Returns the number of byte written, or -1 by lack of space.
*/
typedef int (* xmlCharEncodingInputFunc)(unsigned char* out, int outlen,
unsigned char* in, int inlen);
/**
* xmlCharEncodingInputFunc:
* @out: a pointer ot an array of bytes to store the result
* @outlen: the lenght of @out
* @in: a pointer ot an array of UTF-8 chars
* @inlen: the lenght of @in
*
* Take a block of UTF-8 chars in and try to convert it to an other
* encoding.
*
* Returns the number of byte written, or -1 by lack of space, or -2
* if the transcoding failed.
*/
typedef int (* xmlCharEncodingOutputFunc)(unsigned char* out, int outlen,
unsigned char* in, int inlen);
/*
* Block defining the handlers for non UTF-8 encodings.
*/
typedef struct xmlCharEncodingHandler {
char *name;
xmlCharEncodingInputFunc input;
xmlCharEncodingOutputFunc output;
} xmlCharEncodingHandler;
typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
void xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler);
xmlCharEncodingHandlerPtr xmlGetCharEncodingHandler(xmlCharEncoding enc);
xmlCharEncodingHandlerPtr xmlFindCharEncodingHandler(const char *name);
xmlCharEncoding xmlDetectCharEncoding(const unsigned char* in);
xmlCharEncoding xmlParseCharEncoding(const char* name);
void xmlInitCharEncodingHandlers(void);
#ifdef __cplusplus
}

View File

@ -29,19 +29,6 @@ struct xmlPredefinedEntityValue xmlPredefinedEntityValues[] = {
xmlEntitiesTablePtr xmlPredefinedEntities = NULL;
/*
* Macro used to grow the current buffer.
*/
#define growBuffer() { \
buffer_size *= 2; \
buffer = (CHAR *) realloc(buffer, buffer_size * sizeof(CHAR)); \
if (buffer == NULL) { \
perror("realloc failed"); \
exit(1); \
} \
}
/*
* xmlFreeEntity : clean-up an entity record.
*/
@ -301,6 +288,25 @@ xmlGetDocEntity(xmlDocPtr doc, const CHAR *name) {
(((c) == 0x09) || ((c) == 0x0a) || ((c) == 0x0d) || \
(((c) >= 0x20) && ((c) != 0xFFFE) && ((c) != 0xFFFF)))
/*
* A buffer used for converting entities to their equivalent and back.
*
* TODO: remove this, this helps performances but forbid reentrancy in a
* stupid way.
*/
static int buffer_size = 0;
static CHAR *buffer = NULL;
void growBuffer(void) {
buffer_size *= 2;
buffer = (CHAR *) realloc(buffer, buffer_size * sizeof(CHAR));
if (buffer == NULL) {
perror("realloc failed");
exit(1);
}
}
/**
* xmlEncodeEntities:
* @doc: the document containing the string
@ -312,10 +318,142 @@ xmlGetDocEntity(xmlDocPtr doc, const CHAR *name) {
* TODO !!!! Once moved to UTF-8 internal encoding, the encoding of non-ascii
* get erroneous.
*
* TODO This routine is not reentrant, the interface
* should not be modified though.
*
* People must migrate their code to xmlEncodeEntitiesReentrant !
*
* Returns A newly allocated string with the substitution done.
*/
const CHAR *
xmlEncodeEntities(xmlDocPtr doc, const CHAR *input) {
const CHAR *cur = input;
CHAR *out = buffer;
if (input == NULL) return(NULL);
if (buffer == NULL) {
buffer_size = 1000;
buffer = (CHAR *) malloc(buffer_size * sizeof(CHAR));
if (buffer == NULL) {
perror("malloc failed");
exit(1);
}
out = buffer;
}
while (*cur != '\0') {
if (out - buffer > buffer_size - 100) {
int index = out - buffer;
growBuffer();
out = &buffer[index];
}
/*
* By default one have to encode at least '<', '>', '"' and '&' !
*/
if (*cur == '<') {
*out++ = '&';
*out++ = 'l';
*out++ = 't';
*out++ = ';';
} else if (*cur == '>') {
*out++ = '&';
*out++ = 'g';
*out++ = 't';
*out++ = ';';
} else if (*cur == '&') {
*out++ = '&';
*out++ = 'a';
*out++ = 'm';
*out++ = 'p';
*out++ = ';';
} else if (*cur == '"') {
*out++ = '&';
*out++ = 'q';
*out++ = 'u';
*out++ = 'o';
*out++ = 't';
*out++ = ';';
} else if (*cur == '\'') {
*out++ = '&';
*out++ = 'a';
*out++ = 'p';
*out++ = 'o';
*out++ = 's';
*out++ = ';';
} else if (((*cur >= 0x20) && (*cur < 0x80)) ||
(*cur == '\n') || (*cur == '\r') || (*cur == '\t')) {
/*
* default case, just copy !
*/
*out++ = *cur;
#ifndef USE_UTF_8
} else if ((sizeof(CHAR) == 1) && (*cur >= 0x80)) {
char buf[10], *ptr;
#ifdef HAVE_SNPRINTF
snprintf(buf, 9, "&#%d;", *cur);
#else
sprintf(buf, "&#%d;", *cur);
#endif
ptr = buf;
while (*ptr != 0) *out++ = *ptr++;
#endif
} else if (IS_CHAR(*cur)) {
char buf[10], *ptr;
#ifdef HAVE_SNPRINTF
snprintf(buf, 9, "&#%d;", *cur);
#else
sprintf(buf, "&#%d;", *cur);
#endif
ptr = buf;
while (*ptr != 0) *out++ = *ptr++;
}
#if 0
else {
/*
* default case, this is not a valid char !
* Skip it...
*/
fprintf(stderr, "xmlEncodeEntities: invalid char %d\n", (int) *cur);
}
#endif
cur++;
}
*out++ = 0;
return(buffer);
}
/*
* Macro used to grow the current buffer.
*/
#define growBufferReentrant() { \
buffer_size *= 2; \
buffer = (CHAR *) realloc(buffer, buffer_size * sizeof(CHAR)); \
if (buffer == NULL) { \
perror("realloc failed"); \
exit(1); \
} \
}
/**
* xmlEncodeEntitiesReentrant:
* @doc: the document containing the string
* @input: A string to convert to XML.
*
* Do a global encoding of a string, replacing the predefined entities
* and non ASCII values with their entities and CharRef counterparts.
* Contrary to xmlEncodeEntities, this routine is reentrant, and result
* must be deallocated.
*
* TODO !!!! Once moved to UTF-8 internal encoding, the encoding of non-ascii
* get erroneous.
*
* Returns A newly allocated string with the substitution done.
*/
CHAR *
xmlEncodeEntities(xmlDocPtr doc, const CHAR *input) {
xmlEncodeEntitiesReentrant(xmlDocPtr doc, const CHAR *input) {
const CHAR *cur = input;
CHAR *buffer = NULL;
CHAR *out = NULL;
@ -338,7 +476,7 @@ xmlEncodeEntities(xmlDocPtr doc, const CHAR *input) {
if (out - buffer > buffer_size - 100) {
int index = out - buffer;
growBuffer();
growBufferReentrant();
out = &buffer[index];
}

View File

@ -66,7 +66,8 @@ void xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
xmlEntityPtr xmlGetPredefinedEntity(const CHAR *name);
xmlEntityPtr xmlGetDocEntity(xmlDocPtr doc, const CHAR *name);
xmlEntityPtr xmlGetDtdEntity(xmlDocPtr doc, const CHAR *name);
CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
CHAR *xmlEncodeEntitiesReentrant(xmlDocPtr doc, const CHAR *input);
xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
void xmlFreeEntitiesTable(xmlEntitiesTablePtr table);

View File

@ -25,6 +25,9 @@
extern "C" {
#endif
/**
* Predefined values for some standard encodings
*/
typedef enum {
XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */
XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */
@ -51,8 +54,57 @@ typedef enum {
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
} xmlCharEncoding;
extern xmlCharEncoding xmlDetectCharEncoding(const unsigned char* in);
extern xmlCharEncoding xmlParseCharEncoding(const char* name);
/**
* xmlCharEncodingInputFunc:
* @out: a pointer ot an array of bytes to store the UTF-8 result
* @outlen: the lenght of @out
* @in: a pointer ot an array of chars in the original encoding
* @inlen: the lenght of @in
*
* Take a block of chars in the original encoding and try to convert
* it to an UTF-8 block of chars out.
*
* Returns the number of byte written, or -1 by lack of space.
*/
typedef int (* xmlCharEncodingInputFunc)(unsigned char* out, int outlen,
unsigned char* in, int inlen);
/**
* xmlCharEncodingInputFunc:
* @out: a pointer ot an array of bytes to store the result
* @outlen: the lenght of @out
* @in: a pointer ot an array of UTF-8 chars
* @inlen: the lenght of @in
*
* Take a block of UTF-8 chars in and try to convert it to an other
* encoding.
*
* Returns the number of byte written, or -1 by lack of space, or -2
* if the transcoding failed.
*/
typedef int (* xmlCharEncodingOutputFunc)(unsigned char* out, int outlen,
unsigned char* in, int inlen);
/*
* Block defining the handlers for non UTF-8 encodings.
*/
typedef struct xmlCharEncodingHandler {
char *name;
xmlCharEncodingInputFunc input;
xmlCharEncodingOutputFunc output;
} xmlCharEncodingHandler;
typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
void xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler);
xmlCharEncodingHandlerPtr xmlGetCharEncodingHandler(xmlCharEncoding enc);
xmlCharEncodingHandlerPtr xmlFindCharEncodingHandler(const char *name);
xmlCharEncoding xmlDetectCharEncoding(const unsigned char* in);
xmlCharEncoding xmlParseCharEncoding(const char* name);
void xmlInitCharEncodingHandlers(void);
#ifdef __cplusplus
}

View File

@ -66,7 +66,8 @@ void xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
xmlEntityPtr xmlGetPredefinedEntity(const CHAR *name);
xmlEntityPtr xmlGetDocEntity(xmlDocPtr doc, const CHAR *name);
xmlEntityPtr xmlGetDtdEntity(xmlDocPtr doc, const CHAR *name);
CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
CHAR *xmlEncodeEntitiesReentrant(xmlDocPtr doc, const CHAR *input);
xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
void xmlFreeEntitiesTable(xmlEntitiesTablePtr table);

View File

@ -10,6 +10,7 @@
#define __XML_PARSER_H__
#include "tree.h"
#include "xmlIO.h"
#ifdef __cplusplus
extern "C" {
@ -22,6 +23,9 @@ extern "C" {
typedef void (* xmlParserInputDeallocate)(CHAR *);
typedef struct xmlParserInput {
/* Input buffer */
xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
const char *filename; /* The file analyzed, if any */
const CHAR *base; /* Base of the array to parse */
const CHAR *cur; /* Current char being parsed */
@ -169,8 +173,10 @@ typedef xmlSAXHandler *xmlSAXHandlerPtr;
/*
* Global variables: just the SAX interface tables we are looking for full
* reentrancy of the code !
* reentrancy of the code and version infos.
*/
extern const char *xmlParserVersion;
extern xmlSAXLocator xmlDefaultSAXLocator;
extern xmlSAXHandler xmlDefaultSAXHandler;

View File

@ -614,10 +614,10 @@ void
xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt);
CHAR *
xmlParseAttribute(xmlParserCtxtPtr ctxt, CHAR **value);
void
CHAR *
xmlParseStartTag(xmlParserCtxtPtr ctxt);
void
xmlParseEndTag(xmlParserCtxtPtr ctxt);
xmlParseEndTag(xmlParserCtxtPtr ctxt, CHAR *tagname);
void
xmlParseCDSect(xmlParserCtxtPtr ctxt);
void

40
include/libxml/xmlIO.h Normal file
View File

@ -0,0 +1,40 @@
/*
* xmlIO.h : interface for the I/O interfaces used by the parser
*
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*/
#ifndef __XML_IO_H__
#define __XML_IO_H__
#include <stdio.h>
#include "tree.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct xmlParserInputBuffer {
/* Inputs */
FILE *file; /* Input on file handler */
int fd; /* Input on a file descriptor */
/**********
#ifdef HAVE_ZLIB_H
gzFile gzfile; Input on a compressed stream
#endif
*/
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
} xmlParserInputBuffer;
typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
#ifdef __cplusplus
}
#endif
#endif /* __XML_IO_H__ */

View File

@ -34,6 +34,8 @@
#include "valid.h"
#include "parserInternals.h"
const char *xmlParserVersion = LIBXML_VERSION;
/************************************************************************
* *
* Parser stacks related functions and macros *
@ -2845,6 +2847,9 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) {
ctxt->sax->elementDecl(ctxt->userData, name, ret,
content);
}
if (content != NULL) {
xmlFreeElementContent(content);
}
if (name != NULL) {
free(name);
}
@ -3162,7 +3167,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
*/
xmlEntityPtr
xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
const CHAR *q;
const CHAR *q; /* !!!!!!!!!!! Unused !!!!!!!!!! */
CHAR *name;
xmlEntityPtr ent = NULL;
@ -3482,9 +3487,11 @@ xmlParseAttribute(xmlParserCtxtPtr ctxt, CHAR **value) {
* [NS 8] STag ::= '<' QName (S Attribute)* S? '>'
*
* [NS 10] EmptyElement ::= '<' QName (S Attribute)* S? '/>'
*
* Returns the element name parsed
*/
void
CHAR *
xmlParseStartTag(xmlParserCtxtPtr ctxt) {
CHAR *name;
CHAR *attname;
@ -3494,7 +3501,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
int maxatts = 0;
int i;
if (CUR != '<') return;
if (CUR != '<') return(NULL);
NEXT;
name = xmlParseName(ctxt);
@ -3503,7 +3510,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
ctxt->sax->error(ctxt->userData,
"xmlParseStartTag: invalid element name\n");
ctxt->wellFormed = 0;
return;
return(NULL);
}
/*
@ -3543,7 +3550,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
if (atts == NULL) {
fprintf(stderr, "malloc of %d byte failed\n",
maxatts * sizeof(CHAR *));
return;
return(NULL);
}
} else if (nbatts + 2 < maxatts) {
maxatts *= 2;
@ -3551,7 +3558,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
if (atts == NULL) {
fprintf(stderr, "realloc of %d byte failed\n",
maxatts * sizeof(CHAR *));
return;
return(NULL);
}
}
atts[nbatts++] = attname;
@ -3576,16 +3583,17 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
ctxt->sax->startElement(ctxt->userData, name, atts);
free(name);
if (atts != NULL) {
for (i = 0;i < nbatts;i++) free((CHAR *) atts[i]);
free(atts);
}
return(name);
}
/**
* xmlParseEndTag:
* @ctxt: an XML parser context
* @tagname: the tag name as parsed in the opening tag.
*
* parse an end of tag
*
@ -3597,7 +3605,7 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
*/
void
xmlParseEndTag(xmlParserCtxtPtr ctxt) {
xmlParseEndTag(xmlParserCtxtPtr ctxt, CHAR *tagname) {
CHAR *name;
if ((CUR != '<') || (NXT(1) != '/')) {
@ -3621,6 +3629,16 @@ xmlParseEndTag(xmlParserCtxtPtr ctxt) {
} else
NEXT;
/*
* Well formedness constraints, opening and closing must match.
*/
if (xmlStrcmp(name, tagname)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Opening and ending tag mismatch: %s and %s\n", tagname, name);
ctxt->wellFormed = 0;
}
/*
* SAX: End of Tag
*/
@ -3792,13 +3810,17 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
void
xmlParseElement(xmlParserCtxtPtr ctxt) {
const CHAR *openTag = CUR_PTR;
CHAR *name;
xmlParserNodeInfo node_info;
/* Capture start position */
node_info.begin_pos = CUR_PTR - ctxt->input->base;
node_info.begin_line = ctxt->input->line;
xmlParseStartTag(ctxt);
name = xmlParseStartTag(ctxt);
if (name == NULL) {
return;
}
/*
* Check for an Empty Element.
@ -3806,7 +3828,8 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
if ((CUR == '/') && (NXT(1) == '>')) {
SKIP(2);
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
ctxt->sax->endElement(ctxt->userData, NULL);
ctxt->sax->endElement(ctxt->userData, name);
free(name);
return;
}
if (CUR == '>') NEXT;
@ -3818,10 +3841,9 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
/*
* end of parsing of this node.
* TODO !!!!!!!! check the macro in case of non DOM parsing
*/
nodePop(ctxt);
free(name);
return;
}
@ -3837,17 +3859,17 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
/*
* end of parsing of this node.
* TODO !!!!!!!! check the macro in case of non DOM parsing
*/
nodePop(ctxt);
free(name);
return;
}
/*
* parse the end of tag: '</' should be here.
*/
xmlParseEndTag(ctxt);
xmlParseEndTag(ctxt, name);
free(name);
}
/**
@ -4451,7 +4473,7 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const CHAR *ExternalID,
const CHAR *SystemID) {
xmlDtdPtr ret = NULL;
xmlParserCtxtPtr ctxt;
xmlParserInputPtr input;
xmlParserInputPtr input = NULL;
xmlCharEncoding enc;
if ((ExternalID == NULL) && (SystemID == NULL)) return(NULL);
@ -4462,12 +4484,6 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const CHAR *ExternalID,
return(NULL);
}
xmlInitParserCtxt(ctxt);
input = (xmlParserInputPtr) malloc(sizeof(xmlParserInput));
if (input == NULL) {
perror("malloc");
free(ctxt);
return(NULL);
}
/*
* Set-up the SAX context
@ -4641,7 +4657,7 @@ retry_bigger:
close(input);
#endif
buffer[buf.st_size] = '\0';
buffer[res] = '\0';
ctxt = (xmlParserCtxtPtr) malloc(sizeof(xmlParserCtxt));
if (ctxt == NULL) {

View File

@ -10,6 +10,7 @@
#define __XML_PARSER_H__
#include "tree.h"
#include "xmlIO.h"
#ifdef __cplusplus
extern "C" {
@ -22,6 +23,9 @@ extern "C" {
typedef void (* xmlParserInputDeallocate)(CHAR *);
typedef struct xmlParserInput {
/* Input buffer */
xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
const char *filename; /* The file analyzed, if any */
const CHAR *base; /* Base of the array to parse */
const CHAR *cur; /* Current char being parsed */
@ -169,8 +173,10 @@ typedef xmlSAXHandler *xmlSAXHandlerPtr;
/*
* Global variables: just the SAX interface tables we are looking for full
* reentrancy of the code !
* reentrancy of the code and version infos.
*/
extern const char *xmlParserVersion;
extern xmlSAXLocator xmlDefaultSAXLocator;
extern xmlSAXHandler xmlDefaultSAXHandler;

View File

@ -614,10 +614,10 @@ void
xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt);
CHAR *
xmlParseAttribute(xmlParserCtxtPtr ctxt, CHAR **value);
void
CHAR *
xmlParseStartTag(xmlParserCtxtPtr ctxt);
void
xmlParseEndTag(xmlParserCtxtPtr ctxt);
xmlParseEndTag(xmlParserCtxtPtr ctxt, CHAR *tagname);
void
xmlParseCDSect(xmlParserCtxtPtr ctxt);
void

View File

@ -12,26 +12,27 @@
<defs>
<symbol id="spoke">
<desc>14/12 gauge double butted spoke</desc>
</symbol>
<!-- the path data goes here --> </symbol>
<symbol id="hub">
<desc>black anodised low torsion hub</desc>
</symbol>
<!--the path data goes here --> </symbol>
<symbol id="rim">
<desc>twin wall, eyeletted rim</desc>
</symbol>
<!-- the path data goes here--> </symbol>
<symbol id="cogs">
<desc>8 speed, wide ratio gearing</desc>
</symbol>
<!--the path data goes here --> </symbol>
<symbol id="lacing">
<desc>double cross lacing of 32 spokes</desc>
</symbol>
</defs>
<g id="frontwheel">
<!-- the overall bike drawing goes here --> <g id="frontwheel">
<title>Front wheel</title>
<desc>The front wheel provides grip, steering and some shock absorption</desc>
<use href="id(lacing)" style="rotation: 20deg; fillcolor: black"/>
</g>
<g id="backwheel"/>
<g id="frame"/>
<g id="frame">
<!-- and so on --> </g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -9,4 +9,5 @@
</defs>
<desc>Defining things for later use
</desc>
</svg>
<!-- SVG elements in here would reference/use
the elements defined in the <defs> --></svg>

Before

Width:  |  Height:  |  Size: 417 B

After

Width:  |  Height:  |  Size: 510 B

View File

@ -9,5 +9,5 @@
This is a bar chart which shows
company sales by region.
</desc>
</g>
<!-- Bar chart defined as vector data --> </g>
</svg>

Before

Width:  |  Height:  |  Size: 304 B

After

Width:  |  Height:  |  Size: 345 B

View File

@ -6,7 +6,7 @@
<g>
<defs>
<lineargradient id="MyGradient">
<gradientstop offset="0%" color="#F60"/>
<!-- Define linear gradient here --> <gradientstop offset="0%" color="#F60"/>
<gradientstop offset="70%" color="#FF6"/>
</lineargradient>
</defs>

Before

Width:  |  Height:  |  Size: 483 B

After

Width:  |  Height:  |  Size: 519 B

View File

@ -9,11 +9,12 @@
<desc>An double-headed arrow example using markers
</desc>
<path d="M0 0">
<marker href="#Triangle" width="200" height="200" style="text-transform: rotate(180)"/>
<!-- Place an arrowhead rotated 180 degrees at the
beginning of the path --> <marker href="#Triangle" width="200" height="200" style="text-transform: rotate(180)"/>
<data d="M 2000 2000"/>
<marker href=""/>
<!-- Turn off markers in the middle of the path --> <marker href=""/>
<data d="L 4000 2000 L 4000 4000"/>
<marker href="#Triangle" width="200" height="200"/>
<!-- Place an arrowhead at the end of the path--> <marker href="#Triangle" width="200" height="200"/>
<data d="L 6000 4000"/>
</path>
</svg>

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 894 B

View File

@ -4,10 +4,17 @@
fallback graphical representation of an equation, if
MathML is not supported.
</desc>
<switch>
<foreignobject system-required="http://www.w3.org/TR/REC-MathML-19980407" width="100" height="50"/>
<g>
<rect style="fill: red"/>
<!-- The <switch> element will process the first child element
whose testing attributes evaluate to true.--> <switch>
<!-- Process the MathML if the system-required attribute
evaluates to true (i.e., the user agent supports MathML
embedded within SVG). --> <foreignobject system-required="http://www.w3.org/TR/REC-MathML-19980407" width="100" height="50">
<!-- MathML content goes here --> </foreignobject>
<!-- Else, process the following alternate SVG.
Note that there are no testing attributes on the <g> element.
If no testing attributes are provided, it is as if there
were testing attributes and they evaluated to true.--> <g>
<!-- Draw a red rectangle with a text string on top. --> <rect style="fill: red"/>
<text>Formula goes here</text>
</g>
</switch>

Before

Width:  |  Height:  |  Size: 501 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ABC xmlns="http://parent.name.space" xmlns:svg="http://www.w3.org/Graphics/SVG/1.0">
<svg:svg width="40%" height="40%">
<!-- document in the parent namespace --> <svg:svg width="40%" height="40%">
<svg:rectangle width="43.6" height="31.5"/>
</svg:svg>
</ABC>
<!-- svg graphic continues --> </svg:svg>
<!-- document in parent namespace continues --></ABC>

View File

@ -2,7 +2,9 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
<svg width="4in" height="3in">
<defs>
<symbol id="fourstar"/>
<symbol id="fourstar">
<!-- Define the pattern using standard graphics elements
such as paths, images, text and shapes --> </symbol>
</defs>
<ellipse style="fill: url(#fourstar)" major="40" minor="27"/>
</svg>

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 416 B

View File

@ -7,9 +7,10 @@
<myapp:piece label="Eastern Region" value="2.53"/>
<myapp:piece label="Southern Region" value="3.89"/>
<myapp:piece label="Western Region" value="2.04"/>
</myapp:piechart>
<!-- Other private data goes here --> </myapp:piechart>
</private>
</defs>
<desc>This chart includes private data in another namespace
</desc>
</svg>
<!-- In here would be the actual graphics elements which
draw the pie chart --></svg>

Before

Width:  |  Height:  |  Size: 601 B

After

Width:  |  Height:  |  Size: 725 B

View File

@ -7,5 +7,6 @@
<mydoc:emph>mydoc</mydoc:emph>
namespace. </mydoc:para>
</desc>
<g/>
<g>
<!-- the picture goes here --> </g>
</svg>

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 426 B

View File

@ -1,6 +1,6 @@
<?xml version="1.0" standalone="yes"?>
<parent xmlns="http://someplace.org" xmlns:svg="http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
<svg:svg width="5cm" height="8cm">
<!-- parent stuff here --> <svg:svg width="5cm" height="8cm">
<svg:ellipse major="200" minor="130"/>
</svg:svg>
</parent>
<!-- ... --></parent>

View File

@ -1,9 +1,13 @@
<?xml version="1.0" standalone="yes"?>
<smil>
<body>
<switch>
<ref system-required="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" type="image/svg" src="drawing.svg"/>
<img src="alternate_image.jpg"/>
<!-- The SMIL <switch> element will process the
first child element which tests true and skip
past all others. --> <switch>
<!-- The system-required attribute tests to see if
the user agent supports SVG. If true, then
render the file drawing.svg. --> <ref system-required="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" type="image/svg" src="drawing.svg"/>
<!-- Else, render the alternate image. --> <img src="alternate_image.jpg"/>
</switch>
</body>
</smil>

View File

@ -2,13 +2,15 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG April 1999//EN" "http://www.w3.org/Graphics/SVG/svg-19990412.dtd">
<svg width="4in" height="3in">
<defs>
<symbol id="TemplateObject01"/>
<symbol id="TemplateObject01">
<!-- symbol definition here --> </symbol>
</defs>
<desc>Examples of inline and referenced content
</desc>
<g/>
<use href="#TemplateObject01"/>
<g>
<!-- <g> with inline content --> <g>
<!-- Inline content goes here --> </g>
<!-- referenced content --> <use href="#TemplateObject01"/>
<!-- <g> with both referenced and inline content --> <g>
<use href="#TemplateObject01"/>
</g>
<!-- Inline content goes here --> </g>
</svg>

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 614 B

View File

@ -3,10 +3,14 @@
<svg width="4in" height="3in">
<desc>Demonstration of coordinate transforms
</desc>
<text style="font-size: 12">This prints 12 pixels high.</text>
<!-- The following two text elements will both draw with a
font height of 12 pixels --> <text style="font-size: 12">This prints 12 pixels high.</text>
<text style="font-size: 12px">This prints 12 pixels high.</text>
<g style="transform: scale(2)">
<text style="font-size: 12">This prints 24 pixels high.</text>
<text style="font-size: 12px">This prints 12 pixels high.</text>
<!-- Now scale the coordinate system by 2. --> <g style="transform: scale(2)">
<!-- The following text will actually draw 24 pixels high
because each unit in the new coordinate system equals
2 units in the previous coordinate system. --> <text style="font-size: 12">This prints 24 pixels high.</text>
<!-- The following text will actually still draw 12 pixels high
because the CSS unit specifier has been provided. --> <text style="font-size: 12px">This prints 12 pixels high.</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 548 B

After

Width:  |  Height:  |  Size: 1002 B

View File

@ -1,2 +1,3 @@
<?xml version="1.0" standalone="yes"?>
<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in"/>
<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="4in" height="3in">
<!-- Insert drawing elements here --></svg>

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 170 B

View File

@ -4,5 +4,7 @@
<desc>This SVG drawing embeds another one,
thus establishing a new viewport
</desc>
<svg style="left: 25%; top: 25%" width="50%" height="50%"/>
<!-- The following statement establishing a new viewport
and renders SVG drawing B into that viewport --> <svg style="left: 25%; top: 25%" width="50%" height="50%">
<!-- drawing B goes here --> </svg>
</svg>

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 486 B

View File

@ -3,15 +3,26 @@
<svg width="300px" height="3oopx">
<desc>Transformation with establishment of a new viewport
</desc>
<text style="font-size: 12">This prints 12 pixels high.</text>
<!-- The following two text elements will both draw with a
font height of 12 pixels --> <text style="font-size: 12">This prints 12 pixels high.</text>
<text style="font-size: 12px">This prints 12 pixels high.</text>
<g style="transform: scale(2)">
<text style="font-size: 12">This prints 24 pixels high.</text>
<text style="font-size: 12px">This prints 12 pixels high.</text>
<!-- Now scale the coordinate system by 2. --> <g style="transform: scale(2)">
<!-- The following text will actually draw 24 pixels high
because each unit in the new coordinate system equals
2 units in the previous coordinate system. --> <text style="font-size: 12">This prints 24 pixels high.</text>
<!-- The following text will actually still draw 12 pixels high
because the CSS unit specifier has been provided. --> <text style="font-size: 12px">This prints 12 pixels high.</text>
</g>
<g style="transform: scale(3)">
<svg style="left:0; top:0; right:100; bottom:100" width="100%" height="100%">
<text style="font-size: 12">This prints 36 pixels high.</text>
<!-- This time, scale the coordinate system by 3. --> <g style="transform: scale(3)">
<!-- Establish a new viewport and thus change the meaning of
some CSS unit specifiers. --> <svg style="left:0; top:0; right:100; bottom:100" width="100%" height="100%">
<!-- The following two text elements will both draw with a
font height of 36 screen pixels. The first text element
defines its height in user coordinates, which have been
scaled by 3. The second text element defines its height
in CSS px units, which have been redefined to be three times
as big as screen pixels due the <svg> element establishing
a new viewport. --> <text style="font-size: 12">This prints 36 pixels high.</text>
<text style="font-size: 12px">This prints 36 pixels high.</text>
</svg>
</g>

Before

Width:  |  Height:  |  Size: 839 B

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,6 +1,6 @@
<?xml version="1.0" standalone="yes"?>
<parent xmlns="http://some.url">
<svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="100px" height="200px">
<!-- SVG graphic --> <svg xmlns="http://www.w3.org/Graphics/SVG/svg-19990412.dtd" width="100px" height="200px">
<path d="M100,100 Q200,400,300,100"/>
</svg>
<!-- rest of SVG graphic would go here --> </svg>
</parent>

View File

@ -177,8 +177,16 @@ internalSubsetDebug(xmlParserCtxtPtr ctxt, const CHAR *name,
xmlParserInputPtr
resolveEntityDebug(xmlParserCtxtPtr ctxt, const CHAR *publicId, const CHAR *systemId)
{
fprintf(stdout, "SAX.resolveEntity(%s, %s)\n",
(char *)publicId, (char *)systemId);
fprintf(stdout, "SAX.resolveEntity(");
if (publicId != NULL)
fprintf(stdout, "%s", (char *)publicId);
else
fprintf(stdout, " ");
if (systemId != NULL)
fprintf(stdout, ", %s)\n", (char *)systemId);
else
fprintf(stdout, ", )\n");
if (systemId != NULL) {
return(xmlNewInputFromFile(ctxt, systemId));
}

View File

@ -197,10 +197,13 @@ int main(int argc, char **argv) {
}
}
if (files == 0) {
printf("\nFirst test for the parser, with errors\n");
parseAndPrintBuffer(buffer);
printf("\nBuilding a tree from scratch and printing it\n");
treeTest();
printf("Usage : %s [--debug] [--copy] [--recover] [--noent] XMLfiles ...\n",
argv[0]);
printf("\tParse the XML files and output the result of the parsing\n");
printf("\t--debug : dump a debug tree of the in-memory document\n");
printf("\t--copy : used to test the internal copy implementation\n");
printf("\t--recover : output what is parsable on broken XmL documents\n");
printf("\t--noent : substitute entity references by their value\n");
}
return(0);

33
tree.c
View File

@ -673,8 +673,15 @@ xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine) {
if (node->type == XML_TEXT_NODE) {
if (inLine)
ret = xmlStrcat(ret, node->content);
else
ret = xmlStrcat(ret, xmlEncodeEntities(doc, node->content));
else {
CHAR *buffer;
buffer = xmlEncodeEntitiesReentrant(doc, node->content);
if (buffer != NULL) {
ret = xmlStrcat(ret, buffer);
free(buffer);
}
}
} else if (node->type == XML_ENTITY_REF_NODE) {
if (inLine) {
ent = xmlGetDocEntity(doc, node->name);
@ -2566,8 +2573,15 @@ xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level) {
return;
}
if (cur->type == XML_TEXT_NODE) {
if (cur->content != NULL)
xmlBufferWriteCHAR(buf, xmlEncodeEntities(doc, cur->content));
if (cur->content != NULL) {
CHAR *buffer;
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
if (buffer != NULL) {
xmlBufferWriteCHAR(buf, buffer);
free(buffer);
}
}
return;
}
if (cur->type == XML_COMMENT_NODE) {
@ -2605,8 +2619,15 @@ xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level) {
return;
}
xmlBufferWriteChar(buf, ">");
if (cur->content != NULL)
xmlBufferWriteCHAR(buf, xmlEncodeEntities(doc, cur->content));
if (cur->content != NULL) {
CHAR *buffer;
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
if (buffer != NULL) {
xmlBufferWriteCHAR(buf, buffer);
free(buffer);
}
}
if (cur->childs != NULL) {
xmlNodeListDump(buf, doc, cur->childs, level + 1);
}

11
valid.c
View File

@ -78,8 +78,13 @@ xmlCopyElementContent(xmlElementContentPtr cur) {
if (cur == NULL) return(NULL);
ret = xmlNewElementContent((CHAR *) cur->name, cur->type);
if (cur->c1 != NULL) cur->c1 = xmlCopyElementContent(cur->c1);
if (cur->c2 != NULL) cur->c2 = xmlCopyElementContent(cur->c2);
if (ret == NULL) {
fprintf(stderr, "xmlCopyElementContent : out of memory\n");
return(NULL);
}
ret->ocur = cur->ocur;
if (cur->c1 != NULL) ret->c1 = xmlCopyElementContent(cur->c1);
if (cur->c2 != NULL) ret->c2 = xmlCopyElementContent(cur->c2);
return(ret);
}
@ -311,7 +316,7 @@ xmlAddElementDecl(xmlDtdPtr dtd, const CHAR *name, int type,
*/
ret->type = type;
ret->name = xmlStrdup(name);
ret->content = content;
ret->content = xmlCopyElementContent(content);
table->nb_elements++;
return(ret);

40
xmlIO.h Normal file
View File

@ -0,0 +1,40 @@
/*
* xmlIO.h : interface for the I/O interfaces used by the parser
*
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*/
#ifndef __XML_IO_H__
#define __XML_IO_H__
#include <stdio.h>
#include "tree.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct xmlParserInputBuffer {
/* Inputs */
FILE *file; /* Input on file handler */
int fd; /* Input on a file descriptor */
/**********
#ifdef HAVE_ZLIB_H
gzFile gzfile; Input on a compressed stream
#endif
*/
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
} xmlParserInputBuffer;
typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
#ifdef __cplusplus
}
#endif
#endif /* __XML_IO_H__ */