diff --git a/ChangeLog b/ChangeLog
index 173201f8..931d166d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Dec 11 20:26:15 CET 2002 Daniel Veillard
+
+ * configure.in: preparing release of 2.4.29
+ * doc/*: rebuilt the docs and API
+ * xmlreader.c: a few more fixes for the XmlTextReader API
+
Wed Dec 11 18:01:15 CET 2002 Igor Zlatkovic
* include/win32config.h: applied mingw patch from Magnus Henoch
diff --git a/configure.in b/configure.in
index d318f703..9652debe 100644
--- a/configure.in
+++ b/configure.in
@@ -6,7 +6,7 @@ AC_CANONICAL_HOST
LIBXML_MAJOR_VERSION=2
LIBXML_MINOR_VERSION=4
-LIBXML_MICRO_VERSION=28
+LIBXML_MICRO_VERSION=29
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
diff --git a/doc/FAQ.html b/doc/FAQ.html
index da93c88b..63ac2a2f 100644
--- a/doc/FAQ.html
+++ b/doc/FAQ.html
@@ -262,7 +262,7 @@ pnode=pxmlDoc->children->children;
but it does not work. If I change it to
pnode=pxmlDoc->children->children->next;
then it works. Can someone explain it to me.
-
+
In XML all characters in the content of the document are significant
including blanks and formatting line breaks.
The extra nodes you are wondering about are just that, text nodes with
@@ -365,7 +365,7 @@ xmlDtdPtr dtd = xmlParseDTD(NULL, filename_of_dtd); /* parse the DTD */
etc ...
-
+
Daniel Veillard
diff --git a/doc/architecture.html b/doc/architecture.html
index bced3b9b..462c6158 100644
--- a/doc/architecture.html
+++ b/doc/architecture.html
@@ -111,7 +111,7 @@ of the block interfaces are public. The main components are:
Graphically this gives the following:

