Lines Matching refs:parser
25 qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI, xmlChar **qualified) in qualify_namespace() argument
30 *qualified = xmlStrncat(*qualified, parser->_ns_separator, 1); in qualify_namespace()
40 XML_Parser parser = (XML_Parser) user; in start_element_handler() local
43 if (parser->h_start_element == NULL) { in start_element_handler()
44 if (parser->h_default) { in start_element_handler()
64 parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name)); in start_element_handler()
70 parser->h_start_element(parser->user, name, (const XML_Char **) attributes); in start_element_handler()
76 XML_Parser parser = (XML_Parser) user; in start_element_handler_ns() local
83 if (nb_namespaces > 0 && parser->h_start_ns != NULL) { in start_element_handler_ns()
85 …parser->h_start_ns(parser->user, (const XML_Char *) namespaces[y], (const XML_Char *) namespaces[y… in start_element_handler_ns()
91 if (parser->h_start_element == NULL) { in start_element_handler_ns()
92 if (parser->h_default) { in start_element_handler_ns()
148 parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name)); in start_element_handler_ns()
153 qualify_namespace(parser, name, URI, &qualified_name); in start_element_handler_ns()
162 qualify_namespace(parser, attributes[y] , attributes[y + 2], &qualified_name_attr); in start_element_handler_ns()
174 …parser->h_start_element(parser->user, (const XML_Char *) qualified_name, (const XML_Char **) attrs… in start_element_handler_ns()
187 XML_Parser parser = (XML_Parser) user; in end_element_handler() local
189 if (parser->h_end_element == NULL) { in end_element_handler()
190 if (parser->h_default) { in end_element_handler()
194 parser->h_default(parser->user, (const XML_Char *) end_element, strlen(end_element)); in end_element_handler()
200 parser->h_end_element(parser->user, (const XML_Char *) name); in end_element_handler()
207 XML_Parser parser = (XML_Parser) user; in end_element_handler_ns() local
209 if (parser->h_end_element == NULL) { in end_element_handler_ns()
210 if (parser->h_default) { in end_element_handler_ns()
219 parser->h_default(parser->user, (const XML_Char *) end_element, end_element_len); in end_element_handler_ns()
225 qualify_namespace(parser, name, URI, &qualified_name); in end_element_handler_ns()
227 parser->h_end_element(parser->user, (const XML_Char *) qualified_name); in end_element_handler_ns()
235 XML_Parser parser = (XML_Parser) user; in cdata_handler() local
237 if (parser->h_cdata == NULL) { in cdata_handler()
238 if (parser->h_default) { in cdata_handler()
239 parser->h_default(parser->user, (const XML_Char *) cdata, cdata_len); in cdata_handler()
244 parser->h_cdata(parser->user, (const XML_Char *) cdata, cdata_len); in cdata_handler()
250 XML_Parser parser = (XML_Parser) user; in pi_handler() local
252 if (parser->h_pi == NULL) { in pi_handler()
253 if (parser->h_default) { in pi_handler()
256 parser->h_default(parser->user, (const XML_Char *) full_pi, strlen(full_pi)); in pi_handler()
262 parser->h_pi(parser->user, (const XML_Char *) target, (const XML_Char *) data); in pi_handler()
272 XML_Parser parser = (XML_Parser) user; in unparsed_entity_decl_handler() local
274 if (parser->h_unparsed_entity_decl == NULL) { in unparsed_entity_decl_handler()
278 parser->h_unparsed_entity_decl(parser->user, name, NULL, sys_id, pub_id, notation); in unparsed_entity_decl_handler()
284 XML_Parser parser = (XML_Parser) user; in notation_decl_handler() local
286 if (parser->h_notation_decl == NULL) { in notation_decl_handler()
290 parser->h_notation_decl(parser->user, notation, NULL, sys_id, pub_id); in notation_decl_handler()
309 XML_Parser parser = (XML_Parser) user; in comment_handler() local
311 if (parser->h_default) { in comment_handler()
316 parser->h_default(parser->user, d_comment, d_comment_len); in comment_handler()
335 XML_Parser parser = (XML_Parser) user; in external_entity_ref_handler() local
337 if (parser->h_external_entity_ref == NULL) { in external_entity_ref_handler()
341 if (!parser->h_external_entity_ref(parser, names, (XML_Char *) "", sys_id, pub_id)) { in external_entity_ref_handler()
342 xmlStopParser(parser->parser); in external_entity_ref_handler()
343 parser->parser->errNo = XML_ERROR_EXTERNAL_ENTITY_HANDLING; in external_entity_ref_handler()
350 XML_Parser parser = (XML_Parser) user; in get_entity() local
353 if (parser->parser->inSubset == 0) { in get_entity()
356 ret = xmlGetDocEntity(parser->parser->myDoc, name); in get_entity()
358 if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) { in get_entity()
361 …if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata… in get_entity()
366 parser->h_default(parser->user, (const xmlChar *) entity, len); in get_entity()
371 if (parser->h_cdata && ret) { in get_entity()
372 parser->h_cdata(parser->user, ret->content, xmlStrlen(ret->content)); in get_entity()
440 XML_Parser parser; in XML_ParserCreate_MM() local
442 parser = emalloc(sizeof(struct XML_Parser_Struct)); in XML_ParserCreate_MM()
443 memset(parser, 0, sizeof(struct XML_Parser_Struct)); in XML_ParserCreate_MM()
444 parser->use_namespace = 0; in XML_ParserCreate_MM()
445 parser->_ns_separator = NULL; in XML_ParserCreate_MM()
447 …parser->parser = xmlCreatePushParserCtxt((xmlSAXHandlerPtr) &php_xml_compat_handlers, (void *) par… in XML_ParserCreate_MM()
448 if (parser->parser == NULL) { in XML_ParserCreate_MM()
449 efree(parser); in XML_ParserCreate_MM()
453 php_libxml_sanitize_parse_ctxt_options(parser->parser); in XML_ParserCreate_MM()
454 xmlCtxtUseOptions(parser->parser, XML_PARSE_OLDSAX | XML_PARSE_NOENT); in XML_ParserCreate_MM()
456 parser->parser->wellFormed = 0; in XML_ParserCreate_MM()
459 ZEND_ASSERT(parser->parser->sax->initialized == XML_SAX2_MAGIC); in XML_ParserCreate_MM()
460 parser->use_namespace = 1; in XML_ParserCreate_MM()
461 parser->_ns_separator = xmlStrdup(sep); in XML_ParserCreate_MM()
465 parser->parser->sax->initialized = 1; in XML_ParserCreate_MM()
467 return parser; in XML_ParserCreate_MM()
471 XML_SetUserData(XML_Parser parser, void *user) in XML_SetUserData() argument
473 parser->user = user; in XML_SetUserData()
477 XML_GetUserData(XML_Parser parser) in XML_GetUserData() argument
479 return parser->user; in XML_GetUserData()
483 XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end) in XML_SetElementHandler() argument
485 parser->h_start_element = start; in XML_SetElementHandler()
486 parser->h_end_element = end; in XML_SetElementHandler()
490 XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler cdata) in XML_SetCharacterDataHandler() argument
492 parser->h_cdata = cdata; in XML_SetCharacterDataHandler()
496 XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler pi) in XML_SetProcessingInstructionHandler() argument
498 parser->h_pi = pi; in XML_SetProcessingInstructionHandler()
502 XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler comment) in XML_SetCommentHandler() argument
504 parser->h_comment = comment; in XML_SetCommentHandler()
508 XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler d) in XML_SetDefaultHandler() argument
510 parser->h_default = d; in XML_SetDefaultHandler()
514 XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler unparsed_decl) in XML_SetUnparsedEntityDeclHandler() argument
516 parser->h_unparsed_entity_decl = unparsed_decl; in XML_SetUnparsedEntityDeclHandler()
520 XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler notation_decl) in XML_SetNotationDeclHandler() argument
522 parser->h_notation_decl = notation_decl; in XML_SetNotationDeclHandler()
526 XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler ext_entity) in XML_SetExternalEntityRefHandler() argument
528 parser->h_external_entity_ref = ext_entity; in XML_SetExternalEntityRefHandler()
532 XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start_ns) in XML_SetStartNamespaceDeclHandler() argument
534 parser->h_start_ns = start_ns; in XML_SetStartNamespaceDeclHandler()
538 XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end_ns) in XML_SetEndNamespaceDeclHandler() argument
540 parser->h_end_ns = end_ns; in XML_SetEndNamespaceDeclHandler()
544 XML_Parse(XML_Parser parser, const XML_Char *data, int data_len, int is_final) in XML_Parse() argument
546 int error = xmlParseChunk(parser->parser, (char *) data, data_len, is_final); in XML_Parse()
549 const xmlError *error_data = xmlCtxtGetLastError(parser->parser); in XML_Parse()
557 XML_GetErrorCode(XML_Parser parser) in XML_GetErrorCode() argument
559 return parser->parser->errNo; in XML_GetErrorCode()
678 XML_GetCurrentLineNumber(XML_Parser parser) in XML_GetCurrentLineNumber() argument
680 return parser->parser->input->line; in XML_GetCurrentLineNumber()
684 XML_GetCurrentColumnNumber(XML_Parser parser) in XML_GetCurrentColumnNumber() argument
686 return parser->parser->input->col; in XML_GetCurrentColumnNumber()
690 XML_GetCurrentByteIndex(XML_Parser parser) in XML_GetCurrentByteIndex() argument
696 xmlParserInputPtr input = parser->parser->input; in XML_GetCurrentByteIndex()
701 long result = xmlByteConsumed(parser->parser); in XML_GetCurrentByteIndex()
709 XML_GetCurrentByteCount(XML_Parser parser) in XML_GetCurrentByteCount() argument
713 return (int) XML_GetCurrentByteIndex(parser); in XML_GetCurrentByteCount()
722 XML_ParserFree(XML_Parser parser) in XML_ParserFree() argument
724 if (parser->use_namespace) { in XML_ParserFree()
725 if (parser->_ns_separator) { in XML_ParserFree()
726 xmlFree(parser->_ns_separator); in XML_ParserFree()
729 if (parser->parser->myDoc) { in XML_ParserFree()
730 xmlFreeDoc(parser->parser->myDoc); in XML_ParserFree()
731 parser->parser->myDoc = NULL; in XML_ParserFree()
733 xmlFreeParserCtxt(parser->parser); in XML_ParserFree()
734 efree(parser); in XML_ParserFree()