Lines Matching refs:parser
36 _qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI, xmlChar **qualified) in _qualify_namespace() argument
41 *qualified = xmlStrncat(*qualified, parser->_ns_separator, 1); in _qualify_namespace()
51 XML_Parser parser = (XML_Parser) user; in _start_element_handler() local
54 if (parser->h_start_element == NULL) { in _start_element_handler()
55 if (parser->h_default) { in _start_element_handler()
75 parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name)); in _start_element_handler()
83 …parser->h_start_element(parser->user, (const XML_Char *) qualified_name, (const XML_Char **) attri… in _start_element_handler()
91 XML_Parser parser = (XML_Parser) user; in _start_element_handler_ns() local
98 if (nb_namespaces > 0 && parser->h_start_ns != NULL) { in _start_element_handler_ns()
100 …parser->h_start_ns(parser->user, (const XML_Char *) namespaces[y], (const XML_Char *) namespaces[y… in _start_element_handler_ns()
106 if (parser->h_start_element == NULL) { in _start_element_handler_ns()
107 if (parser->h_default) { in _start_element_handler_ns()
163 parser->h_default(parser->user, (const XML_Char *) qualified_name, xmlStrlen(qualified_name)); in _start_element_handler_ns()
168 _qualify_namespace(parser, name, URI, &qualified_name); in _start_element_handler_ns()
177 _qualify_namespace(parser, attributes[y] , attributes[y + 2], &qualified_name_attr); in _start_element_handler_ns()
189 …parser->h_start_element(parser->user, (const XML_Char *) qualified_name, (const XML_Char **) attrs… in _start_element_handler_ns()
203 XML_Parser parser = (XML_Parser) user; in _end_element_handler() local
205 if (parser->h_end_element == NULL) { in _end_element_handler()
206 if (parser->h_default) { in _end_element_handler()
210 parser->h_default(parser->user, (const XML_Char *) end_element, strlen(end_element)); in _end_element_handler()
218 parser->h_end_element(parser->user, (const XML_Char *) qualified_name); in _end_element_handler()
227 XML_Parser parser = (XML_Parser) user; in _end_element_handler_ns() local
229 if (parser->h_end_element == NULL) { in _end_element_handler_ns()
230 if (parser->h_default) { in _end_element_handler_ns()
239 parser->h_default(parser->user, (const XML_Char *) end_element, end_element_len); in _end_element_handler_ns()
245 _qualify_namespace(parser, name, URI, &qualified_name); in _end_element_handler_ns()
247 parser->h_end_element(parser->user, (const XML_Char *) qualified_name); in _end_element_handler_ns()
255 XML_Parser parser = (XML_Parser) user; in _cdata_handler() local
257 if (parser->h_cdata == NULL) { in _cdata_handler()
258 if (parser->h_default) { in _cdata_handler()
259 parser->h_default(parser->user, (const XML_Char *) cdata, cdata_len); in _cdata_handler()
264 parser->h_cdata(parser->user, (const XML_Char *) cdata, cdata_len); in _cdata_handler()
270 XML_Parser parser = (XML_Parser) user; in _pi_handler() local
272 if (parser->h_pi == NULL) { in _pi_handler()
273 if (parser->h_default) { in _pi_handler()
276 parser->h_default(parser->user, (const XML_Char *) full_pi, strlen(full_pi)); in _pi_handler()
282 parser->h_pi(parser->user, (const XML_Char *) target, (const XML_Char *) data); in _pi_handler()
292 XML_Parser parser = (XML_Parser) user; in _unparsed_entity_decl_handler() local
294 if (parser->h_unparsed_entity_decl == NULL) { in _unparsed_entity_decl_handler()
298 parser->h_unparsed_entity_decl(parser->user, name, NULL, sys_id, pub_id, notation); in _unparsed_entity_decl_handler()
304 XML_Parser parser = (XML_Parser) user; in _notation_decl_handler() local
306 if (parser->h_notation_decl == NULL) { in _notation_decl_handler()
310 parser->h_notation_decl(parser->user, notation, NULL, sys_id, pub_id); in _notation_decl_handler()
329 XML_Parser parser = (XML_Parser) user; in _comment_handler() local
331 if (parser->h_default) { in _comment_handler()
336 parser->h_default(parser->user, d_comment, d_comment_len); in _comment_handler()
355 XML_Parser parser = (XML_Parser) user; in _external_entity_ref_handler() local
357 if (parser->h_external_entity_ref == NULL) { in _external_entity_ref_handler()
361 if (!parser->h_external_entity_ref(parser, names, (XML_Char *) "", sys_id, pub_id)) { in _external_entity_ref_handler()
362 xmlStopParser(parser->parser); in _external_entity_ref_handler()
363 parser->parser->errNo = XML_ERROR_EXTERNAL_ENTITY_HANDLING; in _external_entity_ref_handler()
370 XML_Parser parser = (XML_Parser) user; in _get_entity() local
373 if (parser->parser->inSubset == 0) { in _get_entity()
376 ret = xmlGetDocEntity(parser->parser->myDoc, name); in _get_entity()
378 if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) { in _get_entity()
381 …if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata… in _get_entity()
386 parser->h_default(parser->user, (const xmlChar *) entity, len); in _get_entity()
391 if (parser->h_cdata && ret) { in _get_entity()
392 parser->h_cdata(parser->user, ret->content, xmlStrlen(ret->content)); in _get_entity()
460 XML_Parser parser; in XML_ParserCreate_MM() local
462 parser = (XML_Parser) emalloc(sizeof(struct _XML_Parser)); in XML_ParserCreate_MM()
463 memset(parser, 0, sizeof(struct _XML_Parser)); in XML_ParserCreate_MM()
464 parser->use_namespace = 0; in XML_ParserCreate_MM()
465 parser->_ns_separator = NULL; in XML_ParserCreate_MM()
467 …parser->parser = xmlCreatePushParserCtxt((xmlSAXHandlerPtr) &php_xml_compat_handlers, (void *) par… in XML_ParserCreate_MM()
468 if (parser->parser == NULL) { in XML_ParserCreate_MM()
469 efree(parser); in XML_ParserCreate_MM()
473 php_libxml_sanitize_parse_ctxt_options(parser->parser); in XML_ParserCreate_MM()
474 xmlCtxtUseOptions(parser->parser, XML_PARSE_OLDSAX | XML_PARSE_NOENT); in XML_ParserCreate_MM()
476 parser->parser->wellFormed = 0; in XML_ParserCreate_MM()
479 ZEND_ASSERT(parser->parser->sax->initialized == XML_SAX2_MAGIC); in XML_ParserCreate_MM()
480 parser->use_namespace = 1; in XML_ParserCreate_MM()
481 parser->_ns_separator = xmlStrdup(sep); in XML_ParserCreate_MM()
485 parser->parser->sax->initialized = 1; in XML_ParserCreate_MM()
487 return parser; in XML_ParserCreate_MM()
491 XML_SetUserData(XML_Parser parser, void *user) in XML_SetUserData() argument
493 parser->user = user; in XML_SetUserData()
497 XML_GetUserData(XML_Parser parser) in XML_GetUserData() argument
499 return parser->user; in XML_GetUserData()
503 XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end) in XML_SetElementHandler() argument
505 parser->h_start_element = start; in XML_SetElementHandler()
506 parser->h_end_element = end; in XML_SetElementHandler()
510 XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler cdata) in XML_SetCharacterDataHandler() argument
512 parser->h_cdata = cdata; in XML_SetCharacterDataHandler()
516 XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler pi) in XML_SetProcessingInstructionHandler() argument
518 parser->h_pi = pi; in XML_SetProcessingInstructionHandler()
522 XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler comment) in XML_SetCommentHandler() argument
524 parser->h_comment = comment; in XML_SetCommentHandler()
528 XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler d) in XML_SetDefaultHandler() argument
530 parser->h_default = d; in XML_SetDefaultHandler()
534 XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler unparsed_decl) in XML_SetUnparsedEntityDeclHandler() argument
536 parser->h_unparsed_entity_decl = unparsed_decl; in XML_SetUnparsedEntityDeclHandler()
540 XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler notation_decl) in XML_SetNotationDeclHandler() argument
542 parser->h_notation_decl = notation_decl; in XML_SetNotationDeclHandler()
546 XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler ext_entity) in XML_SetExternalEntityRefHandler() argument
548 parser->h_external_entity_ref = ext_entity; in XML_SetExternalEntityRefHandler()
552 XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start_ns) in XML_SetStartNamespaceDeclHandler() argument
554 parser->h_start_ns = start_ns; in XML_SetStartNamespaceDeclHandler()
558 XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end_ns) in XML_SetEndNamespaceDeclHandler() argument
560 parser->h_end_ns = end_ns; in XML_SetEndNamespaceDeclHandler()
564 XML_Parse(XML_Parser parser, const XML_Char *data, int data_len, int is_final) in XML_Parse() argument
566 int error = xmlParseChunk(parser->parser, (char *) data, data_len, is_final); in XML_Parse()
569 const xmlError *error_data = xmlCtxtGetLastError(parser->parser); in XML_Parse()
577 XML_GetErrorCode(XML_Parser parser) in XML_GetErrorCode() argument
579 return parser->parser->errNo; in XML_GetErrorCode()
698 XML_GetCurrentLineNumber(XML_Parser parser) in XML_GetCurrentLineNumber() argument
700 return parser->parser->input->line; in XML_GetCurrentLineNumber()
704 XML_GetCurrentColumnNumber(XML_Parser parser) in XML_GetCurrentColumnNumber() argument
706 return parser->parser->input->col; in XML_GetCurrentColumnNumber()
710 XML_GetCurrentByteIndex(XML_Parser parser) in XML_GetCurrentByteIndex() argument
716 xmlParserInputPtr input = parser->parser->input; in XML_GetCurrentByteIndex()
721 long result = xmlByteConsumed(parser->parser); in XML_GetCurrentByteIndex()
730 XML_GetCurrentByteCount(XML_Parser parser) in XML_GetCurrentByteCount() argument
734 return XML_GetCurrentByteIndex(parser); in XML_GetCurrentByteCount()
743 XML_ParserFree(XML_Parser parser) in XML_ParserFree() argument
745 if (parser->use_namespace) { in XML_ParserFree()
746 if (parser->_ns_separator) { in XML_ParserFree()
747 xmlFree(parser->_ns_separator); in XML_ParserFree()
750 if (parser->parser->myDoc) { in XML_ParserFree()
751 xmlFreeDoc(parser->parser->myDoc); in XML_ParserFree()
752 parser->parser->myDoc = NULL; in XML_ParserFree()
754 xmlFreeParserCtxt(parser->parser); in XML_ParserFree()
755 efree(parser); in XML_ParserFree()