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
Getting XML::Twig to ignore certain elements?
by Danny Yoo other posts by this author
Jul 10 2001 8:52PM messages near this date
view in the new Beta List Site
RE: :Simple - how to iterate through records? | Re: Getting XML::Twig to ignore certain elements?
Is there a way to get XML::Twig to not read certain elements?  I'm working
with some biological XMLs, and each data file has a really huge element
approximately 50 MB long.  Let's call its tag "FOOBAR".  I'm trying to get
XML::Twig to ignore FOOBAR, because it takes at least a few hours for
XML::Twig to run through and construct it.

Since this element is always at the end, I'm using the hacky solution of
calling twig-> finish() right before I hit FOOBAR; however, this feels
unsatisfactory.  I'd like a more robust solution where I can say something
like:

###
my $twig = XML::Twig-> new(TwigHandlers => $handlers,
                          IgnoreTags =>  'FOOBAR');
###

and have XML::Twig just skip over certain elements, avoiding the cost of
constructing a PCDATA node.  I haven't found such an 'IgnoreTags' option
yet, so I'm wondering if anyone here could give any suggestions.

Thanks for any help.

_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
http://listserv.ActiveState.com/mailman/listinfo/perl-xml
Thread:
Danny Yoo
Michel Rodriguez

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