WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP XML Parser Functions


PHP XML Parser Introduction

The XML capacities gives you a chance to parse, yet not approve, XML documents.

XML is an information position for institutionalized organized record trade. More data on XML can be found in our XML Tutorial.

This augmentation utilizes the Expat XML parser.

Expat is an occasion based parser, it sees a XML record as a progression of occasions. At the point when an occasion happens, it calls a predetermined capacity to deal with it.

Expat is a non-approving parser, and overlooks any DTDs connected to a report. Be that as it may, if the archive isn't all around framed it will finish with a blunder message.

Because it is an occasion based, non approving parser, Expat is quick and well appropriate for web applications.

The XML parser capacities gives you a chance to make XML parsers and characterize handlers for XML events.


Installation

The XML capacities are a piece of the PHP center. There is no establishment expected to utilize these functions.


PHP XML Parser Functions

PHP: demonstrates the most punctual variant of PHP that bolsters the function.

Function Description PHP
utf8_decode() Decodes an UTF-8 string to ISO-8859-1 3
utf8_encode() Encodes an ISO-8859-1 string to UTF-8 3
xml_error_string() Gets a blunder string from the XML parser 3
xml_get_current_byte_index() Gets the present byte list from the XML parser 3
xml_get_current_column_number() Gets the present section number from the XML parser 3
xml_get_current_line_number() Gets the present line number from the XML parser 3
xml_get_error_code() Gets a blunder code from the XML parser 3
xml_parse() Parses a XML document 3
xml_parse_into_struct() Parse XML information into an array 3
xml_parser_create_ns() Create a XML parser with namespace support 4
xml_parser_create() Create a XML parser 3
xml_parser_free() Free a XML parser 3
xml_parser_get_option() Get alternatives from a XML parser 3
xml_parser_set_option() Set alternatives in a XML parser 3
xml_set_character_data_handler() Set handler work for character data 3
xml_set_default_handler() Set default handler function 3
xml_set_element_handler() Set handler work for begin and end component of elements 3
xml_set_end_namespace_decl_handler() Set handler work for the finish of namespace declarations 4
xml_set_external_entity_ref_handler() Set handler work for outer entities 3
xml_set_notation_decl_handler() Set handler work for documentation declarations 3
xml_set_object() Use XML Parser inside an object 4
xml_set_processing_instruction_handler() Set handler work for preparing instruction 3
xml_set_start_namespace_decl_handler() Set handler work for the beginning of namespace declarations 4
xml_set_unparsed_entity_decl_handler() Set handler work for unparsed substance declarations 3

PHP XML Parser Constants

Constant
XML_ERROR_NONE (integer)
XML_ERROR_NO_MEMORY (integer)
XML_ERROR_SYNTAX (integer)
XML_ERROR_NO_ELEMENTS (integer)
XML_ERROR_INVALID_TOKEN (integer)
XML_ERROR_UNCLOSED_TOKEN (integer)
XML_ERROR_PARTIAL_CHAR (integer)
XML_ERROR_TAG_MISMATCH (integer)
XML_ERROR_DUPLICATE_ATTRIBUTE (integer)
XML_ERROR_JUNK_AFTER_DOC_ELEMENT (integer)
XML_ERROR_PARAM_ENTITY_REF (integer)
XML_ERROR_UNDEFINED_ENTITY (integer)
XML_ERROR_RECURSIVE_ENTITY_REF (integer)
XML_ERROR_ASYNC_ENTITY (integer)
XML_ERROR_BAD_CHAR_REF (integer)
XML_ERROR_BINARY_ENTITY_REF (integer)
XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF (integer)
XML_ERROR_MISPLACED_XML_PI (integer)
XML_ERROR_UNKNOWN_ENCODING (integer)
XML_ERROR_INCORRECT_ENCODING (integer)
XML_ERROR_UNCLOSED_CDATA_SECTION (integer)
XML_ERROR_EXTERNAL_ENTITY_HANDLING (integer)
XML_OPTION_CASE_FOLDING (integer)
XML_OPTION_TARGET_ENCODING (integer)
XML_OPTION_SKIP_TAGSTART (integer)
XML_OPTION_SKIP_WHITE (integer)