Questions about XML:LibXML
- From: fergus@xxxxxxxxxxxxxxxx (Fergus McMenemie)
- Date: Sun, 16 Dec 2007 11:22:29 +0000
I am currently migrating several large scripts from XML::DOM to
XML::LIBXML and the transistion has hightligted a number of problems.
Both modules have rather poorly documented aspects and the move to
XML::LIBXML is proving painful.
A typical use of either module to read XML goes along the lines of
my $parser =XML::LibXML->new();
my $tree = $parser->parse_file($metafile);
XML::LIBXML seems to require an extra step of
my $pubmeta = $tree->getDocumentElement();
I think my misunderstandings starts at the very first line.
- What this $parser object do? If I am parsing multiple files
do I need a seperate parser instance for each file?
- Having used parse_file() within a subroutine do I need to
keep it around or is it just $tree that needs kept?
- Or can I get away with just keeping $pubmeta in scope?
In answering or commenting on the above bear in mind that I am
opening lots of XML files, merging elements from them into a master.
Thanks in advance Fergus.
.
- Follow-Ups:
- Re: Questions about XML:LibXML
- From: xhoster
- Re: Questions about XML:LibXML
- Prev by Date: Re: CIGARETTES BON MARCHÉ !!
- Next by Date: Re: Questions about XML:LibXML
- Previous by thread: Re: CIGARETTES BON MARCHÉ !!
- Next by thread: Re: Questions about XML:LibXML
- Index(es):
Relevant Pages
|