@@ -95,7 +95,9 @@ enum XML_Error {
95
95
/* Added in 2.0. */
96
96
XML_ERROR_RESERVED_PREFIX_XML,
97
97
XML_ERROR_RESERVED_PREFIX_XMLNS,
98
- XML_ERROR_RESERVED_NAMESPACE_URI
98
+ XML_ERROR_RESERVED_NAMESPACE_URI,
99
+ /* Added in 2.2.1. */
100
+ XML_ERROR_INVALID_ARGUMENT
99
101
};
100
102
101
103
enum XML_Content_Type {
@@ -706,6 +708,7 @@ XML_UseParserAsHandlerArg(XML_Parser parser);
706
708
be called, despite an external subset being parsed.
707
709
Note: If XML_DTD is not defined when Expat is compiled, returns
708
710
XML_ERROR_FEATURE_REQUIRES_XML_DTD.
711
+ Note: If parser == NULL, returns XML_ERROR_INVALID_ARGUMENT.
709
712
*/
710
713
XMLPARSEAPI (enum XML_Error)
711
714
XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
@@ -729,15 +732,16 @@ XML_GetBase(XML_Parser parser);
729
732
to the XML_StartElementHandler that were specified in the start-tag
730
733
rather than defaulted. Each attribute/value pair counts as 2; thus
731
734
this correspondds to an index into the atts array passed to the
732
- XML_StartElementHandler.
735
+ XML_StartElementHandler. Returns -1 if parser == NULL.
733
736
*/
734
737
XMLPARSEAPI (int )
735
738
XML_GetSpecifiedAttributeCount(XML_Parser parser);
736
739
737
740
/* Returns the index of the ID attribute passed in the last call to
738
- XML_StartElementHandler, or -1 if there is no ID attribute. Each
739
- attribute/value pair counts as 2; thus this correspondds to an
740
- index into the atts array passed to the XML_StartElementHandler.
741
+ XML_StartElementHandler, or -1 if there is no ID attribute or
742
+ parser == NULL. Each attribute/value pair counts as 2; thus this
743
+ correspondds to an index into the atts array passed to the
744
+ XML_StartElementHandler.
741
745
*/
742
746
XMLPARSEAPI (int )
743
747
XML_GetIdAttributeIndex(XML_Parser parser);
@@ -901,6 +905,7 @@ enum XML_ParamEntityParsing {
901
905
entities is requested; otherwise it will return non-zero.
902
906
Note: If XML_SetParamEntityParsing is called after XML_Parse or
903
907
XML_ParseBuffer, then it has no effect and will always return 0.
908
+ Note: If parser == NULL, the function will do nothing and return 0.
904
909
*/
905
910
XMLPARSEAPI (int )
906
911
XML_SetParamEntityParsing(XML_Parser parser,
@@ -910,6 +915,7 @@ XML_SetParamEntityParsing(XML_Parser parser,
910
915
Helps in preventing DoS attacks based on predicting hash
911
916
function behavior. This must be called before parsing is started.
912
917
Returns 1 if successful, 0 when called after parsing has started.
918
+ Note: If parser == NULL, the function will do nothing and return 0.
913
919
*/
914
920
XMLPARSEAPI (int )
915
921
XML_SetHashSalt(XML_Parser parser,
@@ -936,6 +942,10 @@ XML_GetErrorCode(XML_Parser parser);
936
942
the location is the location of the character at which the error
937
943
was detected; otherwise the location is the location of the last
938
944
parse event, as described above.
945
+
946
+ Note: XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber
947
+ return 0 to indicate an error.
948
+ Note: XML_GetCurrentByteIndex returns -1 to indicate an error.
939
949
*/
940
950
XMLPARSEAPI (XML_Size) XML_GetCurrentLineNumber(XML_Parser parser);
941
951
XMLPARSEAPI (XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser);
@@ -1039,7 +1049,7 @@ XML_GetFeatureList(void);
1039
1049
*/
1040
1050
#define XML_MAJOR_VERSION 2
1041
1051
#define XML_MINOR_VERSION 2
1042
- #define XML_MICRO_VERSION 0
1052
+ #define XML_MICRO_VERSION 1
1043
1053
1044
1054
#ifdef __cplusplus
1045
1055
}
0 commit comments