Monthly Archives: August 2006

XML parsing with Perl using XPath

use strict; use XML::LibXML; # data source my $xml_filename = "xml/data.xml"; my $parser = XML::LibXML->new; my $doc = $parser->parse_file($xml_filename); my $xpath = "//word/entry[\@src=\"pr\"]/.."; my @words = $doc->findnodes($xpath); foreach my $word (@words) { print $word->findvalue("\@id"); print "\n"; }
Posted in Data Processing, Programming, Tips & Tricks | Tagged , , | Leave a comment

File modified timestamp with Perl

This is how to quickly get the timestamp of when the file was last modified in Perl: $lastmod = (stat($filename))[9];
Posted in Programming, Tips & Tricks | Tagged , | Leave a comment

XSLT transform with Perl

Here is a Perl snippet that transforms an XML file with XSLT: use strict; use XML::XSLT::Wrapper; my $xml_input_filename = "xml/data.xml"; my $xml_output_filename = "xml/out.xml"; my $xsl_filename = "xml/transform.xslt"; my $xslt = XML::XSLT::Wrapper->new( ProcessorList => [ 'libxslt', 'sablotron', 'xslt' ], ); my $result = $xslt->transform( OutFile => $xml_output_filename, xml => $xml_input_filename, xsl => $xsl_filename, ); $xslt->dispose();
Posted in Data Processing, Programming, Tips & Tricks | Tagged , , | Leave a comment

Blogger, WordPress, b2evolution: Blog Engine Choice

As I signed up with Blogger a few years ago, and have never looked at alternatives, I decided to do so now, just to check whether I'm missing on something. Here's what I found.

Posted in Blogging | Tagged , , | 1 Comment

Sitemap generator configuration for Blogger

If you are using Google’s sitemap generator [code]]czoxNDpcInNpdGVtYXBfZ2VuLnB5XCI7e1smKiZdfQ==[[/code] to generate a sitemap of your Blogger blog , here are the configuration lines to add to the config.xml file:
Posted in Tips & Tricks | Tagged , | Leave a comment