| 
    Moodle PHP Documentation 4.1
    
   Moodle 4.1dev (Build: 20220512) (5e5e12e0) 
   | 
 
Class for parsing xml files. More...
Public Member Functions | |
| parse ($data, $whitespace=1, $encoding='UTF-8', $reporterrors=false) | |
| Parses XML string.  More... | |
Class for parsing xml files.
Handles functionality for:
Import of xml files in questionbank and course import. Can handle xml files larger than 10MB through chunking the input file. Uses a similar interface to the original version xmlize() by Hans Anderson.
@subpackage lib
| core_xml_parser::parse | ( | $data, | |
$whitespace = 1,  | 
        |||
$encoding = 'UTF-8',  | 
        |||
$reporterrors = false  | 
        |||
| ) | 
Parses XML string.
Note: Interface is kept equal to previous version.
| string | $data | the XML source to parse. | 
| int | $whitespace | If set to 1 allows the parser to skip "space" characters in xml document. Default is 1 | 
| string | $encoding | Specify an OUTPUT encoding. If not specified, it defaults to UTF-8. | 
| bool | $reporterrors | if set to true, then a xml_format_exception exception will be thrown if the XML is not well-formed. Otherwise errors are ignored. | 
| array | representation of the parsed XML. |