Thread XML: Zahlen anhand von Keywords finden
(19 answers)
Opened by cohama at 2013-03-28 13:16
na wenn wir fertigen code liefern:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 use XML::LibXML; my $p = XML::LibXML->new; my $doc = $p->parse_string($xml); my $root = $doc->documentElement; my ($pp) = $root->findnodes("pp"); for my $field ( qw/ uid ppn ethAddr hwType /) { say $pp->getAttribute($field) } Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wie frage ich & perlintro brian's Leitfaden für jedes Perl-Problem |