Return to lpml_parse.pl CVS log | Up to [LON-CAPA] / loncom / build |
an XML-ish markup language (Linux Packaging Markup Language)
#!/usr/bin/perl use HTML::TokeParser; $p = HTML::TokeParser->new(shift||"test.lpml"); while (my $token = $p->get_tag("category")) { my $url = $token->[1]{name} . $token->[1]{type}; my $chmodtoken=$p->get_tag("chmod"); my $text = $p->get_trimmed_text("/chmod"); print "CHMOD: $text\n"; my $text = $p->get_trimmed_text("/category"); print "$url\t$text\t".join(" ",@{$token->[2]})."\n"; }