Hi Rob,

On Mon, 22 Jul 2013 21:48:33 +0100
Rob Dixon <rob.di...@gmx.com> wrote:

> On 22/07/2013 10:55, Omega -1911 wrote:
> >
> > Hello all - I am working on a small address book conversion where I need
> > to convert a text file in where I dumped the addresses and post them to
> > my database/website using the Mechanize module.
> >
> > My problem is I am trying to parse the data using the following code
> > that is not working.
> >
> > Can anyone shed some light and point me in the right direction? Thank
> > you for any ideas!
> 
> As others have said, you should use a custom module for processing XML.
> 
> This program shows just how easy it is to use `XML::XPath`. There are
> several other modules that will do the job if this one isn't to your taste.
> 

I recommend against using XML::XPath because it's been undermaintained, is
slower than XML::LibXML's XPath support, may be more incomplete and I believe
it has poorer support for XML namespaces.

Instead one should use https://metacpan.org/module/XML::LibXML::XPathContext ,
which is part of XML-LibXML, which for completeness' sake I'd like to note that
I am its primary maintainer, so I may be biased. But recommending to use XPath
for that ( http://en.wikipedia.org/wiki/XPath ) is a good idea.

Regards,

        Shlomi Fish  

> Becuase you haven't shown your entire XML I have had to remove a
> superflous `</div>` from the beginning of your data and add a notional
> `<root>` document element. Your actual data shouldn't need modifying.
> 
> HTH,
> 
> Rob
> 



-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Chuck Norris/etc. Facts - http://www.shlomifish.org/humour/bits/facts/

There’s no point in keeping an idea to yourself since there’s a 10 to 1 chance
that somebody already has it and will share it before you.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to