mirror of
https://github.com/GNOME/libxml2.git
synced 2025-03-13 18:47:01 +08:00
adding a new set of API for parsing xmlReadDoc() xmlReadFile() ...
* parser.c include/libxml/parser.h: adding a new set of API for parsing xmlReadDoc() xmlReadFile() ... xmlReadIO() and xmlCtxtReadDoc() ... xmlCtxtReadIO(). That with a clear define of xmlParserOption, xmlCtxtUseOptions() should simplify custom parsing without being tempted to use global variables, and xmlCtxtReset() should allow reuse of a context for multiple parsing. * xmllint.c: switched to use xmlReadXXX, allow options to be used simultaneously with less troubles. * tree.c: simple warning removal * doc/apibuild.py: small fix * doc/libxml2-api.xml win32/libxml2.def.src: updated Daniel
This commit is contained in:
parent
1f40d68043
commit
16fa96c5d0
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
||||
Tue Sep 23 23:07:45 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* parser.c include/libxml/parser.h: adding a new set of
|
||||
API for parsing xmlReadDoc() xmlReadFile() ... xmlReadIO()
|
||||
and xmlCtxtReadDoc() ... xmlCtxtReadIO(). That with
|
||||
a clear define of xmlParserOption, xmlCtxtUseOptions()
|
||||
should simplify custom parsing without being tempted to
|
||||
use global variables, and xmlCtxtReset() should allow reuse
|
||||
of a context for multiple parsing.
|
||||
* xmllint.c: switched to use xmlReadXXX, allow options to
|
||||
be used simultaneously with less troubles.
|
||||
* tree.c: simple warning removal
|
||||
* doc/apibuild.py: small fix
|
||||
* doc/libxml2-api.xml win32/libxml2.def.src: updated
|
||||
|
||||
Tue Sep 23 11:15:23 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* parser.c: revert xmlCreateDocParserCtxt() since this break
|
||||
|
@ -1325,7 +1325,11 @@ class docBuilder:
|
||||
if id.info != None:
|
||||
info = id.info
|
||||
if info[0] != None and info[0] != '':
|
||||
output.write(" value='%s'" % info[0]);
|
||||
try:
|
||||
val = eval(info[0])
|
||||
except:
|
||||
val = info[0]
|
||||
output.write(" value='%s'" % (val));
|
||||
if info[2] != None and info[2] != '':
|
||||
output.write(" type='%s'" % info[2]);
|
||||
if info[1] != None and info[1] != '':
|
||||
|
@ -1053,6 +1053,18 @@
|
||||
<exports symbol='XML_PARSER_START'/>
|
||||
<exports symbol='XML_PARSER_START_TAG'/>
|
||||
<exports symbol='XML_PARSER_SYSTEM_LITERAL'/>
|
||||
<exports symbol='XML_PARSE_DTDATTR'/>
|
||||
<exports symbol='XML_PARSE_DTDLOAD'/>
|
||||
<exports symbol='XML_PARSE_DTDVALID'/>
|
||||
<exports symbol='XML_PARSE_NOBLANKS'/>
|
||||
<exports symbol='XML_PARSE_NOENT'/>
|
||||
<exports symbol='XML_PARSE_NOERROR'/>
|
||||
<exports symbol='XML_PARSE_NONET'/>
|
||||
<exports symbol='XML_PARSE_NOWARNING'/>
|
||||
<exports symbol='XML_PARSE_PEDANTIC'/>
|
||||
<exports symbol='XML_PARSE_RECOVER'/>
|
||||
<exports symbol='XML_PARSE_SAX1'/>
|
||||
<exports symbol='XML_PARSE_XINCLUDE'/>
|
||||
<exports symbol='XML_SAX2_MAGIC'/>
|
||||
<exports symbol='XML_SKIP_IDS'/>
|
||||
<exports symbol='_xmlParserCtxt'/>
|
||||
@ -1099,12 +1111,18 @@
|
||||
<exports symbol='xmlCreateDocParserCtxt'/>
|
||||
<exports symbol='xmlCreateIOParserCtxt'/>
|
||||
<exports symbol='xmlCreatePushParserCtxt'/>
|
||||
<exports symbol='xmlCtxtReadDoc'/>
|
||||
<exports symbol='xmlCtxtReadFd'/>
|
||||
<exports symbol='xmlCtxtReadFile'/>
|
||||
<exports symbol='xmlCtxtReadIO'/>
|
||||
<exports symbol='xmlCtxtReadMemory'/>
|
||||
<exports symbol='xmlCtxtReset'/>
|
||||
<exports symbol='xmlCtxtUseOptions'/>
|
||||
<exports symbol='xmlExternalEntityLoader'/>
|
||||
<exports symbol='xmlFreeParserCtxt'/>
|
||||
<exports symbol='xmlGetExternalEntityLoader'/>
|
||||
<exports symbol='xmlGetFeature'/>
|
||||
<exports symbol='xmlGetFeaturesList'/>
|
||||
<exports symbol='xmlGetWarningsDefaultValue'/>
|
||||
<exports symbol='xmlIOParseDTD'/>
|
||||
<exports symbol='xmlInitNodeInfoSeq'/>
|
||||
<exports symbol='xmlInitParser'/>
|
||||
@ -1136,8 +1154,13 @@
|
||||
<exports symbol='xmlParserNodeInfoPtr'/>
|
||||
<exports symbol='xmlParserNodeInfoSeq'/>
|
||||
<exports symbol='xmlParserNodeInfoSeqPtr'/>
|
||||
<exports symbol='xmlParserVersion'/>
|
||||
<exports symbol='xmlParserOption'/>
|
||||
<exports symbol='xmlPedanticParserDefault'/>
|
||||
<exports symbol='xmlReadDoc'/>
|
||||
<exports symbol='xmlReadFd'/>
|
||||
<exports symbol='xmlReadFile'/>
|
||||
<exports symbol='xmlReadIO'/>
|
||||
<exports symbol='xmlReadMemory'/>
|
||||
<exports symbol='xmlRecoverDoc'/>
|
||||
<exports symbol='xmlRecoverFile'/>
|
||||
<exports symbol='xmlRecoverMemory'/>
|
||||
@ -1170,7 +1193,6 @@
|
||||
<exports symbol='xmlStrstr'/>
|
||||
<exports symbol='xmlStrsub'/>
|
||||
<exports symbol='xmlSubstituteEntitiesDefault'/>
|
||||
<exports symbol='xmlSubstituteEntitiesDefaultValue'/>
|
||||
</file>
|
||||
<file name='schemasInternals'>
|
||||
<exports symbol='XML_SCHEMAS_ANYATTR_LAX'/>
|
||||
@ -1300,6 +1322,7 @@
|
||||
<exports symbol='xmlTextReaderConstName'/>
|
||||
<exports symbol='xmlTextReaderConstNamespaceUri'/>
|
||||
<exports symbol='xmlTextReaderConstPrefix'/>
|
||||
<exports symbol='xmlTextReaderConstString'/>
|
||||
<exports symbol='xmlTextReaderConstXmlLang'/>
|
||||
<exports symbol='xmlTextReaderCurrentDoc'/>
|
||||
<exports symbol='xmlTextReaderCurrentNode'/>
|
||||
@ -2654,11 +2677,11 @@
|
||||
<info>Check if the current value on the XPath stack is a node set or an XSLT value tree. Returns true if the current object on the stack is a node-set.</info>
|
||||
<arg name='ctxt' info='an XPath parser context'/>
|
||||
</macro>
|
||||
<enum name='HTML_DEPRECATED' file='HTMLparser' value='0x2' type='htmlStatus'/>
|
||||
<enum name='HTML_INVALID' file='HTMLparser' value='0x1' type='htmlStatus'/>
|
||||
<enum name='HTML_DEPRECATED' file='HTMLparser' value='2' type='htmlStatus'/>
|
||||
<enum name='HTML_INVALID' file='HTMLparser' value='1' type='htmlStatus'/>
|
||||
<enum name='HTML_NA' file='HTMLparser' value='0' type='htmlStatus' info='something we don't check at all'/>
|
||||
<enum name='HTML_REQUIRED' file='HTMLparser' value='0xc' type='htmlStatus' info=' VALID bit set so ( & HTML_VALID ) is TRUE'/>
|
||||
<enum name='HTML_VALID' file='HTMLparser' value='0x4' type='htmlStatus'/>
|
||||
<enum name='HTML_REQUIRED' file='HTMLparser' value='12' type='htmlStatus' info=' VALID bit set so ( & HTML_VALID ) is TRUE'/>
|
||||
<enum name='HTML_VALID' file='HTMLparser' value='4' type='htmlStatus'/>
|
||||
<enum name='XLINK_ACTUATE_AUTO' file='xlink' value='1' type='xlinkActuate'/>
|
||||
<enum name='XLINK_ACTUATE_NONE' file='xlink' value='0' type='xlinkActuate'/>
|
||||
<enum name='XLINK_ACTUATE_ONREQUEST' file='xlink' value='2' type='xlinkActuate'/>
|
||||
@ -2746,7 +2769,7 @@
|
||||
<enum name='XML_ENTITY_NODE' file='tree' value='6' type='xmlElementType'/>
|
||||
<enum name='XML_ENTITY_REF_NODE' file='tree' value='5' type='xmlElementType'/>
|
||||
<enum name='XML_ERR_ATTLIST_NOT_FINISHED' file='xmlerror' value='51' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_ATTLIST_NOT_STARTED' file='xmlerror' value='50' type='xmlParserErrors' info='51'/>
|
||||
<enum name='XML_ERR_ATTLIST_NOT_STARTED' file='xmlerror' value='50' type='xmlParserErrors' info='50'/>
|
||||
<enum name='XML_ERR_ATTRIBUTE_NOT_FINISHED' file='xmlerror' value='40' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_ATTRIBUTE_NOT_STARTED' file='xmlerror' value='39' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_ATTRIBUTE_REDEFINED' file='xmlerror' value='42' type='xmlParserErrors'/>
|
||||
@ -2757,17 +2780,17 @@
|
||||
<enum name='XML_ERR_CHARREF_IN_EPILOG' file='xmlerror' value='12' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_CHARREF_IN_PROLOG' file='xmlerror' value='11' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_COMMENT_NOT_FINISHED' file='xmlerror' value='45' type='xmlParserErrors' info='45'/>
|
||||
<enum name='XML_ERR_CONDSEC_INVALID' file='xmlerror' value='83' type='xmlParserErrors' info='84'/>
|
||||
<enum name='XML_ERR_CONDSEC_INVALID' file='xmlerror' value='83' type='xmlParserErrors' info='83'/>
|
||||
<enum name='XML_ERR_CONDSEC_INVALID_KEYWORD' file='xmlerror' value='99' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_CONDSEC_NOT_FINISHED' file='xmlerror' value='59' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_CONDSEC_NOT_STARTED' file='xmlerror' value='58' type='xmlParserErrors' info='59'/>
|
||||
<enum name='XML_ERR_DOCTYPE_NOT_FINISHED' file='xmlerror' value='61' type='xmlParserErrors' info='62'/>
|
||||
<enum name='XML_ERR_CONDSEC_NOT_STARTED' file='xmlerror' value='58' type='xmlParserErrors' info='58'/>
|
||||
<enum name='XML_ERR_DOCTYPE_NOT_FINISHED' file='xmlerror' value='61' type='xmlParserErrors' info='61'/>
|
||||
<enum name='XML_ERR_DOCUMENT_EMPTY' file='xmlerror' value='4' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_DOCUMENT_END' file='xmlerror' value='5' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_DOCUMENT_START' file='xmlerror' value='3' type='xmlParserErrors' info='3'/>
|
||||
<enum name='XML_ERR_ELEMCONTENT_NOT_FINISHED' file='xmlerror' value='55' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_ELEMCONTENT_NOT_STARTED' file='xmlerror' value='54' type='xmlParserErrors' info='55'/>
|
||||
<enum name='XML_ERR_ENCODING_NAME' file='xmlerror' value='79' type='xmlParserErrors' info='80'/>
|
||||
<enum name='XML_ERR_ELEMCONTENT_NOT_STARTED' file='xmlerror' value='54' type='xmlParserErrors' info='54'/>
|
||||
<enum name='XML_ERR_ENCODING_NAME' file='xmlerror' value='79' type='xmlParserErrors' info='79'/>
|
||||
<enum name='XML_ERR_ENTITYREF_AT_EOF' file='xmlerror' value='14' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_ENTITYREF_IN_DTD' file='xmlerror' value='17' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_ENTITYREF_IN_EPILOG' file='xmlerror' value='16' type='xmlParserErrors'/>
|
||||
@ -2775,7 +2798,7 @@
|
||||
<enum name='XML_ERR_ENTITYREF_NO_NAME' file='xmlerror' value='22' type='xmlParserErrors' info='22'/>
|
||||
<enum name='XML_ERR_ENTITYREF_SEMICOL_MISSING' file='xmlerror' value='23' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_ENTITY_BOUNDARY' file='xmlerror' value='90' type='xmlParserErrors' info='90'/>
|
||||
<enum name='XML_ERR_ENTITY_CHAR_ERROR' file='xmlerror' value='87' type='xmlParserErrors' info='88'/>
|
||||
<enum name='XML_ERR_ENTITY_CHAR_ERROR' file='xmlerror' value='87' type='xmlParserErrors' info='87'/>
|
||||
<enum name='XML_ERR_ENTITY_IS_EXTERNAL' file='xmlerror' value='29' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_ENTITY_IS_PARAMETER' file='xmlerror' value='30' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_ENTITY_LOOP' file='xmlerror' value='89' type='xmlParserErrors' info='89'/>
|
||||
@ -2783,16 +2806,16 @@
|
||||
<enum name='XML_ERR_ENTITY_NOT_STARTED' file='xmlerror' value='36' type='xmlParserErrors' info='36'/>
|
||||
<enum name='XML_ERR_ENTITY_PE_INTERNAL' file='xmlerror' value='88' type='xmlParserErrors' info='88'/>
|
||||
<enum name='XML_ERR_EQUAL_REQUIRED' file='xmlerror' value='75' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_EXTRA_CONTENT' file='xmlerror' value='86' type='xmlParserErrors' info='87'/>
|
||||
<enum name='XML_ERR_EXT_ENTITY_STANDALONE' file='xmlerror' value='82' type='xmlParserErrors' info='83'/>
|
||||
<enum name='XML_ERR_EXT_SUBSET_NOT_FINISHED' file='xmlerror' value='60' type='xmlParserErrors' info='61'/>
|
||||
<enum name='XML_ERR_EXTRA_CONTENT' file='xmlerror' value='86' type='xmlParserErrors' info='86'/>
|
||||
<enum name='XML_ERR_EXT_ENTITY_STANDALONE' file='xmlerror' value='82' type='xmlParserErrors' info='82'/>
|
||||
<enum name='XML_ERR_EXT_SUBSET_NOT_FINISHED' file='xmlerror' value='60' type='xmlParserErrors' info='60'/>
|
||||
<enum name='XML_ERR_GT_REQUIRED' file='xmlerror' value='73' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_HYPHEN_IN_COMMENT' file='xmlerror' value='80' type='xmlParserErrors' info='81'/>
|
||||
<enum name='XML_ERR_HYPHEN_IN_COMMENT' file='xmlerror' value='80' type='xmlParserErrors' info='80'/>
|
||||
<enum name='XML_ERR_INTERNAL_ERROR' file='xmlerror' value='1' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_INVALID_CHAR' file='xmlerror' value='9' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_INVALID_CHARREF' file='xmlerror' value='8' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_INVALID_DEC_CHARREF' file='xmlerror' value='7' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_INVALID_ENCODING' file='xmlerror' value='81' type='xmlParserErrors' info='82'/>
|
||||
<enum name='XML_ERR_INVALID_ENCODING' file='xmlerror' value='81' type='xmlParserErrors' info='81'/>
|
||||
<enum name='XML_ERR_INVALID_HEX_CHARREF' file='xmlerror' value='6' type='xmlParserErrors' info='6'/>
|
||||
<enum name='XML_ERR_INVALID_URI' file='xmlerror' value='91' type='xmlParserErrors' info='91'/>
|
||||
<enum name='XML_ERR_LITERAL_NOT_FINISHED' file='xmlerror' value='44' type='xmlParserErrors'/>
|
||||
@ -2800,14 +2823,14 @@
|
||||
<enum name='XML_ERR_LTSLASH_REQUIRED' file='xmlerror' value='74' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_LT_IN_ATTRIBUTE' file='xmlerror' value='38' type='xmlParserErrors' info='38'/>
|
||||
<enum name='XML_ERR_LT_REQUIRED' file='xmlerror' value='72' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_MISPLACED_CDATA_END' file='xmlerror' value='62' type='xmlParserErrors' info='63'/>
|
||||
<enum name='XML_ERR_MISPLACED_CDATA_END' file='xmlerror' value='62' type='xmlParserErrors' info='62'/>
|
||||
<enum name='XML_ERR_MIXED_NOT_FINISHED' file='xmlerror' value='53' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_MIXED_NOT_STARTED' file='xmlerror' value='52' type='xmlParserErrors' info='53'/>
|
||||
<enum name='XML_ERR_MIXED_NOT_STARTED' file='xmlerror' value='52' type='xmlParserErrors' info='52'/>
|
||||
<enum name='XML_ERR_NAME_REQUIRED' file='xmlerror' value='68' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_NMTOKEN_REQUIRED' file='xmlerror' value='67' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_NOTATION_NOT_FINISHED' file='xmlerror' value='49' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_NOTATION_NOT_STARTED' file='xmlerror' value='48' type='xmlParserErrors' info='49'/>
|
||||
<enum name='XML_ERR_NOT_WELL_BALANCED' file='xmlerror' value='85' type='xmlParserErrors' info='86'/>
|
||||
<enum name='XML_ERR_NOTATION_NOT_STARTED' file='xmlerror' value='48' type='xmlParserErrors' info='48'/>
|
||||
<enum name='XML_ERR_NOT_WELL_BALANCED' file='xmlerror' value='85' type='xmlParserErrors' info='85'/>
|
||||
<enum name='XML_ERR_NO_DTD' file='xmlerror' value='94' type='xmlParserErrors' info='94'/>
|
||||
<enum name='XML_ERR_NO_MEMORY' file='xmlerror' value='2' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_NS_DECL_ERROR' file='xmlerror' value='35' type='xmlParserErrors'/>
|
||||
@ -2820,15 +2843,15 @@
|
||||
<enum name='XML_ERR_PEREF_NO_NAME' file='xmlerror' value='24' type='xmlParserErrors' info='24'/>
|
||||
<enum name='XML_ERR_PEREF_SEMICOL_MISSING' file='xmlerror' value='25' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_PI_NOT_FINISHED' file='xmlerror' value='47' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_PI_NOT_STARTED' file='xmlerror' value='46' type='xmlParserErrors' info='47'/>
|
||||
<enum name='XML_ERR_PI_NOT_STARTED' file='xmlerror' value='46' type='xmlParserErrors' info='46'/>
|
||||
<enum name='XML_ERR_PUBID_REQUIRED' file='xmlerror' value='71' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_RESERVED_XML_NAME' file='xmlerror' value='64' type='xmlParserErrors' info='65'/>
|
||||
<enum name='XML_ERR_RESERVED_XML_NAME' file='xmlerror' value='64' type='xmlParserErrors' info='64'/>
|
||||
<enum name='XML_ERR_SEPARATOR_REQUIRED' file='xmlerror' value='66' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_SPACE_REQUIRED' file='xmlerror' value='65' type='xmlParserErrors' info='66'/>
|
||||
<enum name='XML_ERR_STANDALONE_VALUE' file='xmlerror' value='78' type='xmlParserErrors' info='79'/>
|
||||
<enum name='XML_ERR_SPACE_REQUIRED' file='xmlerror' value='65' type='xmlParserErrors' info='65'/>
|
||||
<enum name='XML_ERR_STANDALONE_VALUE' file='xmlerror' value='78' type='xmlParserErrors' info='78'/>
|
||||
<enum name='XML_ERR_STRING_NOT_CLOSED' file='xmlerror' value='34' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_STRING_NOT_STARTED' file='xmlerror' value='33' type='xmlParserErrors' info='33'/>
|
||||
<enum name='XML_ERR_TAG_NAME_MISMATCH' file='xmlerror' value='76' type='xmlParserErrors' info='77'/>
|
||||
<enum name='XML_ERR_TAG_NAME_MISMATCH' file='xmlerror' value='76' type='xmlParserErrors' info='76'/>
|
||||
<enum name='XML_ERR_TAG_NOT_FINISHED' file='xmlerror' value='77' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_UNDECLARED_ENTITY' file='xmlerror' value='26' type='xmlParserErrors' info='26'/>
|
||||
<enum name='XML_ERR_UNKNOWN_ENCODING' file='xmlerror' value='31' type='xmlParserErrors' info='31'/>
|
||||
@ -2836,10 +2859,10 @@
|
||||
<enum name='XML_ERR_UNSUPPORTED_ENCODING' file='xmlerror' value='32' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_URI_FRAGMENT' file='xmlerror' value='92' type='xmlParserErrors' info='92'/>
|
||||
<enum name='XML_ERR_URI_REQUIRED' file='xmlerror' value='70' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_VALUE_REQUIRED' file='xmlerror' value='84' type='xmlParserErrors' info='85'/>
|
||||
<enum name='XML_ERR_VALUE_REQUIRED' file='xmlerror' value='84' type='xmlParserErrors' info='84'/>
|
||||
<enum name='XML_ERR_VERSION_MISSING' file='xmlerror' value='100' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_XMLDECL_NOT_FINISHED' file='xmlerror' value='57' type='xmlParserErrors'/>
|
||||
<enum name='XML_ERR_XMLDECL_NOT_STARTED' file='xmlerror' value='56' type='xmlParserErrors' info='57'/>
|
||||
<enum name='XML_ERR_XMLDECL_NOT_STARTED' file='xmlerror' value='56' type='xmlParserErrors' info='56'/>
|
||||
<enum name='XML_EXTERNAL_GENERAL_PARSED_ENTITY' file='entities' value='2' type='xmlEntityType'/>
|
||||
<enum name='XML_EXTERNAL_GENERAL_UNPARSED_ENTITY' file='entities' value='3' type='xmlEntityType'/>
|
||||
<enum name='XML_EXTERNAL_PARAMETER_ENTITY' file='entities' value='5' type='xmlEntityType'/>
|
||||
@ -2879,6 +2902,18 @@
|
||||
<enum name='XML_PARSER_SUBST_ENTITIES' file='xmlreader' value='4' type='xmlParserProperties'/>
|
||||
<enum name='XML_PARSER_SYSTEM_LITERAL' file='parser' value='13' type='xmlParserInputState' info='within a SYSTEM value'/>
|
||||
<enum name='XML_PARSER_VALIDATE' file='xmlreader' value='3' type='xmlParserProperties'/>
|
||||
<enum name='XML_PARSE_DTDATTR' file='parser' value='8' type='xmlParserOption' info='default DTD attributes'/>
|
||||
<enum name='XML_PARSE_DTDLOAD' file='parser' value='4' type='xmlParserOption' info='load the external subset'/>
|
||||
<enum name='XML_PARSE_DTDVALID' file='parser' value='16' type='xmlParserOption' info='validate with the DTD'/>
|
||||
<enum name='XML_PARSE_NOBLANKS' file='parser' value='256' type='xmlParserOption' info='remove blank nodes'/>
|
||||
<enum name='XML_PARSE_NOENT' file='parser' value='2' type='xmlParserOption' info='substitute entities'/>
|
||||
<enum name='XML_PARSE_NOERROR' file='parser' value='32' type='xmlParserOption' info='suppress error reports'/>
|
||||
<enum name='XML_PARSE_NONET' file='parser' value='2048' type='xmlParserOption' info=' Forbid network access'/>
|
||||
<enum name='XML_PARSE_NOWARNING' file='parser' value='64' type='xmlParserOption' info='suppress warning reports'/>
|
||||
<enum name='XML_PARSE_PEDANTIC' file='parser' value='128' type='xmlParserOption' info='pedantic error reporting'/>
|
||||
<enum name='XML_PARSE_RECOVER' file='parser' value='1' type='xmlParserOption' info='recover on errors'/>
|
||||
<enum name='XML_PARSE_SAX1' file='parser' value='512' type='xmlParserOption' info='use the SAX1 interface internally'/>
|
||||
<enum name='XML_PARSE_XINCLUDE' file='parser' value='1024' type='xmlParserOption' info='Implement XInclude substitition'/>
|
||||
<enum name='XML_PI_NODE' file='tree' value='7' type='xmlElementType'/>
|
||||
<enum name='XML_READER_TYPE_ATTRIBUTE' file='xmlreader' value='2' type='xmlReaderTypes'/>
|
||||
<enum name='XML_READER_TYPE_CDATA' file='xmlreader' value='4' type='xmlReaderTypes'/>
|
||||
@ -3511,6 +3546,7 @@ actually an xmlCharEncoding'/>
|
||||
<field name='buffer' type='xmlParserNodeInfo *' info=''/>
|
||||
</struct>
|
||||
<typedef name='xmlParserNodeInfoSeqPtr' file='parser' type='xmlParserNodeInfoSeq *'/>
|
||||
<typedef name='xmlParserOption' file='parser' type='enum'/>
|
||||
<typedef name='xmlParserProperties' file='xmlreader' type='enum'/>
|
||||
<typedef name='xmlParserSeverities' file='xmlreader' type='enum'/>
|
||||
<struct name='xmlRMutex' file='threads' type='struct _xmlRMutex'/>
|
||||
@ -3852,7 +3888,7 @@ actually an xmlCharEncoding'/>
|
||||
<variable name='xmlFree' file='globals' type='xmlFreeFunc'/>
|
||||
<variable name='xmlGenericError' file='globals' type='xmlGenericErrorFunc'/>
|
||||
<variable name='xmlGenericErrorContext' file='globals' type='void *'/>
|
||||
<variable name='xmlGetWarningsDefaultValue' file='parser' type='int'/>
|
||||
<variable name='xmlGetWarningsDefaultValue' file='globals' type='int'/>
|
||||
<variable name='xmlIndentTreeOutput' file='globals' type='int'/>
|
||||
<variable name='xmlKeepBlanksDefaultValue' file='globals' type='int'/>
|
||||
<variable name='xmlLineNumbersDefaultValue' file='globals' type='int'/>
|
||||
@ -3861,7 +3897,7 @@ actually an xmlCharEncoding'/>
|
||||
<variable name='xmlMallocAtomic' file='globals' type='xmlMallocFunc'/>
|
||||
<variable name='xmlMemStrdup' file='globals' type='xmlStrdupFunc'/>
|
||||
<variable name='xmlParserDebugEntities' file='globals' type='int'/>
|
||||
<variable name='xmlParserVersion' file='parser' type='const char *'/>
|
||||
<variable name='xmlParserVersion' file='globals' type='const char *'/>
|
||||
<variable name='xmlPedanticParserDefaultValue' file='globals' type='int'/>
|
||||
<variable name='xmlRealloc' file='globals' type='xmlReallocFunc'/>
|
||||
<variable name='xmlRegisterNodeDefaultValue' file='globals' type='xmlRegisterNodeFunc'/>
|
||||
@ -3869,7 +3905,7 @@ actually an xmlCharEncoding'/>
|
||||
<variable name='xmlStringComment' file='parserInternals' type='const xmlCharxmlStringComment[]'/>
|
||||
<variable name='xmlStringText' file='parserInternals' type='const xmlCharxmlStringText[]'/>
|
||||
<variable name='xmlStringTextNoenc' file='parserInternals' type='const xmlCharxmlStringTextNoenc[]'/>
|
||||
<variable name='xmlSubstituteEntitiesDefaultValue' file='parser' type='int'/>
|
||||
<variable name='xmlSubstituteEntitiesDefaultValue' file='globals' type='int'/>
|
||||
<variable name='xmlTreeIndentString' file='globals' type='const char *'/>
|
||||
<variable name='xmlXPathNAN' file='xpath' type='double'/>
|
||||
<variable name='xmlXPathNINF' file='xpath' type='double'/>
|
||||
@ -5606,7 +5642,7 @@ actually an xmlCharEncoding'/>
|
||||
<function name='xmlCreateDocParserCtxt' file='parser'>
|
||||
<info>Creates a parser context for an XML in-memory document.</info>
|
||||
<return type='xmlParserCtxtPtr' info='the new parser context or NULL'/>
|
||||
<arg name='cur' type='xmlChar *' info='a pointer to an array of xmlChar'/>
|
||||
<arg name='cur' type='const xmlChar *' info='a pointer to an array of xmlChar'/>
|
||||
</function>
|
||||
<function name='xmlCreateEntitiesTable' file='entities'>
|
||||
<info>create and initialize an empty entities hash table.</info>
|
||||
@ -5666,6 +5702,60 @@ actually an xmlCharEncoding'/>
|
||||
<info>Simply creates an empty xmlURI</info>
|
||||
<return type='xmlURIPtr' info='the new structure or NULL in case of error'/>
|
||||
</function>
|
||||
<function name='xmlCtxtReadDoc' file='parser'>
|
||||
<info>parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
|
||||
<arg name='cur' type='const xmlChar *' info='a pointer to a zero terminated string'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlCtxtReadFd' file='parser'>
|
||||
<info>parse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
|
||||
<arg name='fd' type='int' info='an open file descriptor'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlCtxtReadFile' file='parser'>
|
||||
<info>parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
|
||||
<arg name='filename' type='const char *' info='a file or URL'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlCtxtReadIO' file='parser'>
|
||||
<info>parse an XML document from I/O functions and source and build a tree. This reuses the existing @ctxt parser context</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
|
||||
<arg name='ioread' type='xmlInputReadCallback' info='an I/O read function'/>
|
||||
<arg name='ioclose' type='xmlInputCloseCallback' info='an I/O close function'/>
|
||||
<arg name='ioctx' type='void *' info='an I/O handler'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlCtxtReadMemory' file='parser'>
|
||||
<info>parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
|
||||
<arg name='buffer' type='const char *' info='a pointer to a char array'/>
|
||||
<arg name='size' type='int' info='the size of the array'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlCtxtReset' file='parser'>
|
||||
<info>Reset a parser context</info>
|
||||
<return type='void'/>
|
||||
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
|
||||
</function>
|
||||
<function name='xmlCtxtUseOptions' file='parser'>
|
||||
<info>Applies the options to the parser context</info>
|
||||
<return type='int' info='0 in case of success, the set of unknown or unimplemented options in case of error.'/>
|
||||
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlCurrentChar' file='parserInternals'>
|
||||
<info>The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer. Implement the end of line normalization: 2.11 End-of-Line Handling Wherever an external parsed entity or the literal entity value of an internal parsed entity contains either the literal two-character sequence "#xD#xA" or a standalone literal #xD, an XML processor must pass to the application the single character #xA. This behavior can conveniently be produced by normalizing all line breaks to #xA on input, before parsing.)</info>
|
||||
<return type='int' info='the current char value and its length'/>
|
||||
@ -7615,7 +7705,7 @@ actually an xmlCharEncoding'/>
|
||||
<info>Set (or reset) the base URI of a node, i.e. the value of the xml:base attribute.</info>
|
||||
<return type='void'/>
|
||||
<arg name='cur' type='xmlNodePtr' info='the node being changed'/>
|
||||
<arg name='uri' type='xmlChar *' info='the new base URI'/>
|
||||
<arg name='uri' type='const xmlChar *' info='the new base URI'/>
|
||||
</function>
|
||||
<function name='xmlNodeSetContent' file='tree'>
|
||||
<info>Replace the content of a node.</info>
|
||||
@ -8264,6 +8354,44 @@ actually an xmlCharEncoding'/>
|
||||
<return type='void'/>
|
||||
<arg name='tok' type='xmlRMutexPtr' info='the reentrant mutex'/>
|
||||
</function>
|
||||
<function name='xmlReadDoc' file='parser'>
|
||||
<info>parse an XML in-memory document and build a tree.</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='cur' type='const xmlChar *' info='a pointer to a zero terminated string'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlReadFd' file='parser'>
|
||||
<info>parse an XML from a file descriptor and build a tree.</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='fd' type='int' info='an open file descriptor'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlReadFile' file='parser'>
|
||||
<info>parse an XML file from the filesystem or the network.</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='filename' type='const char *' info='a file or URL'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlReadIO' file='parser'>
|
||||
<info>parse an XML document from I/O functions and source and build a tree.</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='ioread' type='xmlInputReadCallback' info='an I/O read function'/>
|
||||
<arg name='ioclose' type='xmlInputCloseCallback' info='an I/O close function'/>
|
||||
<arg name='ioctx' type='void *' info='an I/O handler'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<function name='xmlReadMemory' file='parser'>
|
||||
<info>parse an XML in-memory document and build a tree.</info>
|
||||
<return type='xmlDocPtr' info='the resulting document tree'/>
|
||||
<arg name='buffer' type='const char *' info='a pointer to a char array'/>
|
||||
<arg name='size' type='int' info='the size of the array'/>
|
||||
<arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
|
||||
<arg name='options' type='int' info='a combination of xmlParserOption(s)'/>
|
||||
</function>
|
||||
<functype name='xmlReallocFunc' file='xmlmemory'>
|
||||
<info>Signature for a realloc() implementation.</info>
|
||||
<return type='void *' info='a pointer to the newly reallocated block or NULL in case of error.'/>
|
||||
@ -9569,6 +9697,12 @@ actually an xmlCharEncoding'/>
|
||||
<return type='const xmlChar *' info='the prefix or NULL if not available, the string is deallocated with the reader.'/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||
</function>
|
||||
<function name='xmlTextReaderConstString' file='xmlreader'>
|
||||
<info>Get an interned string from the reader, allows for example to speedup string name comparisons</info>
|
||||
<return type='const xmlChar *' info='an interned copy of the string or NULL in case of error. The string will be deallocated with the reader.'/>
|
||||
<arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
|
||||
<arg name='str' type='const xmlChar *' info='the string to intern.'/>
|
||||
</function>
|
||||
<function name='xmlTextReaderConstXmlLang' file='xmlreader'>
|
||||
<info></info>
|
||||
<return type='const xmlChar *' info=''/>
|
||||
|
@ -725,30 +725,6 @@ typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
|
||||
const char *ID,
|
||||
xmlParserCtxtPtr context);
|
||||
|
||||
/*
|
||||
* Global variables: just the default SAX interface tables and XML
|
||||
* version infos.
|
||||
*/
|
||||
#if 0
|
||||
LIBXML_DLL_IMPORT extern const char *xmlParserVersion;
|
||||
#endif
|
||||
|
||||
/*
|
||||
LIBXML_DLL_IMPORT extern xmlSAXLocator xmlDefaultSAXLocator;
|
||||
LIBXML_DLL_IMPORT extern xmlSAXHandler xmlDefaultSAXHandler;
|
||||
LIBXML_DLL_IMPORT extern xmlSAXHandler htmlDefaultSAXHandler;
|
||||
LIBXML_DLL_IMPORT extern xmlSAXHandler docbDefaultSAXHandler;
|
||||
*/
|
||||
|
||||
/*
|
||||
* Entity substitution default behavior.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultValue;
|
||||
LIBXML_DLL_IMPORT extern int xmlGetWarningsDefaultValue;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@ -968,7 +944,7 @@ XMLPUBFUN void XMLCALL
|
||||
const xmlChar* buffer,
|
||||
const char *filename);
|
||||
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
||||
xmlCreateDocParserCtxt (xmlChar *cur);
|
||||
xmlCreateDocParserCtxt (const xmlChar *cur);
|
||||
|
||||
/*
|
||||
* Reading/setting optional parsing features.
|
||||
@ -1047,6 +1023,86 @@ XMLPUBFUN xmlParserInputPtr XMLCALL
|
||||
xmlLoadExternalEntity (const char *URL,
|
||||
const char *ID,
|
||||
xmlParserCtxtPtr ctxt);
|
||||
/*
|
||||
* New set of simpler/more flexible APIs
|
||||
*/
|
||||
/**
|
||||
* xmlParserOption:
|
||||
*
|
||||
* This is the set of XML parser options that can be passed down
|
||||
* to the xmlReadDoc() and similar calls.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_PARSE_RECOVER = 1<<0, /* recover on errors */
|
||||
XML_PARSE_NOENT = 1<<1, /* substitute entities */
|
||||
XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */
|
||||
XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */
|
||||
XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */
|
||||
XML_PARSE_NOERROR = 1<<5, /* suppress error reports */
|
||||
XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */
|
||||
XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
|
||||
XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
|
||||
XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */
|
||||
XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */
|
||||
XML_PARSE_NONET = 1<<11 /* Forbid network access */
|
||||
} xmlParserOption;
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCtxtReset (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlReadDoc (const xmlChar *cur,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlReadFile (const char *filename,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlReadMemory (const char *buffer,
|
||||
int size,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlReadFd (int fd,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlReadIO (xmlInputReadCallback ioread,
|
||||
xmlInputCloseCallback ioclose,
|
||||
void *ioctx,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *cur,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
|
||||
const char *filename,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
|
||||
const char *buffer,
|
||||
int size,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
|
||||
int fd,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
|
||||
xmlInputReadCallback ioread,
|
||||
xmlInputCloseCallback ioclose,
|
||||
void *ioctx,
|
||||
const char *encoding,
|
||||
int options);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
526
parser.c
526
parser.c
@ -11740,13 +11740,13 @@ int xmlSAXUserParseMemory(xmlSAXHandlerPtr sax, void *user_data,
|
||||
* Returns the new parser context or NULL
|
||||
*/
|
||||
xmlParserCtxtPtr
|
||||
xmlCreateDocParserCtxt(xmlChar *cur) {
|
||||
xmlCreateDocParserCtxt(const xmlChar *cur) {
|
||||
int len;
|
||||
|
||||
if (cur == NULL)
|
||||
return(NULL);
|
||||
len = xmlStrlen(cur);
|
||||
return(xmlCreateMemoryParserCtxt((char *)cur, len));
|
||||
return(xmlCreateMemoryParserCtxt((const char *)cur, len));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -11918,3 +11918,525 @@ xmlCleanupParser(void) {
|
||||
xmlCleanupGlobals();
|
||||
xmlParserInitialized = 0;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* New set (2.6.0) of simpler and more flexible APIs *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlCtxtReset:
|
||||
* @ctxt: an XML parser context
|
||||
*
|
||||
* Reset a parser context
|
||||
*/
|
||||
void
|
||||
xmlCtxtReset(xmlParserCtxtPtr ctxt)
|
||||
{
|
||||
xmlParserInputPtr input;
|
||||
|
||||
while ((input = inputPop(ctxt)) != NULL) { /* Non consuming */
|
||||
xmlFreeInputStream(input);
|
||||
}
|
||||
ctxt->inputNr = 0;
|
||||
ctxt->input = NULL;
|
||||
|
||||
ctxt->spaceNr = 0;
|
||||
ctxt->spaceTab[0] = -1;
|
||||
ctxt->space = &ctxt->spaceTab[0];
|
||||
|
||||
|
||||
ctxt->nodeNr = 0;
|
||||
ctxt->node = NULL;
|
||||
|
||||
ctxt->nameNr = 0;
|
||||
ctxt->name = NULL;
|
||||
|
||||
ctxt->version = NULL;
|
||||
ctxt->encoding = NULL;
|
||||
ctxt->standalone = -1;
|
||||
ctxt->hasExternalSubset = 0;
|
||||
ctxt->hasPErefs = 0;
|
||||
ctxt->html = 0;
|
||||
ctxt->external = 0;
|
||||
ctxt->instate = XML_PARSER_START;
|
||||
ctxt->token = 0;
|
||||
ctxt->directory = NULL;
|
||||
|
||||
ctxt->myDoc = NULL;
|
||||
ctxt->wellFormed = 1;
|
||||
ctxt->nsWellFormed = 1;
|
||||
ctxt->valid = 1;
|
||||
ctxt->vctxt.userData = ctxt;
|
||||
ctxt->vctxt.error = xmlParserValidityError;
|
||||
ctxt->vctxt.warning = xmlParserValidityWarning;
|
||||
ctxt->record_info = 0;
|
||||
ctxt->nbChars = 0;
|
||||
ctxt->checkIndex = 0;
|
||||
ctxt->inSubset = 0;
|
||||
ctxt->errNo = XML_ERR_OK;
|
||||
ctxt->depth = 0;
|
||||
ctxt->charset = XML_CHAR_ENCODING_UTF8;
|
||||
ctxt->catalogs = NULL;
|
||||
xmlInitNodeInfoSeq(&ctxt->node_seq);
|
||||
|
||||
if (ctxt->attsDefault != NULL) {
|
||||
xmlHashFree(ctxt->attsDefault, (xmlHashDeallocator) xmlFree);
|
||||
ctxt->attsDefault = NULL;
|
||||
}
|
||||
if (ctxt->attsSpecial != NULL) {
|
||||
xmlHashFree(ctxt->attsSpecial, NULL);
|
||||
ctxt->attsSpecial = NULL;
|
||||
}
|
||||
|
||||
if (ctxt->catalogs != NULL)
|
||||
xmlCatalogFreeLocal(ctxt->catalogs);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCtxtUseOptions:
|
||||
* @ctxt: an XML parser context
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* Applies the options to the parser context
|
||||
*
|
||||
* Returns 0 in case of success, the set of unknown or unimplemented options
|
||||
* in case of error.
|
||||
*/
|
||||
int
|
||||
xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options)
|
||||
{
|
||||
if (options & XML_PARSE_RECOVER) {
|
||||
ctxt->recovery = 1;
|
||||
options -= XML_PARSE_RECOVER;
|
||||
} else
|
||||
ctxt->recovery = 0;
|
||||
if (options & XML_PARSE_DTDLOAD) {
|
||||
ctxt->loadsubset = XML_DETECT_IDS;
|
||||
options -= XML_PARSE_DTDLOAD;
|
||||
} else
|
||||
ctxt->loadsubset = 0;
|
||||
if (options & XML_PARSE_DTDATTR) {
|
||||
ctxt->loadsubset |= XML_COMPLETE_ATTRS;
|
||||
options -= XML_PARSE_DTDATTR;
|
||||
}
|
||||
if (options & XML_PARSE_NOENT) {
|
||||
ctxt->replaceEntities = 1;
|
||||
/* ctxt->loadsubset |= XML_DETECT_IDS; */
|
||||
options -= XML_PARSE_NOENT;
|
||||
} else
|
||||
ctxt->replaceEntities = 0;
|
||||
if (options & XML_PARSE_NOWARNING) {
|
||||
ctxt->sax->warning = NULL;
|
||||
options -= XML_PARSE_NOWARNING;
|
||||
}
|
||||
if (options & XML_PARSE_NOERROR) {
|
||||
ctxt->sax->error = NULL;
|
||||
ctxt->sax->fatalError = NULL;
|
||||
options -= XML_PARSE_NOERROR;
|
||||
}
|
||||
if (options & XML_PARSE_PEDANTIC) {
|
||||
ctxt->pedantic = 1;
|
||||
options -= XML_PARSE_PEDANTIC;
|
||||
} else
|
||||
ctxt->pedantic = 0;
|
||||
if (options & XML_PARSE_NOBLANKS) {
|
||||
ctxt->keepBlanks = 0;
|
||||
ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
|
||||
options -= XML_PARSE_NOBLANKS;
|
||||
} else
|
||||
ctxt->keepBlanks = 1;
|
||||
if (options & XML_PARSE_DTDVALID) {
|
||||
ctxt->validate = 1;
|
||||
if (options & XML_PARSE_NOWARNING)
|
||||
ctxt->vctxt.warning = NULL;
|
||||
if (options & XML_PARSE_NOERROR)
|
||||
ctxt->vctxt.error = NULL;
|
||||
options -= XML_PARSE_DTDVALID;
|
||||
} else
|
||||
ctxt->validate = 0;
|
||||
if (options & XML_PARSE_SAX1) {
|
||||
ctxt->sax->startElement = xmlSAX2StartElement;
|
||||
ctxt->sax->endElement = xmlSAX2EndElement;
|
||||
ctxt->sax->startElementNs = NULL;
|
||||
ctxt->sax->endElementNs = NULL;
|
||||
ctxt->sax->initialized = 1;
|
||||
options -= XML_PARSE_SAX1;
|
||||
}
|
||||
return (options);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDoRead:
|
||||
* @ctxt: an XML parser context
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
* @reuse: keep the context for reuse
|
||||
*
|
||||
* Common front-end for the xmlRead functions
|
||||
*
|
||||
* Returns the resulting document tree or NULL
|
||||
*/
|
||||
static xmlDocPtr
|
||||
xmlDoRead(xmlParserCtxtPtr ctxt, const char *encoding, int options, int reuse)
|
||||
{
|
||||
xmlDocPtr ret;
|
||||
|
||||
xmlCtxtUseOptions(ctxt, options);
|
||||
if (encoding != NULL) {
|
||||
xmlCharEncodingHandlerPtr hdlr;
|
||||
|
||||
hdlr = xmlFindCharEncodingHandler(encoding);
|
||||
if (hdlr != NULL)
|
||||
xmlSwitchToEncoding(ctxt, hdlr);
|
||||
}
|
||||
xmlParseDocument(ctxt);
|
||||
if ((ctxt->wellFormed) || ctxt->recovery)
|
||||
ret = ctxt->myDoc;
|
||||
else {
|
||||
ret = NULL;
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
ctxt->myDoc = NULL;
|
||||
}
|
||||
if (!reuse)
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlReadDoc:
|
||||
* @cur: a pointer to a zero terminated string
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML in-memory document and build a tree.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlReadDoc(const xmlChar * cur, const char *encoding, int options)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt;
|
||||
|
||||
if (cur == NULL)
|
||||
return (NULL);
|
||||
|
||||
ctxt = xmlCreateDocParserCtxt(cur);
|
||||
if (ctxt == NULL)
|
||||
return (NULL);
|
||||
return (xmlDoRead(ctxt, encoding, options, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlReadFile:
|
||||
* @filename: a file or URL
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML file from the filesystem or the network.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlReadFile(const char *filename, const char *encoding, int options)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt;
|
||||
|
||||
ctxt = xmlCreateFileParserCtxt(filename);
|
||||
if (ctxt == NULL)
|
||||
return (NULL);
|
||||
return (xmlDoRead(ctxt, encoding, options, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlReadMemory:
|
||||
* @buffer: a pointer to a char array
|
||||
* @size: the size of the array
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML in-memory document and build a tree.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlReadMemory(const char *buffer, int size, const char *encoding, int options)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt;
|
||||
|
||||
ctxt = xmlCreateMemoryParserCtxt(buffer, size);
|
||||
if (ctxt == NULL)
|
||||
return (NULL);
|
||||
return (xmlDoRead(ctxt, encoding, options, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlReadFd:
|
||||
* @fd: an open file descriptor
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML from a file descriptor and build a tree.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlReadFd(int fd, const char *encoding, int options)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt;
|
||||
xmlParserInputBufferPtr input;
|
||||
xmlParserInputPtr stream;
|
||||
|
||||
if (fd < 0)
|
||||
return (NULL);
|
||||
|
||||
input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
|
||||
if (input == NULL)
|
||||
return (NULL);
|
||||
ctxt = xmlNewParserCtxt();
|
||||
if (ctxt == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
return (NULL);
|
||||
}
|
||||
stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
|
||||
if (stream == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return (NULL);
|
||||
}
|
||||
inputPush(ctxt, stream);
|
||||
return (xmlDoRead(ctxt, encoding, options, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlReadIO:
|
||||
* @ioread: an I/O read function
|
||||
* @ioclose: an I/O close function
|
||||
* @ioctx: an I/O handler
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML document from I/O functions and source and build a tree.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlReadIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose,
|
||||
void *ioctx, const char *encoding, int options)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt;
|
||||
xmlParserInputBufferPtr input;
|
||||
xmlParserInputPtr stream;
|
||||
|
||||
if (ioread == NULL)
|
||||
return (NULL);
|
||||
|
||||
input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx,
|
||||
XML_CHAR_ENCODING_NONE);
|
||||
if (input == NULL)
|
||||
return (NULL);
|
||||
ctxt = xmlNewParserCtxt();
|
||||
if (ctxt == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
return (NULL);
|
||||
}
|
||||
stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
|
||||
if (stream == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return (NULL);
|
||||
}
|
||||
inputPush(ctxt, stream);
|
||||
return (xmlDoRead(ctxt, encoding, options, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCtxtReadDoc:
|
||||
* @ctxt: an XML parser context
|
||||
* @cur: a pointer to a zero terminated string
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML in-memory document and build a tree.
|
||||
* This reuses the existing @ctxt parser context
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlCtxtReadDoc(xmlParserCtxtPtr ctxt, const xmlChar * cur,
|
||||
const char *encoding, int options)
|
||||
{
|
||||
xmlParserInputPtr stream;
|
||||
|
||||
if (cur == NULL)
|
||||
return (NULL);
|
||||
if (ctxt == NULL)
|
||||
return (NULL);
|
||||
|
||||
xmlCtxtReset(ctxt);
|
||||
|
||||
stream = xmlNewStringInputStream(ctxt, cur);
|
||||
if (stream == NULL) {
|
||||
return (NULL);
|
||||
}
|
||||
inputPush(ctxt, stream);
|
||||
return (xmlDoRead(ctxt, encoding, options, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCtxtReadFile:
|
||||
* @ctxt: an XML parser context
|
||||
* @filename: a file or URL
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML file from the filesystem or the network.
|
||||
* This reuses the existing @ctxt parser context
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlCtxtReadFile(xmlParserCtxtPtr ctxt, const char *filename,
|
||||
const char *encoding, int options)
|
||||
{
|
||||
xmlParserInputPtr stream;
|
||||
|
||||
if (filename == NULL)
|
||||
return (NULL);
|
||||
if (ctxt == NULL)
|
||||
return (NULL);
|
||||
|
||||
xmlCtxtReset(ctxt);
|
||||
|
||||
stream = xmlNewInputFromFile(ctxt, filename);
|
||||
if (stream == NULL) {
|
||||
return (NULL);
|
||||
}
|
||||
inputPush(ctxt, stream);
|
||||
return (xmlDoRead(ctxt, encoding, options, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCtxtReadMemory:
|
||||
* @ctxt: an XML parser context
|
||||
* @buffer: a pointer to a char array
|
||||
* @size: the size of the array
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML in-memory document and build a tree.
|
||||
* This reuses the existing @ctxt parser context
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlCtxtReadMemory(xmlParserCtxtPtr ctxt, const char *buffer, int size,
|
||||
const char *encoding, int options)
|
||||
{
|
||||
xmlParserInputBufferPtr input;
|
||||
xmlParserInputPtr stream;
|
||||
|
||||
if (ctxt == NULL)
|
||||
return (NULL);
|
||||
if (buffer == NULL)
|
||||
return (NULL);
|
||||
|
||||
xmlCtxtReset(ctxt);
|
||||
|
||||
input = xmlParserInputBufferCreateMem(buffer, size, XML_CHAR_ENCODING_NONE);
|
||||
if (input == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
|
||||
if (stream == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
inputPush(ctxt, stream);
|
||||
return (xmlDoRead(ctxt, encoding, options, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCtxtReadFd:
|
||||
* @ctxt: an XML parser context
|
||||
* @fd: an open file descriptor
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML from a file descriptor and build a tree.
|
||||
* This reuses the existing @ctxt parser context
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlCtxtReadFd(xmlParserCtxtPtr ctxt, int fd, const char *encoding,
|
||||
int options)
|
||||
{
|
||||
xmlParserInputBufferPtr input;
|
||||
xmlParserInputPtr stream;
|
||||
|
||||
if (fd < 0)
|
||||
return (NULL);
|
||||
if (ctxt == NULL)
|
||||
return (NULL);
|
||||
|
||||
xmlCtxtReset(ctxt);
|
||||
|
||||
|
||||
input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
|
||||
if (input == NULL)
|
||||
return (NULL);
|
||||
stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
|
||||
if (stream == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
return (NULL);
|
||||
}
|
||||
inputPush(ctxt, stream);
|
||||
return (xmlDoRead(ctxt, encoding, options, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCtxtReadIO:
|
||||
* @ctxt: an XML parser context
|
||||
* @ioread: an I/O read function
|
||||
* @ioclose: an I/O close function
|
||||
* @ioctx: an I/O handler
|
||||
* @encoding: the document encoding, or NULL
|
||||
* @options: a combination of xmlParserOption(s)
|
||||
*
|
||||
* parse an XML document from I/O functions and source and build a tree.
|
||||
* This reuses the existing @ctxt parser context
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
xmlDocPtr
|
||||
xmlCtxtReadIO(xmlParserCtxtPtr ctxt, xmlInputReadCallback ioread,
|
||||
xmlInputCloseCallback ioclose, void *ioctx,
|
||||
const char *encoding, int options)
|
||||
{
|
||||
xmlParserInputBufferPtr input;
|
||||
xmlParserInputPtr stream;
|
||||
|
||||
if (ioread == NULL)
|
||||
return (NULL);
|
||||
if (ctxt == NULL)
|
||||
return (NULL);
|
||||
|
||||
xmlCtxtReset(ctxt);
|
||||
|
||||
input = xmlParserInputBufferCreateIO(ioread, ioclose, ioctx,
|
||||
XML_CHAR_ENCODING_NONE);
|
||||
if (input == NULL)
|
||||
return (NULL);
|
||||
stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
|
||||
if (stream == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
return (NULL);
|
||||
}
|
||||
inputPush(ctxt, stream);
|
||||
return (xmlDoRead(ctxt, encoding, options, 1));
|
||||
}
|
||||
|
@ -110,6 +110,10 @@ parseEntity()
|
||||
parseFile()
|
||||
parseMemory()
|
||||
pedanticParserDefault()
|
||||
readDoc()
|
||||
readFd()
|
||||
readFile()
|
||||
readMemory()
|
||||
recoverDoc()
|
||||
recoverFile()
|
||||
recoverMemory()
|
||||
@ -655,6 +659,7 @@ Class xmlTextReader(xmlTextReaderCore)
|
||||
ConstName()
|
||||
ConstNamespaceUri()
|
||||
ConstPrefix()
|
||||
ConstString()
|
||||
ConstXmlLang()
|
||||
CurrentDoc()
|
||||
CurrentNode()
|
||||
@ -815,6 +820,12 @@ Class parserCtxt(parserCtxtCore)
|
||||
|
||||
# functions from module parser
|
||||
clearParserCtxt()
|
||||
ctxtReadDoc()
|
||||
ctxtReadFd()
|
||||
ctxtReadFile()
|
||||
ctxtReadMemory()
|
||||
ctxtReset()
|
||||
ctxtUseOptions()
|
||||
initParserCtxt()
|
||||
parseChunk()
|
||||
parseDocument()
|
||||
|
2
tree.c
2
tree.c
@ -6406,7 +6406,7 @@ xmlBufferEmpty(xmlBufferPtr buf) {
|
||||
if (buf->content == NULL) return;
|
||||
buf->use = 0;
|
||||
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) {
|
||||
buf->content = "";
|
||||
buf->content = BAD_CAST "";
|
||||
} else {
|
||||
memset(buf->content, 0, buf->size);
|
||||
}
|
||||
|
@ -489,6 +489,7 @@ xmlBufferCat
|
||||
xmlBufferContent
|
||||
xmlBufferCreate
|
||||
xmlBufferCreateSize
|
||||
xmlBufferCreateStatic
|
||||
xmlBufferDump
|
||||
xmlBufferEmpty
|
||||
xmlBufferFree
|
||||
@ -624,6 +625,13 @@ xmlCreateIntSubset
|
||||
xmlCreateMemoryParserCtxt
|
||||
xmlCreatePushParserCtxt
|
||||
xmlCreateURI
|
||||
xmlCtxtReadDoc
|
||||
xmlCtxtReadFd
|
||||
xmlCtxtReadFile
|
||||
xmlCtxtReadIO
|
||||
xmlCtxtReadMemory
|
||||
xmlCtxtReset
|
||||
xmlCtxtUseOptions
|
||||
xmlCurrentChar
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
xmlDebugDumpAttr
|
||||
@ -663,6 +671,8 @@ xmlDetectCharEncoding
|
||||
xmlDictCreate
|
||||
xmlDictFree
|
||||
xmlDictLookup
|
||||
xmlDictOwns
|
||||
xmlDictQLookup
|
||||
xmlDictSize
|
||||
xmlDocCopyNode
|
||||
xmlDocDump
|
||||
@ -765,6 +775,9 @@ xmlHashFree
|
||||
xmlHashLookup
|
||||
xmlHashLookup2
|
||||
xmlHashLookup3
|
||||
xmlHashQLookup
|
||||
xmlHashQLookup2
|
||||
xmlHashQLookup3
|
||||
xmlHashRemoveEntry
|
||||
xmlHashRemoveEntry2
|
||||
xmlHashRemoveEntry3
|
||||
@ -1160,6 +1173,7 @@ xmlParserInputBufferCreateFile
|
||||
xmlParserInputBufferCreateFilename
|
||||
xmlParserInputBufferCreateIO
|
||||
xmlParserInputBufferCreateMem
|
||||
xmlParserInputBufferCreateStatic
|
||||
xmlParserInputBufferGrow
|
||||
xmlParserInputBufferPush
|
||||
xmlParserInputBufferRead
|
||||
@ -1177,6 +1191,11 @@ xmlPrintURI
|
||||
xmlPushInput
|
||||
xmlRMutexLock
|
||||
xmlRMutexUnlock
|
||||
xmlReadDoc
|
||||
xmlReadFd
|
||||
xmlReadFile
|
||||
xmlReadIO
|
||||
xmlReadMemory
|
||||
#ifdef DEBUG_MEMORY_LOCATION
|
||||
xmlReallocLoc
|
||||
#endif
|
||||
@ -1284,6 +1303,45 @@ xmlRemoveID
|
||||
xmlRemoveProp
|
||||
xmlRemoveRef
|
||||
xmlReplaceNode
|
||||
xmlSAX2AttributeDecl
|
||||
xmlSAX2CDataBlock
|
||||
xmlSAX2Characters
|
||||
xmlSAX2CheckNamespace
|
||||
xmlSAX2Comment
|
||||
xmlSAX2ElementDecl
|
||||
xmlSAX2EndDocument
|
||||
xmlSAX2EndElement
|
||||
xmlSAX2EndElementNs
|
||||
xmlSAX2EntityDecl
|
||||
xmlSAX2ExternalSubset
|
||||
xmlSAX2GetColumnNumber
|
||||
xmlSAX2GetEntity
|
||||
xmlSAX2GetLineNumber
|
||||
xmlSAX2GetNamespace
|
||||
xmlSAX2GetParameterEntity
|
||||
xmlSAX2GetPublicId
|
||||
xmlSAX2GetSystemId
|
||||
xmlSAX2GlobalNamespace
|
||||
xmlSAX2HasExternalSubset
|
||||
xmlSAX2HasInternalSubset
|
||||
xmlSAX2IgnorableWhitespace
|
||||
xmlSAX2InitDefaultSAXHandler
|
||||
xmlSAX2InitDocbDefaultSAXHandler
|
||||
xmlSAX2InitHtmlDefaultSAXHandler
|
||||
xmlSAX2InternalSubset
|
||||
xmlSAX2IsStandalone
|
||||
xmlSAX2NamespaceDecl
|
||||
xmlSAX2NotationDecl
|
||||
xmlSAX2ProcessingInstruction
|
||||
xmlSAX2Reference
|
||||
xmlSAX2ResolveEntity
|
||||
xmlSAX2SetDocumentLocator
|
||||
xmlSAX2SetNamespace
|
||||
xmlSAX2StartDocument
|
||||
xmlSAX2StartElement
|
||||
xmlSAX2StartElementNs
|
||||
xmlSAX2UnparsedEntityDecl
|
||||
xmlSAXDefaultVersion
|
||||
xmlSAXParseDTD
|
||||
xmlSAXParseDoc
|
||||
xmlSAXParseEntity
|
||||
@ -1293,6 +1351,7 @@ xmlSAXParseMemory
|
||||
xmlSAXParseMemoryWithData
|
||||
xmlSAXUserParseFile
|
||||
xmlSAXUserParseMemory
|
||||
xmlSAXVersion
|
||||
xmlSaveFile
|
||||
xmlSaveFileEnc
|
||||
xmlSaveFileTo
|
||||
@ -1436,6 +1495,7 @@ xmlSplitQName3
|
||||
xmlSprintfElementContent
|
||||
xmlStopParser
|
||||
xmlStrEqual
|
||||
xmlStrQEqual
|
||||
xmlStrcasecmp
|
||||
xmlStrcasestr
|
||||
xmlStrcat
|
||||
@ -1445,6 +1505,7 @@ xmlStrdup
|
||||
xmlStringCurrentChar
|
||||
xmlStringDecodeEntities
|
||||
xmlStringGetNodeList
|
||||
xmlStringLenDecodeEntities
|
||||
xmlStringLenGetNodeList
|
||||
xmlStrlen
|
||||
xmlStrncasecmp
|
||||
@ -1461,6 +1522,13 @@ xmlTextMerge
|
||||
xmlTextReaderAttributeCount
|
||||
xmlTextReaderBaseUri
|
||||
xmlTextReaderClose
|
||||
xmlTextReaderConstBaseUri
|
||||
xmlTextReaderConstLocalName
|
||||
xmlTextReaderConstName
|
||||
xmlTextReaderConstNamespaceUri
|
||||
xmlTextReaderConstPrefix
|
||||
xmlTextReaderConstString
|
||||
xmlTextReaderConstXmlLang
|
||||
xmlTextReaderCurrentDoc
|
||||
xmlTextReaderCurrentNode
|
||||
xmlTextReaderDepth
|
||||
|
126
xmllint.c
126
xmllint.c
@ -144,6 +144,7 @@ static int stream = 0;
|
||||
static int chkregister = 0;
|
||||
static int sax1 = 0;
|
||||
static const char *output = NULL;
|
||||
static int options = 0;
|
||||
|
||||
/*
|
||||
* Internal timing routines to remove the necessity to have unix-specific
|
||||
@ -804,73 +805,34 @@ static void parseAndPrintFile(char *filename) {
|
||||
}
|
||||
}
|
||||
} else if (testIO) {
|
||||
int ret;
|
||||
FILE *f;
|
||||
|
||||
/* '-' Usually means stdin -<sven@zen.org> */
|
||||
if ((filename[0] == '-') && (filename[1] == 0)) {
|
||||
f = stdin;
|
||||
doc = xmlReadFd(0, NULL, options);
|
||||
} else {
|
||||
f = fopen(filename, "r");
|
||||
}
|
||||
if (f != NULL) {
|
||||
xmlParserCtxtPtr ctxt;
|
||||
FILE *f;
|
||||
|
||||
ctxt = xmlCreateIOParserCtxt(NULL, NULL,
|
||||
(xmlInputReadCallback) myRead,
|
||||
(xmlInputCloseCallback) myClose,
|
||||
f, XML_CHAR_ENCODING_NONE);
|
||||
xmlParseDocument(ctxt);
|
||||
|
||||
ret = ctxt->wellFormed;
|
||||
doc = ctxt->myDoc;
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
if (!ret) {
|
||||
xmlFreeDoc(doc);
|
||||
f = fopen(filename, "r");
|
||||
if (f != NULL)
|
||||
doc = xmlReadIO((xmlInputReadCallback) myRead,
|
||||
(xmlInputCloseCallback) myClose, f,
|
||||
NULL, options);
|
||||
else
|
||||
doc = NULL;
|
||||
}
|
||||
}
|
||||
} else if (recovery) {
|
||||
doc = xmlRecoverFile(filename);
|
||||
} else if (htmlout) {
|
||||
int ret;
|
||||
xmlParserCtxtPtr ctxt;
|
||||
xmlSAXHandler silent, *old;
|
||||
|
||||
ctxt = xmlCreateFileParserCtxt(filename);
|
||||
|
||||
ctxt = xmlNewParserCtxt();
|
||||
if (ctxt == NULL) {
|
||||
/* If xmlCreateFileParserCtxt() return NULL something
|
||||
strange happened so we don't want to do anything. Do
|
||||
we want to print an error message here?
|
||||
<sven@zen.org> */
|
||||
doc = NULL;
|
||||
doc = NULL;
|
||||
} else {
|
||||
memcpy(&silent, ctxt->sax, sizeof(silent));
|
||||
old = ctxt->sax;
|
||||
silent.error = xmlHTMLError;
|
||||
if (xmlGetWarningsDefaultValue)
|
||||
silent.warning = xmlHTMLWarning;
|
||||
else
|
||||
silent.warning = NULL;
|
||||
silent.fatalError = xmlHTMLError;
|
||||
ctxt->sax = &silent;
|
||||
ctxt->vctxt.error = xmlHTMLValidityError;
|
||||
if (xmlGetWarningsDefaultValue)
|
||||
ctxt->vctxt.warning = xmlHTMLValidityWarning;
|
||||
else
|
||||
ctxt->vctxt.warning = NULL;
|
||||
ctxt->sax->error = xmlHTMLError;
|
||||
ctxt->sax->warning = xmlHTMLWarning;
|
||||
ctxt->vctxt.error = xmlHTMLValidityError;
|
||||
ctxt->vctxt.warning = xmlHTMLValidityWarning;
|
||||
|
||||
xmlParseDocument(ctxt);
|
||||
doc = xmlCtxtReadFile(ctxt, filename, NULL, options);
|
||||
|
||||
ret = ctxt->wellFormed;
|
||||
doc = ctxt->myDoc;
|
||||
ctxt->sax = old;
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
if (!ret) {
|
||||
xmlFreeDoc(doc);
|
||||
doc = NULL;
|
||||
}
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
}
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
} else if (memory) {
|
||||
@ -885,31 +847,24 @@ static void parseAndPrintFile(char *filename) {
|
||||
if (base == (void *) MAP_FAILED)
|
||||
return;
|
||||
|
||||
doc = xmlParseMemory((char *) base, info.st_size);
|
||||
doc = xmlReadMemory((char *) base, info.st_size, NULL, options);
|
||||
munmap((char *) base, info.st_size);
|
||||
#endif
|
||||
} else if (valid) {
|
||||
int ret;
|
||||
xmlParserCtxtPtr ctxt;
|
||||
|
||||
ctxt = xmlCreateFileParserCtxt(filename);
|
||||
|
||||
ctxt = xmlNewParserCtxt();
|
||||
if (ctxt == NULL) {
|
||||
doc = NULL;
|
||||
doc = NULL;
|
||||
} else {
|
||||
xmlParseDocument(ctxt);
|
||||
if (ctxt->valid == 0)
|
||||
progresult = 4;
|
||||
ret = ctxt->wellFormed;
|
||||
doc = ctxt->myDoc;
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
if (!ret) {
|
||||
xmlFreeDoc(doc);
|
||||
doc = NULL;
|
||||
}
|
||||
doc = xmlCtxtReadFile(ctxt, filename, NULL, options);
|
||||
|
||||
if (ctxt->valid == 0)
|
||||
progresult = 4;
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
}
|
||||
} else {
|
||||
doc = xmlParseFile(filename);
|
||||
doc = xmlReadFile(filename, NULL, options);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1385,12 +1340,14 @@ main(int argc, char **argv) {
|
||||
if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
|
||||
copy++;
|
||||
else if ((!strcmp(argv[i], "-recover")) ||
|
||||
(!strcmp(argv[i], "--recover")))
|
||||
(!strcmp(argv[i], "--recover"))) {
|
||||
recovery++;
|
||||
else if ((!strcmp(argv[i], "-noent")) ||
|
||||
(!strcmp(argv[i], "--noent")))
|
||||
options |= XML_PARSE_RECOVER;
|
||||
} else if ((!strcmp(argv[i], "-noent")) ||
|
||||
(!strcmp(argv[i], "--noent"))) {
|
||||
noent++;
|
||||
else if ((!strcmp(argv[i], "-version")) ||
|
||||
options |= XML_PARSE_NOENT;
|
||||
} else if ((!strcmp(argv[i], "-version")) ||
|
||||
(!strcmp(argv[i], "--version"))) {
|
||||
showVersion(argv[0]);
|
||||
version = 1;
|
||||
@ -1416,16 +1373,19 @@ main(int argc, char **argv) {
|
||||
(!strcmp(argv[i], "--nowrap")))
|
||||
nowrap++;
|
||||
else if ((!strcmp(argv[i], "-loaddtd")) ||
|
||||
(!strcmp(argv[i], "--loaddtd")))
|
||||
(!strcmp(argv[i], "--loaddtd"))) {
|
||||
loaddtd++;
|
||||
else if ((!strcmp(argv[i], "-dtdattr")) ||
|
||||
options |= XML_PARSE_DTDLOAD;
|
||||
} else if ((!strcmp(argv[i], "-dtdattr")) ||
|
||||
(!strcmp(argv[i], "--dtdattr"))) {
|
||||
loaddtd++;
|
||||
dtdattrs++;
|
||||
options |= XML_PARSE_DTDATTR;
|
||||
} else if ((!strcmp(argv[i], "-valid")) ||
|
||||
(!strcmp(argv[i], "--valid")))
|
||||
(!strcmp(argv[i], "--valid"))) {
|
||||
valid++;
|
||||
else if ((!strcmp(argv[i], "-postvalid")) ||
|
||||
options |= XML_PARSE_DTDVALID;
|
||||
} else if ((!strcmp(argv[i], "-postvalid")) ||
|
||||
(!strcmp(argv[i], "--postvalid"))) {
|
||||
postvalid++;
|
||||
loaddtd++;
|
||||
@ -1471,8 +1431,10 @@ main(int argc, char **argv) {
|
||||
testIO++;
|
||||
#ifdef LIBXML_XINCLUDE_ENABLED
|
||||
else if ((!strcmp(argv[i], "-xinclude")) ||
|
||||
(!strcmp(argv[i], "--xinclude")))
|
||||
(!strcmp(argv[i], "--xinclude"))) {
|
||||
xinclude++;
|
||||
/* options |= XML_PARSE_XINCLUDE; */
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_ZLIB_H
|
||||
else if ((!strcmp(argv[i], "-compress")) ||
|
||||
@ -1485,11 +1447,13 @@ main(int argc, char **argv) {
|
||||
(!strcmp(argv[i], "--nowarning"))) {
|
||||
xmlGetWarningsDefaultValue = 0;
|
||||
xmlPedanticParserDefault(0);
|
||||
options |= XML_PARSE_NOWARNING;
|
||||
}
|
||||
else if ((!strcmp(argv[i], "-pedantic")) ||
|
||||
(!strcmp(argv[i], "--pedantic"))) {
|
||||
xmlGetWarningsDefaultValue = 1;
|
||||
xmlPedanticParserDefault(1);
|
||||
options |= XML_PARSE_PEDANTIC;
|
||||
}
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
else if ((!strcmp(argv[i], "-debugent")) ||
|
||||
@ -1544,6 +1508,7 @@ main(int argc, char **argv) {
|
||||
i++;
|
||||
relaxng = argv[i];
|
||||
noent++;
|
||||
options |= XML_PARSE_NOENT;
|
||||
} else if ((!strcmp(argv[i], "-schema")) ||
|
||||
(!strcmp(argv[i], "--schema"))) {
|
||||
i++;
|
||||
@ -1617,6 +1582,7 @@ main(int argc, char **argv) {
|
||||
|
||||
/* forces loading the DTDs */
|
||||
xmlLoadExtDtdDefaultValue |= 1;
|
||||
options |= XML_PARSE_DTDLOAD;
|
||||
if (timing) {
|
||||
startTimer();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user