Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: LibXML, Namespaces, xpath expression - This should be simple.

by ikegami (Pope)
on Sep 03, 2011 at 16:02 UTC ( #924007=note: print w/ replies, xml ) Need Help??


in reply to Re: LibXML, Namespaces, xpath expression - This should be simple.
in thread LibXML, Namespaces, xpath expression - This should be simple.

Creating a new xpc for every findnodes is not the way to go.

my $inner_xpc = XML::LibXML::XPathContext->new($nodeybits); $inner_xpc->registerNs( theNS => 'http://www.wow.com/BlahML'); $inner_xpc->findnodes(...)

can be written as

$xpc->findnodes(..., $nodeybits)


Comment on Re^2: LibXML, Namespaces, xpath expression - This should be simple.
Select or Download Code
Re^3: LibXML, Namespaces, xpath expression - This should be simple.
by alittlebitdifferent (Initiate) on Oct 26, 2011 at 02:20 UTC
    Hi All, Thank-you so much for your help with this.

    I apologise for the time taken to reply but I had assumed the site would email me by default if I got a reply..and as I hadn't, assumed no one had responded. (Possible server issue my end)

    Setting up the namespace in the way shown worked perfectly. This site should show PayPal options for each submit. I'd happily send each Monk a dollar or two for the mental sanity you afforded me.

    Thank you so much.

    PS: Matt Seargent was right. LibXML is super quick when used properly.

    • My Data Pool using XPath - Parsing took 3 hours
    • My Data Pool using LibXML - Parsing takes 20 minutes. - Fantastic!

      PerlMonks doesn't send emails.

      Unless it's changed, PerlMonks has no expenses — hosting is donated by Pair — so receiving money would actually be a problem. On the other hand, the Perl Foundation does take donations, I believe. Some of that money is going towards fixing the more complicated bugs in Perl.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (13)
As of 2014-09-23 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (221 votes), past polls