CIII. XML parser functions

Introduction

Installation




A source RPM package of expat can be found at http://sourceforge.net/projects/expat/ .

Note that if you are using Apache-1.3.7 or later , you already have the required expat library . Simply configure PHP using --with-xml ( without any additional path ) and it will automatically use the expat library built into Apache .

On UNIX , run configure with the --with-xml option . The expat library should be installed somewhere your compiler can find it . You may need to set CPPFLAGS and LDFLAGS in your environment before running configure if you have installed expat somewhere exotic .

Build PHP . Tada ! That should be it .

About This Extension

טבלה 1 .

PHP programmers should be familiar with processing instructions ( PIs ) already . ?php ? is a processing instruction , where php PHP programmers should be familiar with processing instructions (PIs ) already . ?php ? is a processing instruction , where php is called the "PI target " .


Some Examples

XML Tag Mapping Example

דוגמה 2 .








XML External Entity Example

דוגמה 3 .










דוגמה 4 . xmltest.xml










דוגמה 5 . xmltest2.xml






תוכן העניינים:
utf8_decode -- Converts a string with ISO-8859-1 characters encoded with UTF-8 to single-byte ISO-8859-1.
utf8_encode -- encodes an ISO-8859-1 string to UTF-8
xml_error_string -- get XML parser error string
xml_get_current_byte_index -- get current byte index for an XML parser
xml_get_current_column_number -- Get current column number for an XML parser
xml_get_current_line_number -- get current line number for an XML parser
xml_get_error_code -- get XML parser error code
xml_parse -- start parsing an XML document
xml_parse_into_struct -- Parse XML data into an array structure
xml_parser_create -- create an XML parser
xml_parser_create_ns -- Create an XML parser
xml_parser_free -- Free an XML parser
xml_parser_get_option -- get options from an XML parser
xml_parser_set_option -- set options in an XML parser
xml_set_character_data_handler -- set up character data handler
xml_set_default_handler -- set up default handler
xml_set_element_handler -- set up start and end element handlers
xml_set_end_namespace_decl_handler -- Set up character data handler
xml_set_external_entity_ref_handler -- set up external entity reference handler
xml_set_notation_decl_handler -- set up notation declaration handler
xml_set_object -- Use XML Parser within an object
xml_set_processing_instruction_handler -- Set up processing instruction (PI) handler
xml_set_start_namespace_decl_handler -- Set up character data handler
xml_set_unparsed_entity_decl_handler -- Set up unparsed entity declaration handler