Metadata Presentation via XML and XSL
There has been considerable interest within the Internet community on the use of the Extensible Markup Language (XML 1.0), a W3C Recommendation for the packaging of structured information. Within the context of the FGDC activities, and in particular with metadata, the use of XML provides a reference framework for encoding of nested data structures and a means (validating parsers) to test them. Unlike HTML, which mixes content tags such as <title> and <body> with presentation tags such as bold <b> and italics <i>, XML provides strictly for the structure of information entities using beginning and ending tags. A companion standard, XML Style Language (XSL) is available and quite useful for applying presentation rules (a style sheet) to format the XML document for display.
A Draft Encoding Standard for Digital Geospatial Metadata has been in effect for several years now defining a formal XML encoding of FGDC metadata. The encoding is structurally enforced using a reference file known as a Document Type Declaration (DTD) that is hosted on the FGDC website. Metadata as XML is what is used as a loading format for Clearinghouse servers, and can be used as a format for exchange between software programs. The metadata as XML solves only one part -- the structural part -- of the metadata problem.
XML Resources for FGDC Metadata
An XML Document Type Definition (DTD) file was originally developed by Peter N. Schweitzer (U.S. Geological Survey) for validating XML-encoded metadata against the FGDC's core standard. However, DTDs are limited in what can be restricted within conforming XML documents. Therefore, the NOAA Coastal Services Center has developed the following schemata using the W3C's XML Schema definition language:
- Annotated schema (36KB ZIP Archive) - This schema collection contains embedded human-readable documentation for each XML element taken directly from the CSDGM specification, including: element long names, section numbering, and element value restrictions.
- Non-annotated Schema (15KB ZIP Archive) - This schema collection has the documentation removed from the annotated version. The uncompressed files are roughly one-third of the size of the associated annotated schema files and therefore require less time and/or memory to process and use.
The above schemas have been divided into modules by section within the CSDGM specification; therefore, fgdc-std-001-1998-ann.xsd and fgdc-std-001-1998.xsd, respectively, import the associated modules for the seven major sections of the standard and for the three supporting sections.
Rendering FGDC Metadata from XML using Stylesheets
Different style sheets or XSL instructions can be associated with a given XML file, allowing for completely different formats of presentation. Thus from the same data content, metadata could be rendered in flexible ways to better suit different audiences. Microsoft Internet Explorer version 5.0 or later and Netscape 6 or greater (Mozilla 1.0) can render XML files with embedded XSL instructions. This technology has high potential for transformation of complex metadata content to suit different end-user needs.
Here are links to the same FGDC metadata file written in XML, except that in the header, a reference to a different style sheet is made. From a single metadata content record we can see that four radically different views can be made. Again, you must use Microsoft Internet Explorer 5.0+ or Netscape 6.0+ to see this in action!
- Traditional Outline form (FGDC Classic View)
- Tabbed interface (ESRI View)
- FAQ format (FGDC FAQ)
- Condensed Format (FGDC NBII)
XSL Style Sheets
Stylesheets for the presentation of metadata have been created and published by NOAA and ESRI. The NOAA stylesheets are designed to work with most parsers, browsers, and platforms:
The following stylesheets from ESRI will work only with the Internet Explorer browser with the MSXML parser in the Windows environment:
- FGDC Classic: http://www.esri.com/metadata/fgdc_classic.xsl
- FGDC ESRI: http://www.esri.com/metadata/fgdc_esri.xsl
- FGDC FAQ: http://www.esri.com/metadata/fgdc_faq.xsl
- FGDC Geography Network: http://www.esri.com/metadata/fgdc_geography_network.xsl
- FGDC: http://www.esri.com/metadata/fgdc.xsl
If you get this error message in Internet Explorer:
The XML page cannot be displayed: A security setting in Internet Explorer 5.0 and above may prevent you from viewing the XML files and their style sheets because they are on different servers/domains. Go to Tools | Internet options... | Security Tab | Internet | Custom Level... | Scroll down to Miscellaneous | "Access data sources across domains" | Select Enable or Prompt | Yes | OK.
Note: If you are experiencing errors viewing the style sheets, save the files locally and view them in your browser. MSIE right click link to file and select Save Target As... Using Netscape right click link to file and select Save Link As... Then open in your browser of choice.
How does this work?
The standard first line of an XML file looks like this:
<?xml version="1.0"?>This simply declares the coming content to be XML Version 1.0. By adding a second line in the XML file, as shown below, a style sheet -- possibly residing on another computer -- can be invoked. This style sheet is processed as instructions in the client's browser and the new document is presented.
An XSL style sheet, is in fact nothing more than an XML file itself with the transformation instructions in it that are known by style generators such as Internet Explorer which have an embedded XML parser.
<xml:stylesheet xmlns:xsl="http://www.esri.com/metadata/fgdc_classic.xsl" type="text/xsl">Back To The GIS Data Library