RE: Parsing empty fields XML using perl

"Wayne Simmons" <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
From: Alok Sharma
Sent: Thursday, May 14, 2009 1:11 PM
>I need to extract the TOPNAME and MAPREF fields. Please suggest.

I suggest you use XML::XPath.  Read the docs on how to use it, it would make
your extremely confusing loops disappear into something far more readable.

Plus all the "getFirstChild" and "getData" disappear too.  You might have to
learn XPath but it will be a worthwhile time spent.  Parsing a DOM without
XPath is tedious and error prone.

You can easily specify tags and elements with XPath, to get all the info you
need from a file.  

-Wayne

--
Software Engineer
InterSystems USA, Inc.
303-858-1000 
 


_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.