Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Not able to register namespace in XML::LibXML on Linux. (or die)

by Anonymous Monk
on Jul 15, 2013 at 10:14 UTC ( [id://1044345]=note: print w/replies, xml ) Need Help??


in reply to Re: Not able to register namespace in XML::LibXML on Linux. (or die)
in thread Not able to register namespace in XML::LibXML on Linux.

Why registerNs when you don't have to?
#!/usr/bin/perl -- use strict; use warnings; use XML::LibXML; use Data::Dump qw/ dd pp /; Main( @ARGV ); exit( 0 ); sub Main { my $dom = XML::LibXML->new( qw/ recover 2 / )->load_xml( location => shift || q{ravi06-05.xml}, ); print $_->nodePath,"\n" for $dom->findnodes(q{//@xlink:href}); print $_->nodePath,"\n" for $dom->findnodes(q{//book:locator/@xlin +k:href}); } __END__ /book:bookResource/book:book/book:chapter/book:locator[1]/@xlink:href /book:bookResource/book:book/book:chapter/book:locator[2]/@xlink:href /book:bookResource/book:book/book:chapter/book:locator[3]/@xlink:href /book:bookResource/book:book/book:chapter/book:meta/book:author/book:a +ffiliation/@xlink:href /book:bookResource/book:book/book:chapter/book:meta/book:affiliation/b +ook:locator/@xlink:href /book:bookResource/book:book/book:chapter/book:locator[1]/@xlink:href /book:bookResource/book:book/book:chapter/book:locator[2]/@xlink:href /book:bookResource/book:book/book:chapter/book:locator[3]/@xlink:href /book:bookResource/book:book/book:chapter/book:meta/book:affiliation/b +ook:locator/@xlink:href
  • Comment on Re^2: Not able to register namespace in XML::LibXML on Linux. (or die)
  • Download Code

Replies are listed 'Best First'.
Re^3: Not able to register namespace in XML::LibXML on Linux. (or die)
by ravi06 (Novice) on Jul 15, 2013 at 10:31 UTC
    Hi, we don't have Data::Dump. We can't use predicates("book:locator1") either.

      Hi, we don't have Data::Dump

      And then what happened?

      We can't use predicates("book:locator1") either.

      And I just showed that you can. I have

      $ perl -MData::Dump -MXML::LibXML -e " dd[ XML::LibXML->VERSION, XML:: +LibXML::LIBXML_DOTTED_VERSION ]" [2.0014, "2.9.0"]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-26 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found