Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 67df809

Browse files
author
Daniel Veillard
committed
Vyacheslav Pindyura managed to trigger a bug in parseStartTag, fixing it.
* parser.c: Vyacheslav Pindyura managed to trigger a bug in parseStartTag, fixing it. * test/att4 result/att4 result/noent/att4: adding the test * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: added more methods to XmlTextReader. Daniel
1 parent d453c63 commit 67df809

File tree

9 files changed

+27946
-7
lines changed

9 files changed

+27946
-7
lines changed

ChangeLog

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Mon Dec 16 23:00:05 CET 2002 Daniel Veillard <[email protected]>
2+
3+
* parser.c: Vyacheslav Pindyura managed to trigger a bug in
4+
parseStartTag, fixing it.
5+
* test/att4 result/att4 result/noent/att4: adding the test
6+
* xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml: added
7+
more methods to XmlTextReader.
8+
19
Mon Dec 16 19:31:16 CET 2002 Igor Zlatkovic <[email protected]>
210

311
* win32/libxml2.def.src: added more xml reader exports

doc/libxml2-api.xml

+30
Original file line numberDiff line numberDiff line change
@@ -1114,10 +1114,15 @@
11141114
<exports symbol='xmlTextReaderName'/>
11151115
<exports symbol='xmlTextReaderNamespaceUri'/>
11161116
<exports symbol='xmlTextReaderNodeType'/>
1117+
<exports symbol='xmlTextReaderNormalization'/>
11171118
<exports symbol='xmlTextReaderPrefix'/>
11181119
<exports symbol='xmlTextReaderPtr'/>
11191120
<exports symbol='xmlTextReaderQuoteChar'/>
11201121
<exports symbol='xmlTextReaderRead'/>
1122+
<exports symbol='xmlTextReaderReadInnerXml'/>
1123+
<exports symbol='xmlTextReaderReadOuterXml'/>
1124+
<exports symbol='xmlTextReaderReadState'/>
1125+
<exports symbol='xmlTextReaderReadString'/>
11211126
<exports symbol='xmlTextReaderValue'/>
11221127
<exports symbol='xmlTextReaderXmlLang'/>
11231128
</file>
@@ -8002,6 +8007,11 @@ actually an xmlCharEncoding'/>
80028007
<return type='int' info='the xmlNodeType of the current node or -1 in case of error'/>
80038008
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
80048009
</function>
8010+
<function name='xmlTextReaderNormalization' file='xmlreader'>
8011+
<info>The value indicating whether to normalize white space and attribute values. Since attribute value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken bahaviour of accepting out of range character entities like &amp;#0; is of course not supported either.</info>
8012+
<return type='int' info='1 or -1 in case of error.'/>
8013+
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
8014+
</function>
80058015
<function name='xmlTextReaderPrefix' file='xmlreader'>
80068016
<info>A shorthand reference to the namespace associated with the node.</info>
80078017
<return type='xmlChar *' info='the prefix or NULL if not available'/>
@@ -8017,6 +8027,26 @@ actually an xmlCharEncoding'/>
80178027
<return type='int' info='1 if the node was read successfully, 0 if there is no more nodes to read, or -1 in case of error'/>
80188028
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
80198029
</function>
8030+
<function name='xmlTextReaderReadInnerXml' file='xmlreader'>
8031+
<info>Reads the contents of the current node, including child nodes and markup.</info>
8032+
<return type='xmlChar *' info='a string containing the XML content, or NULL if the current node is neither an element nor attribute, or has no child nodes. The string must be deallocated by the caller.'/>
8033+
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
8034+
</function>
8035+
<function name='xmlTextReaderReadOuterXml' file='xmlreader'>
8036+
<info>Reads the contents of the current node, including child nodes and markup.</info>
8037+
<return type='xmlChar *' info='a string containing the XML content, or NULL if the current node is neither an element nor attribute, or has no child nodes. The string must be deallocated by the caller.'/>
8038+
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
8039+
</function>
8040+
<function name='xmlTextReaderReadState' file='xmlreader'>
8041+
<info>Gets the read state of the reader.</info>
8042+
<return type='int' info='the state value, or -1 in case of error'/>
8043+
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
8044+
</function>
8045+
<function name='xmlTextReaderReadString' file='xmlreader'>
8046+
<info>Reads the contents of an element or a text node as a string.</info>
8047+
<return type='xmlChar *' info='a string containing the contents of the Element or Text node, or NULL if the reader is positioned on any other type of node. The string must be deallocated by the caller.'/>
8048+
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
8049+
</function>
80208050
<function name='xmlTextReaderValue' file='xmlreader'>
80218051
<info>Provides the text value of the node if present</info>
80228052
<return type='xmlChar *' info='the string or NULL if not available. The retsult must be deallocated with xmlFree()'/>

include/libxml/xmlreader.h

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ void xmlFreeTextReader (xmlTextReaderPtr reader);
3030
* Iterators
3131
*/
3232
int xmlTextReaderRead (xmlTextReaderPtr reader);
33+
xmlChar * xmlTextReaderReadInnerXml (xmlTextReaderPtr reader);
34+
xmlChar * xmlTextReaderReadOuterXml (xmlTextReaderPtr reader);
35+
xmlChar * xmlTextReaderReadString (xmlTextReaderPtr reader);
3336

3437
/*
3538
* Attributes of the node
@@ -49,6 +52,7 @@ xmlChar * xmlTextReaderPrefix (xmlTextReaderPtr reader);
4952
int xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
5053
xmlChar * xmlTextReaderValue (xmlTextReaderPtr reader);
5154
xmlChar * xmlTextReaderXmlLang (xmlTextReaderPtr reader);
55+
int xmlTextReaderReadState (xmlTextReaderPtr reader);
5256

5357
/*
5458
* Methods of the XmlTextReader
@@ -74,6 +78,7 @@ int xmlTextReaderMoveToAttributeNs (xmlTextReaderPtr reader,
7478
int xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
7579
int xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
7680
int xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
81+
int xmlTextReaderNormalization (xmlTextReaderPtr reader);
7782

7883
#ifdef __cplusplus
7984
}

parser.c

+3
Original file line numberDiff line numberDiff line change
@@ -6688,6 +6688,9 @@ xmlParseStartTag(xmlParserCtxtPtr ctxt) {
66886688

66896689
failed:
66906690

6691+
if (CUR == 0) {
6692+
GROW
6693+
}
66916694
if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
66926695
break;
66936696
if (!IS_BLANK(RAW)) {

python/libxml2class.txt

+5
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,14 @@ Class xmlTextReader()
586586
name()
587587
namespaceUri()
588588
nodeType()
589+
normalization()
589590
prefix()
590591
quoteChar()
591592
read()
593+
readInnerXml()
594+
readOuterXml()
595+
readState()
596+
readString()
592597
value()
593598
xmlLang()
594599
Class xmlReg()

0 commit comments

Comments
 (0)