[Edinburgh-pm] XML module recommendations

Miles Gould miles at assyrian.org.uk
Mon Jun 6 10:17:28 PDT 2011


Hi everyone,

I've got an XML file, of which the following is a fragment:

<changelog>
<patch author='mg at maths.gla.ac.uk' date='20100205002131'
local_date='Fri Feb  5 00:21:31 GMT 2010' inverted='False'
hash='20100205002131-d1398-ec8538dd31f4962aace5ee3984568b3b3ca96527.gz'>
	<name>Changed style to report; narrowed some diagrams.</name>
	<comment>Ignore-this: eeb8c9a84599ecef486fd7d5aa7c3f9e</comment>
</patch>
<patch author='mg at maths.gla.ac.uk' date='20090220012304'
local_date='Fri Feb 20 01:23:04 GMT 2009' inverted='False'
hash='20090220012304-d1398-7af369eaf17325b5dae10db7c91db1edfc921b99.gz'>
	<name>Post-viva corrections</name>
</patch>
<patch author='mg at maths.gla.ac.uk' date='20090125173648'
local_date='Sun Jan 25 17:36:48 GMT 2009' inverted='False'
hash='20090125173648-d1398-a286dec5525eb3a8481f1e6550229090a30da4fb.gz'>
	<name>Some refactorings, and a couple of minor fixes. This was the
submitted version.</name>
</patch>
<patch author='mg at maths.gla.ac.uk' date='20080922221150'
local_date='Mon Sep 22 23:11:50 BST 2008' inverted='False'
hash='20080922221150-d1398-3e8da86f8e360753ea2cb267f5195e1d379d8531.gz'>
	<name>Finished proofreading!</name>
</patch>
<patch author='mg at maths.gla.ac.uk' date='20080922160237'
local_date='Mon Sep 22 17:02:37 BST 2008' inverted='False'
hash='20080922160237-d1398-e82c426fca5a9345e9d8b86cbde01502f07fbd1f.gz'>
	<name>No more jokes :-(</name>
</patch>
...
</changelog>

I'd like to extract a list of all the hashes: ie, the content of every
attribute matching the XPath /changelog/patch/@hash. What's the best
CPAN module for that sort of thing?

[I know what you're thinking: why don't you build darcs as a set of
libraries and write a Haskell program that links against libdarcs and
queries the data-structures directly? The question answers itself, I
feel.]

Miles.


More information about the Edinburgh-pm mailing list