Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Commit 8c0dcdc

Browse files
committed
Introduce XMLStackOfOpenElements
1 parent 8514222 commit 8c0dcdc

File tree

7 files changed

+612
-224
lines changed

7 files changed

+612
-224
lines changed

components/DataLiberation/EntityReader/EPubEntityReader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private function parse_manifest() {
141141
return false;
142142
}
143143

144-
$full_path = $xml->get_attribute_by_qualified_name( 'full-path' );
144+
$full_path = $xml->get_attribute( 'full-path' );
145145
if ( ! $full_path ) {
146146
return false;
147147
}
@@ -163,11 +163,11 @@ private function parse_manifest() {
163163
$parsed_entry = array();
164164
$keys = $xml->get_attribute_qualified_names_with_prefix( '' );
165165
foreach ( $keys as $key ) {
166-
$parsed_entry[ $key ] = $xml->get_attribute_by_qualified_name( $key );
166+
$parsed_entry[ $key ] = $xml->get_attribute( $key );
167167
}
168168
if ( $xml->matches_breadcrumbs( array( 'metadata', '*' ) ) ) {
169169
$parsed['metadata'][] = array(
170-
'tag' => $xml->get_qualified_tag(),
170+
'tag' => $xml->get_local_tag_name(),
171171
'attributes' => $parsed_entry,
172172
);
173173
} elseif ( $xml->matches_breadcrumbs( array( 'manifest', 'item' ) ) ) {

components/DataLiberation/EntityReader/WXREntityReader.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ private function read_next_entity() {
659659
$this->last_xml_cursor_outside_of_entity = $this->xml->get_reentrancy_cursor();
660660
}
661661

662-
$tag = $this->xml->get_qualified_tag();
662+
$tag = $this->xml->get_local_tag_name();
663663
/**
664664
* Custom adjustment: the Accessibility WXR file uses a non-standard
665665
* wp:wp_author tag.
@@ -734,14 +734,14 @@ private function read_next_entity() {
734734
$this->last_opener_attributes = array();
735735
$names = $this->xml->get_attribute_qualified_names_with_prefix( '' );
736736
foreach ( $names as $name ) {
737-
$this->last_opener_attributes[ $name ] = $this->xml->get_attribute_by_qualified_name( $name );
737+
$this->last_opener_attributes[ $name ] = $this->xml->get_attribute( $name );
738738
}
739739
$this->text_buffer = '';
740740

741741
$is_site_option_opener = (
742742
count( $this->xml->get_breadcrumbs() ) === 3 &&
743743
$this->xml->matches_breadcrumbs( array( 'rss', 'channel', '*' ) ) &&
744-
array_key_exists( $this->xml->get_qualified_tag(), static::KNOWN_SITE_OPTIONS )
744+
array_key_exists( $this->xml->get_local_tag_name(), static::KNOWN_SITE_OPTIONS )
745745
);
746746
if ( $is_site_option_opener ) {
747747
$this->last_xml_byte_offset_outside_of_entity = $this->xml->get_token_byte_offset_in_the_input_stream();
@@ -848,13 +848,13 @@ private function read_next_entity() {
848848
* @return bool Whether a site_option entity was emitted.
849849
*/
850850
private function parse_site_option() {
851-
if ( ! array_key_exists( $this->xml->get_qualified_tag(), static::KNOWN_SITE_OPTIONS ) ) {
851+
if ( ! array_key_exists( $this->xml->get_local_tag_name(), static::KNOWN_SITE_OPTIONS ) ) {
852852
return false;
853853
}
854854

855855
$this->entity_type = 'site_option';
856856
$this->entity_data = array(
857-
'option_name' => static::KNOWN_SITE_OPTIONS[ $this->xml->get_qualified_tag() ],
857+
'option_name' => static::KNOWN_SITE_OPTIONS[ $this->xml->get_local_tag_name() ],
858858
'option_value' => $this->text_buffer,
859859
);
860860
$this->emit_entity();

0 commit comments

Comments
 (0)