1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-28 00:21:53 +03:00

one really need to provide the base URI information when creating a reader

* doc/libxml2-api.xml python/tests/reader.py: one really need
  to provide the base URI information when creating a reader parser
  from an input stream. Updated the API and the example using it.
Daniel
This commit is contained in:
Daniel Veillard
2002-12-20 10:29:40 +00:00
parent ea7751d53b
commit 4258b9c8aa
3 changed files with 42 additions and 5 deletions

View File

@ -1,3 +1,9 @@
Fri Dec 20 11:27:49 CET 2002 Daniel Veillard <daniel@veillard.com>
* doc/libxml2-api.xml python/tests/reader.py: one really need
to provide the base URI information when creating a reader parser
from an input stream. Updated the API and the example using it.
Fri Dec 20 01:11:30 CET 2002 Daniel Veillard <daniel@veillard.com> Fri Dec 20 01:11:30 CET 2002 Daniel Veillard <daniel@veillard.com>
* testReader.c xmlreader.c valid.c include/libxml/tree.h * testReader.c xmlreader.c valid.c include/libxml/tree.h

View File

@ -909,6 +909,9 @@
<exports symbol='xmlValidateOneAttribute'/> <exports symbol='xmlValidateOneAttribute'/>
<exports symbol='xmlValidateOneElement'/> <exports symbol='xmlValidateOneElement'/>
<exports symbol='xmlValidateOneNamespace'/> <exports symbol='xmlValidateOneNamespace'/>
<exports symbol='xmlValidatePopElement'/>
<exports symbol='xmlValidatePushCData'/>
<exports symbol='xmlValidatePushElement'/>
<exports symbol='xmlValidateRoot'/> <exports symbol='xmlValidateRoot'/>
<exports symbol='xmlValidityErrorFunc'/> <exports symbol='xmlValidityErrorFunc'/>
<exports symbol='xmlValidityWarningFunc'/> <exports symbol='xmlValidityWarningFunc'/>
@ -2669,6 +2672,8 @@ actually an xmlCharEncoding'/>
<field name='next' type='struct _xmlID *' info=' next ID'/> <field name='next' type='struct _xmlID *' info=' next ID'/>
<field name='value' type='const xmlChar *' info=' The ID name'/> <field name='value' type='const xmlChar *' info=' The ID name'/>
<field name='attr' type='xmlAttrPtr' info=' The attribute holding it'/> <field name='attr' type='xmlAttrPtr' info=' The attribute holding it'/>
<field name='name' type='const xmlChar *' info=' The attribute if attr is not available'/>
<field name='lineno' type='int' info=' The line number if attr is not available'/>
</struct> </struct>
<typedef name='xmlIDPtr' file='tree' type='xmlID *'/> <typedef name='xmlIDPtr' file='tree' type='xmlID *'/>
<struct name='xmlIDTable' file='valid' type='struct _xmlHashTable'/> <struct name='xmlIDTable' file='valid' type='struct _xmlHashTable'/>
@ -2843,6 +2848,8 @@ actually an xmlCharEncoding'/>
<field name='next' type='struct _xmlRef *' info=' next Ref'/> <field name='next' type='struct _xmlRef *' info=' next Ref'/>
<field name='value' type='const xmlChar *' info=' The Ref name'/> <field name='value' type='const xmlChar *' info=' The Ref name'/>
<field name='attr' type='xmlAttrPtr' info=' The attribute holding it'/> <field name='attr' type='xmlAttrPtr' info=' The attribute holding it'/>
<field name='name' type='const xmlChar *' info=' The attribute if attr is not available'/>
<field name='lineno' type='int' info=' The line number if attr is not available'/>
</struct> </struct>
<typedef name='xmlRefPtr' file='tree' type='xmlRef *'/> <typedef name='xmlRefPtr' file='tree' type='xmlRef *'/>
<struct name='xmlRefTable' file='valid' type='struct _xmlHashTable'/> <struct name='xmlRefTable' file='valid' type='struct _xmlHashTable'/>
@ -6493,6 +6500,7 @@ actually an xmlCharEncoding'/>
<info>Create an xmlTextReader structure fed with @input</info> <info>Create an xmlTextReader structure fed with @input</info>
<return type='xmlTextReaderPtr' info='the new xmlTextReaderPtr or NULL in case of error'/> <return type='xmlTextReaderPtr' info='the new xmlTextReaderPtr or NULL in case of error'/>
<arg name='input' type='xmlParserInputBufferPtr' info='the xmlParserInputBufferPtr used to read data'/> <arg name='input' type='xmlParserInputBufferPtr' info='the xmlParserInputBufferPtr used to read data'/>
<arg name='URI' type='const char *' info='the URI information for the source if available'/>
</function> </function>
<function name='xmlNewTextReaderFilename' file='xmlreader'> <function name='xmlNewTextReaderFilename' file='xmlreader'>
<info>Create an xmlTextReader structure fed with the resource at @URI</info> <info>Create an xmlTextReader structure fed with the resource at @URI</info>
@ -7276,7 +7284,7 @@ actually an xmlCharEncoding'/>
<function name='xmlRegExecPushString' file='xmlregexp'> <function name='xmlRegExecPushString' file='xmlregexp'>
<info>Push one input token in the execution context</info> <info>Push one input token in the execution context</info>
<return type='int' info='1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error.'/> <return type='int' info='1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error.'/>
<arg name='exec' type='xmlRegExecCtxtPtr' info='a regexp execution context'/> <arg name='exec' type='xmlRegExecCtxtPtr' info='a regexp execution context or NULL to indicate the end'/>
<arg name='value' type='const xmlChar *' info='a string token input'/> <arg name='value' type='const xmlChar *' info='a string token input'/>
<arg name='data' type='void *' info='data associated to the token to reuse in callbacks'/> <arg name='data' type='void *' info='data associated to the token to reuse in callbacks'/>
</function> </function>
@ -8985,6 +8993,29 @@ actually an xmlCharEncoding'/>
<arg name='ns' type='xmlNsPtr' info='an namespace declaration instance'/> <arg name='ns' type='xmlNsPtr' info='an namespace declaration instance'/>
<arg name='value' type='const xmlChar *' info='the attribute value (without entities processing)'/> <arg name='value' type='const xmlChar *' info='the attribute value (without entities processing)'/>
</function> </function>
<function name='xmlValidatePopElement' file='valid'>
<info>Pop the element end from the validation stack.</info>
<return type='int' info='1 if no validation problem was found or 0 otherwise'/>
<arg name='ctxt' type='xmlValidCtxtPtr' info='the validation context'/>
<arg name='doc' type='xmlDocPtr' info='a document instance'/>
<arg name='elem' type='xmlNodePtr' info='an element instance'/>
<arg name='qname' type='const xmlChar *' info='the qualified name as appearing in the serialization'/>
</function>
<function name='xmlValidatePushCData' file='valid'>
<info>check the CData parsed for validation in the current stack</info>
<return type='int' info='1 if no validation problem was found or 0 otherwise'/>
<arg name='ctxt' type='xmlValidCtxtPtr' info='the validation context'/>
<arg name='data' type='const xmlChar *' info='some character data read'/>
<arg name='len' type='int' info='the lenght of the data'/>
</function>
<function name='xmlValidatePushElement' file='valid'>
<info>Push a new element start on the validation stack.</info>
<return type='int' info='1 if no validation problem was found or 0 otherwise'/>
<arg name='ctxt' type='xmlValidCtxtPtr' info='the validation context'/>
<arg name='doc' type='xmlDocPtr' info='a document instance'/>
<arg name='elem' type='xmlNodePtr' info='an element instance'/>
<arg name='qname' type='const xmlChar *' info='the qualified name as appearing in the serialization'/>
</function>
<function name='xmlValidateRoot' file='valid'> <function name='xmlValidateRoot' file='valid'>
<info>Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn&apos;t try to recurse or apply other check to the element</info> <info>Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn&apos;t try to recurse or apply other check to the element</info>
<return type='int' info='1 if valid or 0 otherwise'/> <return type='int' info='1 if valid or 0 otherwise'/>

