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: XML::Twig beginner
by Ying Liu other posts by this author
Jun 20 2006 10:19AM messages near this date
view in the new Beta List Site
Re: XML::Twig beginner | Re: XML::Twig beginner
& XSLT TIMTOWTDI, as always.

One Way:
my $first_process = $twig-> first_elt('processName');
print $_-> text, "\n" for
    ( $first_process, $first_process-> next_sibling );


XML::Twig::Elt should be part of XML::Twig, right? I installed the XML::Twig package by Acti
vePerl and it cannot find the method first_elt(). Any way, I will use TwigRoots to extract t
he interest tags. 



Another Way:
my @processes = $root-> children('ProcessNames');
for ( @processes ) {
    print $_-> text, "\n" for $_->children;
}

Yet Another Way:
my @names = $root-> descendants('processName');
print $_-> text, "\n" for @names;

The 2nd and 3rd method works. Thank you.

Ying

 		
---------------------------------
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.
Thread:
Ying Liu
Ying Liu
Andreas P?rzer
Ying Liu
Andreas Pürzer
Ying Liu
Andreas Pürzer
Andreas Pürzer
Ying Liu

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