Questions about XML:LibXML



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.
.



Relevant Pages

  • Re: AIX vs Solaris
    ... rather than init scripts being a full ... restart systems depending on a failed but restarted system or ... the XML files provided with the OS are *not* ... configuration files; they are supposed to be as immutable as ...
    (comp.unix.admin)
  • Re: AIX vs Solaris
    ... XML files or when you want to apply a site-specific profile. ... scripts, which has never been a problem on Redhat, Slackware or BSD's. ... Expressed in this posting are my opinions. ... to opinions held by my employer, Sun Microsystems. ...
    (comp.unix.admin)
  • Re: ETL usage
    ... So creating scripts which generate scripts etc... ... SSIS packages are XML files, so you can generate these file by creating your ... creating scripts and scripts will create GUI and Mappings and it is ...
    (microsoft.public.sqlserver.datawarehouse)
  • export or save to XML
    ... I'm desperately looking for a way to save my Outlook items (mail, ... journal, etc.) as XML files. ... I've found tools (binaries and scripts, open and closed source) that ...
    (microsoft.public.outlook)