Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Comparing nodes in LibXML

by tangent (Parson)
on Sep 03, 2015 at 02:05 UTC ( [id://1140851]=note: print w/replies, xml ) Need Help??


in reply to Re: Comparing nodes in LibXML
in thread Comparing nodes in LibXML

my $nn1 = $c1->localname(); my $nn2 = $c2->localname(); print "\$nn1 $nn1\n\$nn2 $nn2\n\n"; Output: $nn1 Authors $nn2 Authors

Replies are listed 'Best First'.
Re^3: Comparing nodes in LibXML
by worik (Sexton) on Sep 03, 2015 at 02:56 UTC

    localname is helpful. I missed it in the documentation. But it is only half the picture as it strips namespace information. Evven though it seems that namespaces are an abomination in XML I need to account for them. I am not generating the XML I have to eat.

      You can get the prefix at the same time
      my ($prefix,$name) = ( $node->prefix(), $node->localname() );

        The prefix does not help as it is not unique

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1140851]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-23 07:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found