standards / xml / validation / transformation / esri

31
MEDIN Standards Workshop Standards / XML / Validation / Transformation / ESRI

Upload: medinmarine

Post on 09-Jul-2015

191 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Standards / XML / Validation / Transformation / ESRI

MEDIN Standards Workshop

Standards / XML / Validation / Transformation / ESRI

Page 2: Standards / XML / Validation / Transformation / ESRI

Introduction

– XML– Schema and Validation

• XSD Schema• Schematron

– Transformation• Stylesheets

– ESRI ArcGIS– Search

Page 2

Page 3: Standards / XML / Validation / Transformation / ESRI

XML

Page 4: Standards / XML / Validation / Transformation / ESRI

XML

•Extensible Markup Language (XML)– A metamarkup language– The basic unit is called an element

– Apparently similar to HTML but…

Page 4

<tag attribute="attribute value">element value</tag>

Element

AttributeOpening tag Closing tag

Page 5: Standards / XML / Validation / Transformation / ESRI

Metamarkup?

•What does metamarkup mean?– There is no predefined and fixed set of tags

for XML– XML allows implementers to define their

own set of tags to meet their needs

Page 5

Examples• Office Open XML (ISO/IEC 29500)• Geography Markup Language (ISO 19136)

Page 6: Standards / XML / Validation / Transformation / ESRI

Markup – ESRI ArcGIS 10 XML

Page 6

<idCitation> <resTitle>Title</resTitle> <date> <createDate>20110906</createDate> </date></idCitation>

Page 7: Standards / XML / Validation / Transformation / ESRI

Markup – ISO 19139 XML

Page 7

<gmd:citation> <gmd:CI_Citation> <gmd:title><gco:CharacterString>Title</gco:CharacterString> </gmd:title> <gmd:date> <gmd:CI_Date> <gmd:date> <gco:Date>2011-09-06</gco:Date> </gmd:date> <gmd:dateType> <gmd:CI_DateTypeCode codeList="...#CI_DateTypeCode" codeListValue="creation">creation</gmd:CI_DateTypeCode> </gmd:dateType> </gmd:CI_Date> </gmd:date> </gmd:CI_Citation></gmd:citation>

Page 8: Standards / XML / Validation / Transformation / ESRI

Well-Formed

•XML has strict rules, e.g.:– There must be one, and only one root

element– All elements must have an opening

and closing tag– Element names are case sensitive:

• <citation/> is different from <Citation/>

– XML conforming to the rules is said to be well-formed

Page 8

Page 9: Standards / XML / Validation / Transformation / ESRI

Well-Formed

Page 9

<idCitation> <resTitle>Title</resTitle> <date> <createDate>20110906</createDate> </date></idCitation>

<idCitation> <resTitle>Title</ResTitle> <date> <createDate>20110906 </date></idCitation><idPurp>Summary</idPurp>

No closing tag

Opening and closing tagsare different

Two root elements

Page 10: Standards / XML / Validation / Transformation / ESRI

Structure

•The markup defines data structure:– It signifies which elements are

associated– It can define semantics:

– It says nothing about how to display data (there are exceptions to this rule)

Page 10

<date> <createDate>20110906</createDate></date>

Page 11: Standards / XML / Validation / Transformation / ESRI

XML is machine readable

•And…– Human readable… honestly

Page 11

Page 12: Standards / XML / Validation / Transformation / ESRI

Page 12

Page 13: Standards / XML / Validation / Transformation / ESRI

Schema and Validation

Page 14: Standards / XML / Validation / Transformation / ESRI

Schema

•Schemas document the elements that are permitted in an XML application

– XML that conforms to a schema is said to be schema-valid

– XML that does not conform to a schema is said to be invalid

Page 14

Page 15: Standards / XML / Validation / Transformation / ESRI

XML Schema Definition Language

Page 15

