* @param array $options list of additional parsing options:
* processing_instruction_handler: Callback for xml_set_processing_instruction_handler
*/
* @param array $options list of additional parsing options:
* processing_instruction_handler: Callback for xml_set_processing_instruction_handler
*/
- function __construct( $input, $filterCallback = null, $isFile = true, $options = array() ) {
+ function __construct( $input, $filterCallback = null, $isFile = true, $options = [] ) {
$this->filterCallback = $filterCallback;
$this->parserOptions = array_merge( $this->parserOptions, $options );
$this->validateFromInput( $input, $isFile );
$this->filterCallback = $filterCallback;
$this->parserOptions = array_merge( $this->parserOptions, $options );
$this->validateFromInput( $input, $isFile );
// First, move through anything that isn't an element, and
// handle any processing instructions with the callback
do {
// First, move through anything that isn't an element, and
// handle any processing instructions with the callback
do {
while ( $r->moveToNextAttribute() ) {
if ( $r->namespaceURI === 'http://www.w3.org/2000/xmlns/' ) {
// XMLReader treats xmlns attributes as normal
while ( $r->moveToNextAttribute() ) {
if ( $r->namespaceURI === 'http://www.w3.org/2000/xmlns/' ) {
// XMLReader treats xmlns attributes as normal
list( $name, $attribs ) = array_pop( $this->elementDataContext );
$data = array_pop( $this->elementData );
$this->stackDepth--;
list( $name, $attribs ) = array_pop( $this->elementDataContext );
$data = array_pop( $this->elementData );
$this->stackDepth--;