View File

@ -8,7 +8,7 @@ libxml2.debugMemory(1)
f = StringIO.StringIO("""<a><b b1="b1"/><c>content of c</c></a>""") f = StringIO.StringIO("""<a><b b1="b1"/><c>content of c</c></a>""")
input = libxml2.inputBuffer(f) input = libxml2.inputBuffer(f)
reader = input.newTextReader() reader = input.newTextReader("test1")
ret = reader.read() ret = reader.read()
if ret != 1: if ret != 1:
print "Error reading to first element" print "Error reading to first element"
@ -68,7 +68,7 @@ if ret != 0:
# #
f = StringIO.StringIO("""<test xmlns:dt="urn:datatypes" dt:type="int"/>""") f = StringIO.StringIO("""<test xmlns:dt="urn:datatypes" dt:type="int"/>""")
input = libxml2.inputBuffer(f) input = libxml2.inputBuffer(f)
reader = input.newTextReader() reader = input.newTextReader("test2")
ret = reader.read() ret = reader.read()
if ret != 1: if ret != 1:
@ -90,7 +90,7 @@ f = StringIO.StringIO("""<root xmlns:a="urn:456">
</item> </item>
</root>""") </root>""")
input = libxml2.inputBuffer(f) input = libxml2.inputBuffer(f)
reader = input.newTextReader() reader = input.newTextReader("test3")
ret = reader.read() ret = reader.read()
while ret == 1: while ret == 1:
@ -109,7 +109,7 @@ if ret != 1:
# #
f = StringIO.StringIO("""<testattr xmlns="urn:1" xmlns:a="urn:2" b="b" a:b="a:b"/>""") f = StringIO.StringIO("""<testattr xmlns="urn:1" xmlns:a="urn:2" b="b" a:b="a:b"/>""")
input = libxml2.inputBuffer(f) input = libxml2.inputBuffer(f)
reader = input.newTextReader() reader = input.newTextReader("test4")
ret = reader.read() ret = reader.read()
if ret != 1: if ret != 1:
print "Error reading the testattr element" print "Error reading the testattr element"