1 / 11

LAS-XML, Validation, and RELAX NG

LAS-XML, Validation, and RELAX NG. Jon Callahan (standing in for Roland Schweitzer). LAS use of XML. LAS (will) store all ‘configuration information’ in XML documents Server configuration User Interface components Dataset descriptions Variables User Interface presentation

naida
Download Presentation

LAS-XML, Validation, and RELAX NG

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LAS-XML, Validation, and RELAX NG Jon Callahan(standing in for Roland Schweitzer)

  2. LAS use of XML • LAS (will) store all ‘configuration information’ in XML documents • Server configuration • User Interface components • Dataset descriptions • Variables • User Interface presentation • Product generation ‘hints’ • Data access ‘hints’

  3. LAS use of XML

  4. Sister servers

  5. Improving our use of XML • GOALS: • Have all configuration information in XML • Be able to create a schema for validation • Better separate UI vs. product server info • Expanded set of information • Clean up inconsistencies

  6. New dataset XML <lasdata version="6.5"> <dataset doc="http://www.cdc.noaa.gov/cdc/data.coads.ltm.html" ID="CDC014" name="COADS LTMs"> <variable ID="V2" name="Sea Surface Temperature" units="degC" url="file://Datasets/coads_2d_g_std/sst.mean.nc#sst"> <grid IDREF="G88"/> </variable> <variable> … </variable> … </dataset>

  7. New dataset XML <grid ID="G88"> <axis IDREF="CDC014-lon17"/> <axis IDREF="CDC014-lat18"/> <axis ID="CDC014-time88" type="t" units="month"> <arange size="120" start="1990-01-01" step="1"/> </axis> </grid> <axis ID="CDC014-lon17" type="x" units="degrees_east"> <arange size="180" start="1" step="2"/> </axis> <axis ID="CDC014-lat18" type="y" units="degrees_north"> <arange size="90" start="-89" step="2"/> </axis> </lasdata>

  8. ‘Well formed’ vs. ‘valid’ • 10% of XML documents have errors! • ‘Well formed’ means that the XML syntax is correct. • ‘Valid’ means that the XML conforms to a schema (orDTD). • Tools are available to validate XML against your schema. • Automatic validation means less user support!

  9. Writing schemas with RELAX NG • RELAX NG is a newly popular tool for writing XML schemas. • RELAX NG focuses on XML tree structure(not element content). • RELAX NG schemas are easy to write. • RELAX NG schemas are easy to read. • “Working with RELAX NG is fun!” (Roland)

  10. RELAX NG schema for <lasdata> <define name="Lasdata"> <element name="lasdata"> <attribute name="version"/> <interleave> <oneOrMore> <ref name="Dataset"/> </oneOrMore> <oneOrMore> <ref name="Grid"/> </oneOrMore> <oneOrMore> <ref name="Axis"/> </oneOrMore> </interleave> </element> </define>

  11. Useful links • The RELAX NG Tutorial at Oasis. • A 3-part series of "XML Matters" columns entitled "Kicking back with RELAX NG" by David Mertz (Part 1, Part 2, and Part 3). • An article about the design philosophy behind RELAX NG. • The text of a book on RELAX NG to be published by O'Reilly & Associates. • A C-library that includes RELAX NG validation with Perl bindings via XML-LibXML.

More Related