Skip to content
hughbris edited this page Sep 14, 2010 · 26 revisions

This is a forked repository of dublincore’s website.

As per the README file, it’s a tool for generating online resources for versioned specifications on the Dublin Core Metadata Initiative website. The tool still follows the process originally created around 2002 by Mitsuharu Nagamori and Harry Wagner. It operates on structured XML release information contained in day-stamped directories. The release publisher must prepare a new set of these for each release.

The current version of the tool adds RDFa annotations to the HTML files output by the tool.

Getting the code

It’s quite simple to get hold of the code:

Generating release files

Release files are the product of running XML transformations over XML release files.

Using Apache Ant

If you are comfortable with Ant, the easiest way is to use the build.xml file in the root of the package. The build file has been carefully modified as part of recent development, but not yet tested because the developer doesn’t use it. Therefore it is possible that it will fail because of a clumsy error. Please report any problems or submit a patched version to github.

Manual transformation

The exact procedure will vary depending on which transformation engine you choose to run. The main thing is to determine how to specify these values to the transformer:

  • XML source: which XML file is being transformed
  • XSL transformation: the transformation being applied (XSLT file)
  • target: where the result should be output
  • any transformation options
  • runtime parameters

Choosing a transformation engine

There are many engines that will run XML transformations (XSLT) and almost all are open source or at least free. You only need an engine that implements version 1.0 of XSLT for this tool.

You should also make sure that the engine you choose supports:

  • the XInclude standard (most will do this)
  • passing parameters in at runtime (also common)

(Note that although most modern web browsers perform XSL transformations, they do not provide a mechanism for passing in runtime parameters.)

The examples in the next section use the xsltproc engine, but these are illustrative only. You really only need to figure out how to run transformations in your engine and how to pass parameters into it.

Running the transformations

Common parameters
  • test.hostname: inserts a hardcoded prefix for the CSS link to make previewing local copies nicer (as long as you are online)
  • header: points to the HTML preceding the data, relative to the transformation file
  • todaysDate: a datestamp for resources generated
  • datestamp.dir: specifies the directory to find all the XML data files for this release (relative to transform file)
DCMI Type (XHTML+RDFa)

Required and recommended transformation values:

  • XML source: e.g. 2008-01-14/xmldata/dctype.xml (required)
  • XSL transformation: should be pointed to web/xsl/html-dctype.xsl from the repository root (required)
  • target: specify a file system path outside of the repository root so it doesn’t get versioned inadvertently, e.g. ../dctype-201007262144.html (optional: if omitted, this is usually standard output, i.e. the terminal)
  • Parameters:
    • test.hostname: set this to “http://dublincore.org” for testing only. . (optional: in the production environment, do not set)
    • datestamp.dir: e.g. “../../2008-01-14” (optional: defaults to “../../yyyy-mm-dd” for todaysDate)
    • header: e.g. “../../2008-01-14/headers/header-doc-dctype.xml”. (optional: defaults to “/headers/header-doc-dctype.xml” under datestamp.dir)
    • ns: a legacy parameter which points to the namespace for DCMI Type. (optional: defaults to “http://purl.org/dc/dcmitype/”)
    • todaysDate: in yyyy-mm-dd format. (required only if you are offline)
Example

This xsltproc transformation is invoked immediately above the repository root in the local file system:

xsltproc -o dctype-201008272304.html --xinclude --stringparam test.hostname "http://dublincore.org" --stringparam datestamp.dir "../../2008-01-14" website/web/xsl/html-dctype.xsl website/2008-01-14/xmldata/dctype.xml

Note that --xinclude is required at runtime in xsltproc for XInclude support.

DCMI Terms (XHTML+RDFa)

Required and recommended transformation values:

  • XML source: in this case it’s a header file, e.g. 2008-01-14/headers/header-doc-dcterms.xml (required)
  • XSL transformation: should be pointed to web/xsl/html-dcmiterms.xsl from the repository root (required)
  • target: specify a file system path outside of the repository root so it doesn’t get versioned inadvertently, e.g. ../dcmiterms-201007262151.html (optional: if omitted, this is usually standard output, i.e. the terminal)
  • Parameters:
    • test.hostname: set this to “http://dublincore.org” for testing only. . (optional: in the production environment, do not set)
    • datestamp.dir: e.g. “../../2008-01-14” (optional: defaults to “../../yyyy-mm-dd” for todaysDate)
    • todaysDate: in yyyy-mm-dd format. (required only if you are offline)
Example

This xsltproc transformation is invoked immediately above the repository root in the local file system:

xsltproc -o dcmiterms-201007262151.html --xinclude --stringparam test.hostname "http://dublincore.org" --stringparam datestamp.dir "../../2008-01-14" website/web/xsl/html-dcmiterms.xsl website/2008-01-14/headers/header-doc-dcterms.xml

Note that --xinclude is required at runtime in xsltproc for XInclude support.

DCMI Terms History (XHTML+RDFa)

Required and recommended transformation values:

  • XML source: in this case it’s a header file, e.g. 2008-01-14/headers/header-doc-history.xml (required)
  • XSL transformation: should be pointed to web/xsl/html-history.xsl from the repository root (required)
  • target: specify a file system path outside of the repository root so it doesn’t get versioned inadvertently, e.g. ../dchistory-201007262239.html (optional: if omitted, this is usually standard output, i.e. the terminal)
  • Parameters:
    • datestamp.dir: e.g. “../../2008-01-14” (optional: defaults to “../../yyyy-mm-dd” for todaysDate)
    • todaysDate: in yyyy-mm-dd format. (required only if you are offline)
Example

This xsltproc transformation is invoked immediately above the repository root in the local file system:

xsltproc -o dchistory-201008281610.html --stringparam test.hostname "http://dublincore.org" --stringparam datestamp.dir "../../2008-01-14" --xinclude website/web/xsl/html-history.xsl website/2008-01-14/headers/header-doc-history.xml

Note that --xinclude is required at runtime in xsltproc for XInclude support.

Testing

The resulting XHTML+RDFa files can be used how you like. There are at least a few simple tests you should run them through:

  • first open them in a web browser
  • next check that the files are valid XHTML+RDFa using the W3C online validator
  • use http://check.rdfa.info to examine the RDF triples that can be generated from the embedded RDFa