summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-10-13 15:51:53 +0000
committerNorbert Preining <preining@logic.at>2007-10-13 15:51:53 +0000
commit65fd3d0af5ae2a453ced4a6ccc8f895ac8eea36e (patch)
tree5b4246aedd44c686783b3fc32d9a50d5bc4252d5 /Master
parent2bc3d6dd625da14288b2b23e08b2cef862bed5eb (diff)
add new parsing so that I do not loose it. XML::XPath is helping a lot!!!
git-svn-id: svn://tug.org/texlive/trunk@5174 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/TeXLive/new-texcatalogue-parsing.pl41
1 files changed, 41 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/new-texcatalogue-parsing.pl b/Master/tlpkg/TeXLive/new-texcatalogue-parsing.pl
new file mode 100644
index 00000000000..c5418cf8f5d
--- /dev/null
+++ b/Master/tlpkg/TeXLive/new-texcatalogue-parsing.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl -w
+
+use XML::XPath;
+use XML::XPath::XMLParser;
+
+my $parser = new XML::XPath->new(filename => 'achemso.xml') ||
+ die "Failed to parse achemso.xml";
+
+my $name = $parser->findvalue("/entry/name");
+my $caption = $parser->findvalue("/entry/caption");
+my $version = $parser->findvalue('/entry/version/@number');
+my $license = $parser->findvalue('/entry/license/@type');
+my $description = $parser->findvalue("/entry/description");
+my $ctan = $parser->findvalue('/entry/ctan/@path');
+my $texlive = $parser->findvalue('/entry/texlive/@location');
+my $miktex = $parser->findvalue('/entry/miktex/@location');
+
+my $docset = $parser->find('/entry/documentation');
+my @docs;
+foreach my $node ($docset->get_nodelist) {
+ $det = $parser->find('./@details',$node);
+ $href = $parser->find('./@href',$node);
+ push @docs, [ $det, $href ];
+}
+print "MISSING DOCUMENTATION STUFF!!\n";
+
+print "name=$name\n";
+print "caption=$caption\n";
+print "version=$version\n";
+print "license=$license\n";
+print "description=$description\n";
+print "ctan=$ctan\n";
+print "texlive=$texlive\n";
+print "miktex=$miktex\n";
+
+foreach $d (@docs) {
+ my @a = @$d;
+ print "doc href = ", $a[1], "\n";
+ print "doc deta = ", $a[0], "\n";
+}
+