<xs:complexType name="CI_Citation_Type"> ... <xs:complexContent> <xs:extension base="gco:AbstractObject_Type"> <xs:sequence> <xs:element name="title" type="gco:CharacterString_PropertyType"/> <xs:element name="alternateTitle" type="gco:CharacterString_PropertyType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="date" type="gmd:CI_Date_PropertyType" maxOccurs="unbounded"/> ... </xs:sequence> </xs:extension> </xs:complexContent></xs:complexType>

Page 16: Standards / XML / Validation / Transformation / ESRI

Markup – ISO 19139 XML

Page 16

<gmd:citation> <gmd:CI_Citation> <gmd:title><gco:CharacterString>Title</gco:CharacterString> </gmd:title> <gmd:date> <gmd:CI_Date> <gmd:date> <gco:Date>2011-09-06</gco:Date> </gmd:date> <gmd:dateType> <gmd:CI_DateTypeCode codeList="...#CI_DateTypeCode" codeListValue="creation">creation</gmd:CI_DateTypeCode> </gmd:dateType> </gmd:CI_Date> </gmd:date> </gmd:CI_Citation></gmd:citation>

Page 17: Standards / XML / Validation / Transformation / ESRI

Schematron

•Schematron is:– A schema language for XML

• Document Schema Definition Language (DSDL)

– Written in XML– It’s an ISO Standard – ISO 19757-3

Find out more at: http://www.schematron.com/

Page 17

Page 18: Standards / XML / Validation / Transformation / ESRI

Why use Schematron?

•XSD schema is unable to test some constraints:

– The ability to specify a choice of attributes

– The ability to vary the content model based on the value of an element or attribute (this sort of constraint is common in the ISO 19115 logical model)

•Implementing profiles (e.g. MEDIN):– With Schematron there’s no need to

edit the underlying standardised XSD Page 18

Page 19: Standards / XML / Validation / Transformation / ESRI

Page 19

Page 20: Standards / XML / Validation / Transformation / ESRI

Validation Workflow

Page 21

XSD Schema Validation

Schematron Validation

Page 21: Standards / XML / Validation / Transformation / ESRI

Validation Tools

Page 22

Select profile

XSD Schema

Schematronschemas

Page 22: Standards / XML / Validation / Transformation / ESRI

Transformation

Page 23: Standards / XML / Validation / Transformation / ESRI

XSLT

•Extensible Stylesheet Language Transformations (XSLT)

– Specifies rules for transforming one XML instance into another XML instance

– The output XML instance will have a different structure from the input XML instance

Page 24

Page 24: Standards / XML / Validation / Transformation / ESRI

ESRI XML to MEDIN XML

•MEDIN XML must be follow the ISO 19139 XML encoding

– Users may wish to use other software to create and manage metadata (e.g. ESRI desktop GIS)

– ESRI software manages metadata using XML

– The XML does not following the ISO 19139 standard

– The XML can be transformed to ISO 19139– MEDIN provides resources to support this

Page 25

Page 25: Standards / XML / Validation / Transformation / ESRI

Stylesheet Tools

Page 26

Page 26: Standards / XML / Validation / Transformation / ESRI

ESRI ArcGIS

Page 27: Standards / XML / Validation / Transformation / ESRI

Versions

•ArcGIS 9– FGDC / ISO

•ArcGIS 10– ESRI Core Metadata

– Both use XML encoding– The encodings are slightly different– Why the change at version 10?

Page 28

Page 28: Standards / XML / Validation / Transformation / ESRI

ESRI ArcCatalog – Options

Page 29

Page 29: Standards / XML / Validation / Transformation / ESRI

ESRI ArcCatalog

Page 30

Page 30: Standards / XML / Validation / Transformation / ESRI

Transformation

Page 31

ArcGIS 9 Metadata

ArcGIS 10 Metadata

MEDIN MetadataTransformation

e.g. Internal use e.g. External / Publish to DAC

Page 31: Standards / XML / Validation / Transformation / ESRI

Transform Options

•Use MEDIN stylesheets– ArcGIS 9 version– ArcGIS 10 version (or the Validate

button)•Implementation

– Any XSL stylesheet processor (version1.0), e.g:

• ArcGIS 9 or 10 ArcToolBox

• Metadata Maestro

Page 32