File tree Expand file tree Collapse file tree 4 files changed +24
-20
lines changed Expand file tree Collapse file tree 4 files changed +24
-20
lines changed Original file line number Diff line number Diff line change @@ -632,7 +632,7 @@ sub translate_comment_node {
632
632
sub start_tag {
633
633
my ( $self , $node , $name ) = @_ ;
634
634
635
- $name ||= $self -> get_node_name ( $node ) or return ;
635
+ $name ||= $self -> get_qualified_name ( $node ) or return ;
636
636
637
637
my $string = ' <' .$name ;
638
638
@@ -653,7 +653,7 @@ sub start_tag {
653
653
654
654
sub end_tag {
655
655
my $self = shift ;
656
- if (my $name = $_ [1] || $self -> get_node_name ( $_ [0] ) ) {
656
+ if (my $name = $_ [1] || $self -> get_qualified_name ( $_ [0] ) ) {
657
657
return " </$name >" ;
658
658
}
659
659
return ' ' ;
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ sub to_string {
31
31
32
32
sub get_node_name { $_ [1]-> get_name }
33
33
34
+ sub get_qualified_name { $_ [1]-> get_name }
35
+
34
36
sub get_attributes {
35
37
if ( $_ [1]-> can( ' get_attr_names' ) ) {
36
38
return map { ( [ $_ => $_ [1]-> get_attr_value( $_ ) ] )
Original file line number Diff line number Diff line change @@ -19,14 +19,15 @@ sub is_text_node {
19
19
&& !$_ [1]-> isa(' XML::LibXML::Comment' );
20
20
}
21
21
22
- sub get_attributes { return $_ [1]-> attributes }
23
- sub get_text_content { return $_ [1]-> textContent }
24
- sub get_child_nodes { return $_ [1]-> childNodes }
25
- sub get_node_name { return $_ [1]-> localname }
26
- sub is_element_node { return $_ [1]-> isa( ' XML::LibXML::Element' ); }
27
- sub is_comment_node { return $_ [1]-> isa( ' XML::LibXML::Comment' ); }
28
- sub is_pi_node { return $_ [1]-> isa( ' XML::LibXML::PI' ); }
29
- sub is_nodelist { return $_ [1]-> isa( ' XML::LibXML::NodeList' ); }
22
+ sub get_attributes { return $_ [1]-> attributes }
23
+ sub get_text_content { return $_ [1]-> textContent }
24
+ sub get_child_nodes { return $_ [1]-> childNodes }
25
+ sub get_node_name { return $_ [1]-> localname }
26
+ sub get_qualified_name { return $_ [1]-> nodeName }
27
+ sub is_element_node { return $_ [1]-> isa( ' XML::LibXML::Element' ); }
28
+ sub is_comment_node { return $_ [1]-> isa( ' XML::LibXML::Comment' ); }
29
+ sub is_pi_node { return $_ [1]-> isa( ' XML::LibXML::PI' ); }
30
+ sub is_nodelist { return $_ [1]-> isa( ' XML::LibXML::NodeList' ); }
30
31
31
32
sub get_attribute {
32
33
return $_ [1]-> isa( ' XML::LibXML::Namespace' )
Original file line number Diff line number Diff line change @@ -12,15 +12,16 @@ sub get_namespace {
12
12
return $_ [1]-> getNamespace( $prefix )-> getExpanded();
13
13
}
14
14
15
- sub get_attributes { $_ [1]-> getAttributeNodes }
16
- sub get_text_content { $_ [1]-> getData }
17
- sub get_child_nodes { $_ [1]-> getChildNodes }
18
- sub get_node_name { $_ [1]-> getName && $_ [1]-> getLocalName }
19
- sub is_element_node { $_ [1]-> isa( ' XML::XPath::Node::Element' ); }
20
- sub is_text_node { $_ [1]-> isa( ' XML::XPath::Node::Text' ); }
21
- sub is_comment_node { $_ [1]-> isa( ' XML::XPath::Node::Comment' ); }
22
- sub is_pi_node { $_ [1]-> isa( " XML::XPath::Node::PI" ); }
23
- sub is_nodelist { $_ [1]-> isa( ' XML::XPath::NodeSet' ); }
24
- sub get_attribute { $_ [1]-> toString }
15
+ sub get_attributes { $_ [1]-> getAttributeNodes }
16
+ sub get_text_content { $_ [1]-> getData }
17
+ sub get_child_nodes { $_ [1]-> getChildNodes }
18
+ sub get_node_name { $_ [1]-> getName && $_ [1]-> getLocalName }
19
+ sub get_qualified_name { $_ [1]-> getName }
20
+ sub is_element_node { $_ [1]-> isa( ' XML::XPath::Node::Element' ); }
21
+ sub is_text_node { $_ [1]-> isa( ' XML::XPath::Node::Text' ); }
22
+ sub is_comment_node { $_ [1]-> isa( ' XML::XPath::Node::Comment' ); }
23
+ sub is_pi_node { $_ [1]-> isa( " XML::XPath::Node::PI" ); }
24
+ sub is_nodelist { $_ [1]-> isa( ' XML::XPath::NodeSet' ); }
25
+ sub get_attribute { $_ [1]-> toString }
25
26
26
27
1;
You can’t perform that action at this time.
0 commit comments