File:  [LON-CAPA] / loncom / build / lpml_parse.pl
Revision 1.1: download - view: text, annotated - select for diffs
Sun May 6 22:53:30 2001 UTC (23 years, 7 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
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";
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>