in reply to Zaurus addressbook.xml parser

I think you're going through way too much effort for a breakable parser. XML::LibXML or XML::Twig make proper parsing for simple stuff no more difficult than a bit of regex twiddling is, and will also handle complex cases. If you post a representative snippet of your input I can whip up some libxml code that won't be longer than half your script. And much easier to read.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: Zaurus addressbook.xml parser
by Ryszard (Priest) on Nov 22, 2003 at 16:19 UTC
    Yup, I agree, using an XMP Parser would be better, (and i'm pretty familiar with some of the ones on CPAN).

    The goal here was to produce something that had zero dependencies for use on my Zaurus, which is a PDA.

    I wanted something that i could carry around or have quick access to which was the simplest to install / use. I acknowledge all the failings, i agree / know about the parsers, this is just "something cool" which works for me and my data.

    FYI, a sample record,

    <Contact FirstName="FFFFFF" LastName="LLLL" FileAs="LLLL, FFFFFF" Busi +nessMobile="+12345678901" DefaultEmail="wwwwwwwwww@wwwwww.ww" Emails= +"wwwwwwwwww@wwwwww.ww " HomePhone="1111 111 111" Gender="0" WorkEma +il="wwwwwwwwww@wwwwwwww.ww" rid="53" rinfo="0" Uid="-1068731722" />

    Update:The entire program is now on the Zaurus-users mailing list.