[mapserver-users] XML Metadata management

Nyk Cowham ncowham at forumone.com
Wed Aug 29 23:13:13 EDT 2001


Lyndon:

There are a number of approaches you can take with the metadata, it all
really depends on what you want to do with it. If you just want to
publish the metadata on a website you should probably use an XSLT
stylesheet to transform the XML document into an HTML document. You can
get a XSLT processor free in a number of different implementations.
Many people favor SAXON (http://saxon.sourceforge.net/) which is
implemented in Java but I generally use my own Perl script called
'exalt' that implements the XML::LibXSLT module:

#!/usr/bin/perl -w

use strict;
use XML::LibXSLT;
use XML::LibXML;

my $parser = new XML::LibXML;
my $xsl = new XML::LibXSLT;

if (@ARGV) {
    my $xml_src = $parser->parse_file(shift);
    my $style_src = $parser->parse_file(shift);
    my $stylesheet = $xsl->parse_stylesheet($style_src);
    my $result = $stylesheet->transform($xml_src);
    $stylesheet->output_file($result, shift);
} else {
    die("usage: exalt <xml source> <xslt stylesheet> <html output
file>");
}

If you want to be able to do these transforms dynamically rather than on
the command line you can use AxKit (Perl) or Cocoon (Java) to do
transforms dynamically everytime the xml document or stylesheets change.

It you need to do more complex data manipulation of the files then you
are probably will have to do some programming. I would recommend
subscribing to the Perl-XML mailing list (perl-xml at activestate.com)
since Perl is a very easy way of processing XML files - also check out
http://www.xmlperl.com/.

Nyk Cowham.

> Greetings all,
> One of the great joys of any GIS project is, of course, preparing and
> delivering the metadata.  The national co-ordinators of the metadata
> project here in Oz have decided on an XML format and provided 
> tools for
> generating data in this format.  
>
> The concept is great, but I'm now trying to work out how to 
> deliver this
> metadata.  Can anyone give me quick rundown on how this 
> works?  I think
> it's a template read by your favourite browser that allows 
> you to select
> your metadata XML file, then delivers it in accordance with the
> template.  Or is it driven by some server application?
> 
> Lyndon Z
> 
> -- 
> Lyndon Zimmermann
> BE (Mech Adelaide) Grad Dip Bus Admin (UniSA)
> 
> "Bioenergy Atlas for Australia" Co-ordinator
> University of Adelaide Agronomy and Farming Systems
> C/- GISCA, 4th floor, 10 Pulteney St, Adelaide 5005
> Dir (GISCA) +61-8-8303 3975 Switch (GISCA) 8303 3900 Mob 0414 91 4577
> Fax (GISCA) +61-8-8303 3498 email lyndon.zimmermann at adelaide.edu.au
> http://sg211.gisca.adelaide.edu.au/lzimmerm/zimm.htm
> 
> Biomass Energy Atlas Website:
> http://sg211.gisca.adelaide.edu.au/bioenergy_atlas/html/atlas_
index.html

Unless otherwise stated, the content of this message and attachments may
be forwarded or quoted, with due acknowledgement.  No representation is
made that this email is free of viruses. Virus scanning is recommended
and is the responsibility of the recipient.



More information about the mapserver-users mailing list