mirror of
https://github.com/GNOME/libxml2.git
synced 2025-03-13 18:47:01 +08:00
preparing release of 2.4.29 rebuilt the docs and API a few more fixes for
* configure.in: preparing release of 2.4.29 * doc/*: rebuilt the docs and API * xmlreader.c: a few more fixes for the XmlTextReader API Daniel
This commit is contained in:
parent
f6273a0a4a
commit
9b4bb4d07a
@ -1,3 +1,9 @@
|
||||
Wed Dec 11 20:26:15 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* 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 <igor@stud.fh-frankfurt.de>
|
||||
|
||||
* include/win32config.h: applied mingw patch from Magnus Henoch
|
||||
|
@ -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
|
||||
|
||||
|
@ -262,7 +262,7 @@ pnode=pxmlDoc->children->children;</pre>
|
||||
<p><em>but it does not work. If I change it to</em></p>
|
||||
<pre>pnode=pxmlDoc->children->children->next;</pre>
|
||||
<p><em>then it works. Can someone explain it to me.</em></p>
|
||||
<p>
|
||||
<p></p>
|
||||
<p>In XML all characters in the content of the document are significant
|
||||
<strong>including blanks and formatting line breaks</strong>.</p>
|
||||
<p>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 */
|
||||
</li>
|
||||
<li>etc ...</li>
|
||||
</ol>
|
||||
<p>
|
||||
<p></p>
|
||||
<p><a href="bugs.html">Daniel Veillard</a></p>
|
||||
</td></tr></table></td></tr></table></td></tr></table></td>
|
||||
</tr></table></td></tr></table>
|
||||
|
@ -111,7 +111,7 @@ of the block interfaces are public. The main components are:</p>
|
||||
</ul>
|
||||
<p>Graphically this gives the following:</p>
|
||||
<p><img src="libxml.gif" alt="a graphical view of the various"></p>
|
||||
<p>
|
||||
<p></p>
|
||||
<p><a href="bugs.html">Daniel Veillard</a></p>
|
||||
</td></tr></table></td></tr></table></td></tr></table></td>
|
||||
</tr></table></td></tr></table>
|
||||
|
@ -147,7 +147,7 @@ started.</p>
|
||||
Catalogs</a> is far more flexible, more recent, uses an XML syntax and
|
||||
should scale quite better. This is the default option of libxml.</li>
|
||||
</ul>
|
||||
<p>
|
||||
<p></p>
|
||||
<h3><a name="Simple">Using catalog</a></h3>
|
||||
<p>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.</p>
|
||||
try to avoid troubles in multithreaded environments. The code is now thread
|
||||
safe assuming that the libxml library has been compiled with threads
|
||||
support.</p>
|
||||
<p>
|
||||
<p></p>
|
||||
<h3><a name="Other">Other resources</a></h3>
|
||||
<p>The XML Catalog specification is relatively recent so there isn't much
|
||||
literature to point at:</p>
|
||||
|
@ -134,7 +134,7 @@ A:link, A:visited, A:active { text-decoration: underline }
|
||||
Digital Signature</a> <a href="http://www.aleksey.com/xmlsec/">implementations for libxml2</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
<p></p>
|
||||
<p><a href="bugs.html">Daniel Veillard</a></p>
|
||||
</td></tr></table></td></tr></table></td></tr></table></td>
|
||||
</tr></table></td></tr></table>
|
||||
|
@ -93,7 +93,7 @@ A:link, A:visited, A:active { text-decoration: underline }
|
||||
</table>
|
||||
</td></tr></table></td>
|
||||
<td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd">
|
||||
<p>
|
||||
<p></p>
|
||||
<p>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"
|
||||
|
@ -4339,20 +4339,20 @@ actually an xmlCharEncoding'/>
|
||||
<info>Do a complete resolution lookup of an External Identifier</info>
|
||||
<return type='xmlChar *' info='the URI of the resource or NULL if not found, it must be freed by the caller.'/>
|
||||
<arg name='catal' type='xmlCatalogPtr' info='a Catalog'/>
|
||||
<arg name='pubID' type='const xmlChar *' info=''/>
|
||||
<arg name='sysID' type='const xmlChar *' info=''/>
|
||||
<arg name='pubID' type='const xmlChar *' info='the public ID string'/>
|
||||
<arg name='sysID' type='const xmlChar *' info='the system ID string'/>
|
||||
</function>
|
||||
<function name='xmlACatalogResolvePublic' file='catalog'>
|
||||
<info>Try to lookup the system ID associated to a public ID in that catalog</info>
|
||||
<return type='xmlChar *' info='the system ID if found or NULL otherwise, the value returned must be freed by the caller.'/>
|
||||
<arg name='catal' type='xmlCatalogPtr' info='a Catalog'/>
|
||||
<arg name='pubID' type='const xmlChar *' info=''/>
|
||||
<arg name='pubID' type='const xmlChar *' info='the public ID string'/>
|
||||
</function>
|
||||
<function name='xmlACatalogResolveSystem' file='catalog'>
|
||||
<info>Try to lookup the catalog resource for a system ID</info>
|
||||
<return type='xmlChar *' info='the system ID if found or NULL otherwise, the value returned must be freed by the caller.'/>
|
||||
<arg name='catal' type='xmlCatalogPtr' info='a Catalog'/>
|
||||
<arg name='sysID' type='const xmlChar *' info=''/>
|
||||
<arg name='sysID' type='const xmlChar *' info='the public ID string'/>
|
||||
</function>
|
||||
<function name='xmlACatalogResolveURI' file='catalog'>
|
||||
<info>Do a complete resolution lookup of an URI</info>
|
||||
@ -4769,12 +4769,12 @@ actually an xmlCharEncoding'/>
|
||||
<function name='xmlCatalogGetPublic' file='catalog'>
|
||||
<info>Try to lookup the system ID associated to a public ID DEPRECATED, use xmlCatalogResolvePublic()</info>
|
||||
<return type='const xmlChar *' info='the system ID if found or NULL otherwise.'/>
|
||||
<arg name='pubID' type='const xmlChar *' info=''/>
|
||||
<arg name='pubID' type='const xmlChar *' info='the public ID string'/>
|
||||
</function>
|
||||
<function name='xmlCatalogGetSystem' file='catalog'>
|
||||
<info>Try to lookup the system ID associated to a public ID DEPRECATED, use xmlCatalogResolveSystem()</info>
|
||||
<return type='const xmlChar *' info='the system ID if found or NULL otherwise.'/>
|
||||
<arg name='sysID' type='const xmlChar *' info=''/>
|
||||
<arg name='sysID' type='const xmlChar *' info='the system ID string'/>
|
||||
</function>
|
||||
<function name='xmlCatalogIsEmpty' file='catalog'>
|
||||
<info>Check is a catalog is empty</info>
|
||||
@ -4785,8 +4785,8 @@ actually an xmlCharEncoding'/>
|
||||
<info>Do a complete resolution lookup of an External Identifier using a document's private catalog list</info>
|
||||
<return type='xmlChar *' info='the URI of the resource or NULL if not found, it must be freed by the caller.'/>
|
||||
<arg name='catalogs' type='void *' info='a document's list of catalogs'/>
|
||||
<arg name='pubID' type='const xmlChar *' info=''/>
|
||||
<arg name='sysID' type='const xmlChar *' info=''/>
|
||||
<arg name='pubID' type='const xmlChar *' info='the public ID string'/>
|
||||
<arg name='sysID' type='const xmlChar *' info='the system ID string'/>
|
||||
</function>
|
||||
<function name='xmlCatalogLocalResolveURI' file='catalog'>
|
||||
<info>Do a complete resolution lookup of an URI using a document's private catalog list</info>
|
||||
@ -4802,18 +4802,18 @@ actually an xmlCharEncoding'/>
|
||||
<function name='xmlCatalogResolve' file='catalog'>
|
||||
<info>Do a complete resolution lookup of an External Identifier</info>
|
||||
<return type='xmlChar *' info='the URI of the resource or NULL if not found, it must be freed by the caller.'/>
|
||||
<arg name='pubID' type='const xmlChar *' info=''/>
|
||||
<arg name='sysID' type='const xmlChar *' info=''/>
|
||||
<arg name='pubID' type='const xmlChar *' info='the public ID string'/>
|
||||
<arg name='sysID' type='const xmlChar *' info='the system ID string'/>
|
||||
</function>
|
||||
<function name='xmlCatalogResolvePublic' file='catalog'>
|
||||
<info>Try to lookup the system ID associated to a public ID</info>
|
||||
<return type='xmlChar *' info='the system ID if found or NULL otherwise, the value returned must be freed by the caller.'/>
|
||||
<arg name='pubID' type='const xmlChar *' info=''/>
|
||||
<arg name='pubID' type='const xmlChar *' info='the public ID string'/>
|
||||
</function>
|
||||
<function name='xmlCatalogResolveSystem' file='catalog'>
|
||||
<info>Try to lookup the catalog resource for a system ID</info>
|
||||
<return type='xmlChar *' info='the system ID if found or NULL otherwise, the value returned must be freed by the caller.'/>
|
||||
<arg name='sysID' type='const xmlChar *' info=''/>
|
||||
<arg name='sysID' type='const xmlChar *' info='the public ID string'/>
|
||||
</function>
|
||||
<function name='xmlCatalogResolveURI' file='catalog'>
|
||||
<info>Do a complete resolution lookup of an URI</info>
|
||||
@ -6274,7 +6274,7 @@ actually an xmlCharEncoding'/>
|
||||
<function name='xmlLoadCatalogs' file='catalog'>
|
||||
<info>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</info>
|
||||
<return type='void'/>
|
||||
<arg name='pathss' type='const char *' info=''/>
|
||||
<arg name='pathss' type='const char *' info='a list of directories separated by a colon or a space.'/>
|
||||
</function>
|
||||
<function name='xmlLoadExternalEntity' file='parser'>
|
||||
<info>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</info>
|
||||
@ -8452,9 +8452,9 @@ actually an xmlCharEncoding'/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||
</function>
|
||||
<function name='xmlTextReaderIsDefault' file='xmlreader'>
|
||||
<info></info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info=''/>
|
||||
<info>Whether an Attribute node was generated from the default value defined in the DTD or schema.</info>
|
||||
<return type='int' info='0 if not defaulted, 1 if defaulted, and -1 in case of error'/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||
</function>
|
||||
<function name='xmlTextReaderIsEmptyElement' file='xmlreader'>
|
||||
<info>Check if the current node is empty</info>
|
||||
@ -8487,9 +8487,9 @@ actually an xmlCharEncoding'/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||
</function>
|
||||
<function name='xmlTextReaderQuoteChar' file='xmlreader'>
|
||||
<info></info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info=''/>
|
||||
<info>The quotation mark character used to enclose the value of an attribute.</info>
|
||||
<return type='int' info='" or ' and -1 in case of error'/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||
</function>
|
||||
<function name='xmlTextReaderRead' file='xmlreader'>
|
||||
<info>Moves the position of the current instance to the next node in the stream, exposing its properties.</info>
|
||||
@ -8497,9 +8497,9 @@ actually an xmlCharEncoding'/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||
</function>
|
||||
<function name='xmlTextReaderValue' file='xmlreader'>
|
||||
<info></info>
|
||||
<return type='xmlChar *' info=''/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info=''/>
|
||||
<info>Provides the text value of the node if present</info>
|
||||
<return type='xmlChar *' info='the string or NULL if not available. The retsult must be deallocated with xmlFree()'/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||
</function>
|
||||
<function name='xmlTextReaderXmlLang' file='xmlreader'>
|
||||
<info>The xml:lang scope within which the node resides.</info>
|
||||
|
@ -102,6 +102,20 @@ to test those</p>
|
||||
Schemas</a> and <a href="http://www.w3.org/TR/xinclude">XInclude</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>2.4.29: Dec 11 2002</h3>
|
||||
<ul>
|
||||
<li>Windows fixes (Igor): Windows CE port, pthread linking, python bindings
|
||||
(Stéphane Bidoul), Mingw (Magnus Henoch), and export list updates</li>
|
||||
<li>Fix for prev in python bindings (ERDI Gergo)</li>
|
||||
<li>Fix for entities handling (Marcus Clarke)</li>
|
||||
<li>Refactored the XML and HTML dumps to a single code path, fixed XHTML1
|
||||
dump</li>
|
||||
<li>Fix for URI parsing when handling URNs with fragment identifiers</li>
|
||||
<li>Fix for HTTP URL escaping problem</li>
|
||||
<li>added an TextXmlReader (C#) like API (work in progress)</li>
|
||||
<li>Rewrote the API in XML generation script, includes a C parser and saves
|
||||
more informations needed for C# bindings</li>
|
||||
</ul>
|
||||
<h3>2.4.28: Nov 22 2002</h3>
|
||||
<ul>
|
||||
<li>a couple of python binding fixes</li>
|
||||
@ -110,7 +124,7 @@ to test those</p>
|
||||
<li>fix to the configure script for Unix (Dimitri Papadopoulos)</li>
|
||||
<li>added encoding support for XInclude parse="text"</li>
|
||||
<li>autodetection of XHTML1 and specific serialization rules added</li>
|
||||
<li>nasty threading bug fixed (William Brack) </li>
|
||||
<li>nasty threading bug fixed (William Brack)</li>
|
||||
</ul>
|
||||
<h3>2.4.27: Nov 17 2002</h3>
|
||||
<ul>
|
||||
|
18
doc/xml.html
18
doc/xml.html
@ -589,6 +589,21 @@ to test those</p>
|
||||
Schemas</a> and <a href="http://www.w3.org/TR/xinclude">XInclude</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>2.4.29: Dec 11 2002</h3>
|
||||
<ul>
|
||||
<li>Windows fixes (Igor): Windows CE port, pthread linking, python bindings
|
||||
(Stéphane Bidoul), Mingw (Magnus Henoch), and export list updates</li>
|
||||
<li>Fix for prev in python bindings (ERDI Gergo)</li>
|
||||
<li>Fix for entities handling (Marcus Clarke)</li>
|
||||
<li>Refactored the XML and HTML dumps to a single code path, fixed XHTML1
|
||||
dump</li>
|
||||
<li>Fix for URI parsing when handling URNs with fragment identifiers</li>
|
||||
<li>Fix for HTTP URL escaping problem</li>
|
||||
<li>added an TextXmlReader (C#) like API (work in progress)</li>
|
||||
<li>Rewrote the API in XML generation script, includes a C parser and saves
|
||||
more informations needed for C# bindings</li>
|
||||
</ul>
|
||||
|
||||
<h3>2.4.28: Nov 22 2002</h3>
|
||||
<ul>
|
||||
<li>a couple of python binding fixes</li>
|
||||
@ -597,7 +612,7 @@ to test those</p>
|
||||
<li>fix to the configure script for Unix (Dimitri Papadopoulos)</li>
|
||||
<li>added encoding support for XInclude parse="text"</li>
|
||||
<li>autodetection of XHTML1 and specific serialization rules added</li>
|
||||
<li>nasty threading bug fixed (William Brack) </li>
|
||||
<li>nasty threading bug fixed (William Brack)</li>
|
||||
</ul>
|
||||
|
||||
<h3>2.4.27: Nov 17 2002</h3>
|
||||
@ -2735,6 +2750,7 @@ xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} </pre>
|
||||
|
@ -247,7 +247,7 @@ will just list one for now, others pointers welcome:</p>
|
||||
<p>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.</p>
|
||||
<p>
|
||||
<p></p>
|
||||
<p><a href="bugs.html">Daniel Veillard</a></p>
|
||||
</td></tr></table></td></tr></table></td></tr></table></td>
|
||||
</tr></table></td></tr></table>
|
||||
|
@ -250,6 +250,7 @@ xmlOutputBufferCreateOwn(FILE *file, xmlCharEncodingHandlerPtr encoder) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} </pre>
|
||||
|
@ -216,7 +216,7 @@ of a number of things:</p>
|
||||
validation, DOM, XPath or XPointer, but really need to work fixed memory
|
||||
requirements, then the SAX interface should be used.</li>
|
||||
</ul>
|
||||
<p>
|
||||
<p></p>
|
||||
<p><a href="bugs.html">Daniel Veillard</a></p>
|
||||
</td></tr></table></td></tr></table></td></tr></table></td>
|
||||
</tr></table></td></tr></table>
|
||||
|
141
xmlreader.c
141
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user