Back to IMesh Toolkit Home Page
Back to IMesh Toolkit Homepage
Subject Gateway Requirements
Technology Review
Work In Hand
  Personalization
Annotation
Reading Lists
OAI  Normalization tools
Metadata Exchange
RDF queries
Evaluation
Dissemination
Project Documentation
Related Links
Project Partners
IMesh Home Page

The IMesh Toolkit

[ Work In Hand > Components > OAI Normalization tools]

Perl tools for normalization of OAI records: trans.pl version 0.1


Requirements

XML::Simple

Description

trans.pl reads a configuration file containing one or more lines of the form
element regularexpression
e.g. type s/pamphlet/Text/i
trans.pl then applies the regular expression (regexp) to the value of the named elements in a file supplied as argument (or to Standard input), and writes the result out to an output file. The XML supplied in the file or through standard input must conform to the xml schema as specified in http://dublincore.org/schemas/xmls/simpledc20020312.xsd

Usage

trans.pl -i <inputfile> -o <outputfile> -c <configfile> where <input> file is the name of the file containing the XML <outputfile> is the name of the new file containing the transformed XML and <configfile> is the name of the configuration file where the transformations are specified.

Using standard input.
You can supply the XML through standard input instead of in a file.
You will need to specify -i - instead of a file name.
eg. cat record1.xml | trans.pl -c trans.cfg -i - -o newrecord1.xml

Handling of nested elements.

This version deals only with the <metadata> section of OAI records. Future versions support more complex configuration files so as to be able to specify and distinguish between nested elements.

Download

Download the Perl script

Step-by-Step

A gentle walkthrough: using trans.pl to transform your records.