From a18ce83ac4611a689fa8c65be123e60bd8452c8c Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 5 Jun 2006 09:18:58 +0000 Subject: [PATCH] New, very very unfinished. --- zebra/ezeerex2pqfproperties.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 zebra/ezeerex2pqfproperties.pl diff --git a/zebra/ezeerex2pqfproperties.pl b/zebra/ezeerex2pqfproperties.pl new file mode 100755 index 0000000..c8b9485 --- /dev/null +++ b/zebra/ezeerex2pqfproperties.pl @@ -0,0 +1,25 @@ +#! /usr/bin/perl -w + +# $Id: ezeerex2pqfproperties.pl,v 1.1 2006-06-05 09:18:58 mike Exp $ + +use strict; +use warnings; +use XML::LibXML; + +my $text = join("", <>); +my $parser = new XML::LibXML(); +my $doc = $parser->parse_string($text); +my $root = $doc->getDocumentElement(); +print "root=$root, ISA=(", join(", ", @XML::LibXML::Element::ISA), ")\n"; +$root->registerDefaultNs("/.//") +my (@nodes) = $root->findnodes('serverInfo/host'); +print "found ", scalar(@nodes), " values\n"; + +## From http://plasmasturm.org/log/259/ +#use XML::LibXML; +#use XML::LibXML::XPathContext; +#my $p = XML::LibXML->new(); +#my $doc = $p->parse_file( $ARGV[ 0 ] ); +#my $xc = XML::LibXML::XPathContext->new( $doc->documentElement() ); +#$xc->registerNs( atom => 'http://purl.org/atom/ns#' ); +#print $xc->findvalue( q{ /xsl:stylesheet/xsl:template[ @match = '/' ]/atom:feed/atom:link[ @rel = 'alternate' ]/@href } ); -- 1.7.10.4