-
+
Daniel Veillard
diff --git a/doc/catalog.html b/doc/catalog.html
index 2bac13ae..49098dfa 100644
--- a/doc/catalog.html
+++ b/doc/catalog.html
@@ -147,7 +147,7 @@ started.
Catalogs is far more flexible, more recent, uses an XML syntax and
should scale quite better. This is the default option of libxml.
-
+
In a normal environment libxml will by default check the presence of a
catalog in /etc/xml/catalog, and assuming it has been correctly populated,
@@ -386,7 +386,7 @@ provided because this functionality may be useful for client tools.
try to avoid troubles in multithreaded environments. The code is now thread
safe assuming that the libxml library has been compiled with threads
support.
-
+
The XML Catalog specification is relatively recent so there isn't much
literature to point at:
diff --git a/doc/contribs.html b/doc/contribs.html
index 0cb439d8..20b67214 100644
--- a/doc/contribs.html
+++ b/doc/contribs.html
@@ -134,7 +134,7 @@ A:link, A:visited, A:active { text-decoration: underline }
Digital Signature implementations for libxml2
-
+
Daniel Veillard
diff --git a/doc/index.html b/doc/index.html
index 7208ee39..2037c265 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -93,7 +93,7 @@ A:link, A:visited, A:active { text-decoration: underline }
-
+
Libxml is the XML C library developed for the Gnome project. XML itself
is a metalanguage to design markup languages, i.e. text language where
semantic and structure are added to the content using extra "markup"
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index 195e0cc3..13bfb2a9 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -4339,20 +4339,20 @@ actually an xmlCharEncoding'/>
Do a complete resolution lookup of an External Identifier
-
-
+
+
Try to lookup the system ID associated to a public ID in that catalog
-
+
Try to lookup the catalog resource for a system ID
-
+
Do a complete resolution lookup of an URI
@@ -4769,12 +4769,12 @@ actually an xmlCharEncoding'/>
Try to lookup the system ID associated to a public ID DEPRECATED, use xmlCatalogResolvePublic()
-
+
Try to lookup the system ID associated to a public ID DEPRECATED, use xmlCatalogResolveSystem()
-
+
Check is a catalog is empty
@@ -4785,8 +4785,8 @@ actually an xmlCharEncoding'/>
Do a complete resolution lookup of an External Identifier using a document's private catalog list
-
-
+
+
Do a complete resolution lookup of an URI using a document's private catalog list
@@ -4802,18 +4802,18 @@ actually an xmlCharEncoding'/>
Do a complete resolution lookup of an External Identifier
-
-
+
+
Try to lookup the system ID associated to a public ID
-
+
Try to lookup the catalog resource for a system ID
-
+
Do a complete resolution lookup of an URI
@@ -6274,7 +6274,7 @@ actually an xmlCharEncoding'/>
Load the catalogs and makes their definitions effective for the default external entity loader. this function is not thread safe, catalog initialization should preferably be done once at startup
-
+
Load an external entity, note that the use of this function for unparsed entities may generate problems TODO: a more generic External entity API must be designed
@@ -8452,9 +8452,9 @@ actually an xmlCharEncoding'/>
-
-
-
+ Whether an Attribute node was generated from the default value defined in the DTD or schema.
+
+
Check if the current node is empty
@@ -8487,9 +8487,9 @@ actually an xmlCharEncoding'/>
-
-
-
+ The quotation mark character used to enclose the value of an attribute.
+
+
Moves the position of the current instance to the next node in the stream, exposing its properties.
@@ -8497,9 +8497,9 @@ actually an xmlCharEncoding'/>
-
-
-
+ Provides the text value of the node if present
+
+
The xml:lang scope within which the node resides.
diff --git a/doc/news.html b/doc/news.html
index 812f377d..44976a2a 100644
--- a/doc/news.html
+++ b/doc/news.html
@@ -102,6 +102,20 @@ to test those
Schemas and XInclude
+2.4.29: Dec 11 2002
+
+- Windows fixes (Igor): Windows CE port, pthread linking, python bindings
+ (Stéphane Bidoul), Mingw (Magnus Henoch), and export list updates
+ - Fix for prev in python bindings (ERDI Gergo)
+ - Fix for entities handling (Marcus Clarke)
+ - Refactored the XML and HTML dumps to a single code path, fixed XHTML1
+ dump
+ - Fix for URI parsing when handling URNs with fragment identifiers
+ - Fix for HTTP URL escaping problem
+ - added an TextXmlReader (C#) like API (work in progress)
+ - Rewrote the API in XML generation script, includes a C parser and saves
+ more informations needed for C# bindings
+
2.4.28: Nov 22 2002
- a couple of python binding fixes
@@ -110,7 +124,7 @@ to test those
- fix to the configure script for Unix (Dimitri Papadopoulos)
- added encoding support for XInclude parse="text"
- autodetection of XHTML1 and specific serialization rules added
- - nasty threading bug fixed (William Brack)
+ - nasty threading bug fixed (William Brack)
2.4.27: Nov 17 2002
diff --git a/doc/xml.html b/doc/xml.html
index bd9e672b..c088ca32 100644
--- a/doc/xml.html
+++ b/doc/xml.html
@@ -589,6 +589,21 @@ to test those
Schemas and XInclude
+2.4.29: Dec 11 2002
+
+ - Windows fixes (Igor): Windows CE port, pthread linking, python bindings
+ (Stéphane Bidoul), Mingw (Magnus Henoch), and export list updates
+ - Fix for prev in python bindings (ERDI Gergo)
+ - Fix for entities handling (Marcus Clarke)
+ - Refactored the XML and HTML dumps to a single code path, fixed XHTML1
+ dump
+ - Fix for URI parsing when handling URNs with fragment identifiers
+ - Fix for HTTP URL escaping problem
+ - added an TextXmlReader (C#) like API (work in progress)
+ - Rewrote the API in XML generation script, includes a C parser and saves
+ more informations needed for C# bindings
+
+
2.4.28: Nov 22 2002
- a couple of python binding fixes
@@ -597,7 +612,7 @@ to test those
- fix to the configure script for Unix (Dimitri Papadopoulos)
- added encoding support for XInclude parse="text"
- autodetection of XHTML1 and specific serialization rules added
- - nasty threading bug fixed (William Brack)
+ - nasty threading bug fixed (William Brack)
2.4.27: Nov 17 2002
@@ -2735,6 +2750,7 @@ xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) {
+
}
diff --git a/doc/xmldtd.html b/doc/xmldtd.html
index 362b6371..84a11c66 100644
--- a/doc/xmldtd.html
+++ b/doc/xmldtd.html
@@ -247,7 +247,7 @@ will just list one for now, others pointers welcome:
I suggest looking at the examples found under test/valid/dtd and any of
the large number of books available on XML. The dia example in test/valid
should be both simple and complete enough to allow you to build your own.
-
+
Daniel Veillard
|
|
|
|
diff --git a/doc/xmlio.html b/doc/xmlio.html
index f0523d3e..3a2bb835 100644
--- a/doc/xmlio.html
+++ b/doc/xmlio.html
@@ -250,6 +250,7 @@ xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) {
+
}
diff --git a/doc/xmlmem.html b/doc/xmlmem.html
index 5867c656..7fb6ce8f 100644
--- a/doc/xmlmem.html
+++ b/doc/xmlmem.html
@@ -216,7 +216,7 @@ of a number of things:
validation, DOM, XPath or XPointer, but really need to work fixed memory
requirements, then the SAX interface should be used.
-
+
Daniel Veillard
diff --git a/xmlreader.c b/xmlreader.c
index 9768492b..65ca8e8a 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -604,7 +604,7 @@ xmlTextReaderLocalName(xmlTextReaderPtr reader) {
return(NULL);
if ((reader->node->type != XML_ELEMENT_NODE) &&
(reader->node->type != XML_ATTRIBUTE_NODE))
- return(NULL);
+ return(xmlTextReaderName(reader));
return(xmlStrdup(reader->node->name));
}
@@ -622,16 +622,51 @@ xmlTextReaderName(xmlTextReaderPtr reader) {
if ((reader == NULL) || (reader->node == NULL))
return(NULL);
- if ((reader->node->type != XML_ELEMENT_NODE) &&
- (reader->node->type != XML_ATTRIBUTE_NODE))
- return(NULL);
- if ((reader->node->ns == NULL) || (reader->node->ns->prefix == NULL))
- return(xmlStrdup(reader->node->name));
-
- ret = xmlStrdup(reader->node->ns->prefix);
- ret = xmlStrcat(ret, BAD_CAST ":");
- ret = xmlStrcat(ret, reader->node->name);
- return(ret);
+ switch (reader->node->type) {
+ case XML_ELEMENT_NODE:
+ case XML_ATTRIBUTE_NODE:
+ if ((reader->node->ns == NULL) ||
+ (reader->node->ns->prefix == NULL))
+ return(xmlStrdup(reader->node->name));
+
+ ret = xmlStrdup(reader->node->ns->prefix);
+ ret = xmlStrcat(ret, BAD_CAST ":");
+ ret = xmlStrcat(ret, reader->node->name);
+ return(ret);
+ case XML_TEXT_NODE:
+ return(xmlStrdup(BAD_CAST "#text"));
+ case XML_CDATA_SECTION_NODE:
+ return(xmlStrdup(BAD_CAST "#cdata-section"));
+ case XML_ENTITY_NODE:
+ case XML_ENTITY_REF_NODE:
+ return(xmlStrdup(reader->node->name));
+ case XML_PI_NODE:
+ return(xmlStrdup(reader->node->name));
+ case XML_COMMENT_NODE:
+ return(xmlStrdup(BAD_CAST "#comment"));
+ case XML_DOCUMENT_NODE:
+ case XML_HTML_DOCUMENT_NODE:
+#ifdef LIBXML_DOCB_ENABLED
+ case XML_DOCB_DOCUMENT_NODE:
+#endif
+ return(xmlStrdup(BAD_CAST "#document"));
+ case XML_DOCUMENT_FRAG_NODE:
+ return(xmlStrdup(BAD_CAST "#document-fragment"));
+ case XML_NOTATION_NODE:
+ return(xmlStrdup(reader->node->name));
+ case XML_DOCUMENT_TYPE_NODE:
+ case XML_DTD_NODE:
+ return(xmlStrdup(reader->node->name));
+
+ case XML_ELEMENT_DECL:
+ case XML_ATTRIBUTE_DECL:
+ case XML_ENTITY_DECL:
+ case XML_NAMESPACE_DECL:
+ case XML_XINCLUDE_START:
+ case XML_XINCLUDE_END:
+ return(NULL);
+ }
+ return(NULL);
}
/**
@@ -744,15 +779,89 @@ xmlTextReaderHasValue(xmlTextReaderPtr reader) {
if (reader->node == NULL)
return(0);
- TODO
+ switch (reader->node->type) {
+ case XML_ATTRIBUTE_NODE:
+ case XML_TEXT_NODE:
+ case XML_CDATA_SECTION_NODE:
+ case XML_PI_NODE:
+ case XML_COMMENT_NODE:
+ return(1);
+ default:
+ return(0);
+ }
return(0);
}
-/*
-int xmlTextReaderIsDefault (xmlTextReaderPtr reader);
-int xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
-xmlChar * xmlTextReaderValue (xmlTextReaderPtr reader);
+/**
+ * xmlTextReaderValue:
+ * @reader: the xmlTextReaderPtr used
+ *
+ * Provides the text value of the node if present
+ *
+ * Returns the string or NULL if not available. The retsult must be deallocated
+ * with xmlFree()
*/
+xmlChar *
+xmlTextReaderValue(xmlTextReaderPtr reader) {
+ if (reader == NULL)
+ return(NULL);
+ if (reader->node == NULL)
+ return(NULL);
+
+ switch (reader->node->type) {
+ case XML_ATTRIBUTE_NODE:{
+ xmlAttrPtr attr = (xmlAttrPtr) reader->node;
+
+ if (attr->parent != NULL)
+ return (xmlNodeListGetString
+ (attr->parent->doc, attr->children, 1));
+ else
+ return (xmlNodeListGetString(NULL, attr->children, 1));
+ break;
+ }
+ case XML_TEXT_NODE:
+ case XML_CDATA_SECTION_NODE:
+ case XML_PI_NODE:
+ case XML_COMMENT_NODE:
+ if (reader->node->content != NULL)
+ return (xmlStrdup(reader->node->content));
+ default:
+ return(NULL);
+ }
+ return(NULL);
+}
+
+/**
+ * xmlTextReaderIsDefault:
+ * @reader: the xmlTextReaderPtr used
+ *
+ * Whether an Attribute node was generated from the default value
+ * defined in the DTD or schema.
+ *
+ * Returns 0 if not defaulted, 1 if defaulted, and -1 in case of error
+ */
+int
+xmlTextReaderIsDefault(xmlTextReaderPtr reader) {
+ if (reader == NULL)
+ return(-1);
+ return(0);
+}
+
+/**
+ * xmlTextReaderQuoteChar:
+ * @reader: the xmlTextReaderPtr used
+ *
+ * The quotation mark character used to enclose the value of an attribute.
+ *
+ * Returns " or ' and -1 in case of error
+ */
+int
+xmlTextReaderQuoteChar(xmlTextReaderPtr reader) {
+ if (reader == NULL)
+ return(-1);
+ /* TODO maybe lookup the attribute value for " first */
+ return((int) '"');
+}
/**
* xmlTextReaderXmlLang: