ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
RE: Parsing empty fields XML using perl
by Wayne Simmons other posts by this author
May 14 2009 12:58PM messages near this date
view in the new Beta List Site
Re: Parsing emoty fields XML using perl | Can't get 'content' element to fold correctly in XML::Simple
& XSLT 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
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Alok Sharma
Jenda Krynicky
Wayne Simmons

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved