XML is a metamarkup language (explained later) The example shows an XML element, with a start and end tag, its value (the text “element value”), an attribute and its value (the text “attribute value”).
XML describes a means for marking up information. It does not provide a predefined set of tags for all users. In this sense it is a meta markup language. Instead, implementers are free to define their own set of tags.
This is an example from ESRI ArcGIS 10 metadata. idCitation is an element that contains other elements.
This is an example of the same data encoded according to ISO 19139.
The top example is well-formed XML. The second example is not well-formed. The following errors exist: There’s more than one root element (idCitation and idPurp) The start and end tag name of resTitle are different (ResTitle is considered different because of the character case) The element createDate has no closing tag
The XML here encodes a date, and specifically a creation date. This is expressed in the markup.
Some real XML
This is a sample from an XSD schema – actually from ISO 19139. The first thing to note is that it is encoded in XML.
This XML conforms to the previous XSD schema snippet.
Schematron is another type of schema language for XML. It is written in XML too. It’s an ISO standard – ISO 19757-3 (this is not one of the ISO / TC 211 standards).
XSD schema is unable to perform certain tests that are necessary to validate ISO 19115 metadata. Schematron plugs the gap.
ISO 19115 contains constraints which can not be tested with XSD schema. They can be tested with Schematron.
The overall validation process looks like this – for metadata.
MEDIN provides applications, such as Metadata Maestro, that implement all the necessary validation steps. This is a screen shot from the validation application of Metadata Maestro.
MEDIN provides applications, such as Metadata Maestro, which provide a means of applying XSL Stylesheets (version 1.0) to XML.
At version 10 of ESR ArcGIS there has been a change in the metadata encoding. It has been consolidated because ESRI need to support a range of different profiles. More information can be found at: http://blogs.esri.com/Dev/blogs/arcgisdesktop/archive/2011/01/03/A-new-approach-for-Metadata-with-ArcGIS-10.aspx
A screenshot of ESRI ArcCatalog. Users can select the metadata style – which includes INSPIRE metadata. Note that, no matter which style is selected, the metadata are still encoded according to the ESRI core metadata encoding. The style selected in options controls how metadata are imported and exported.
The metadata editing interface of ArcCatalog: A table of contents – select sections of metadata to edit – includes common names recognisable from ISO 19115 The data entry fields and controls Context help is displayed for data entry controls when they have focus Metadata can be saved
It’s necessary to apply an XSL stylesheet to transform from ESRI metadata to MEDIN metadata. MEDIN supplies stylesheets for this purpose. There’s one for ArcGIS version 9 and one for ArcGIS version 10. You can also use the Validate button in Arc 10.1 to do this.
Stylesheets can be implemented using Metadata Maestro or the ArcGIS 9 or 10 ArcToolBox
Standards / XML / Validation / Transformation / ESRI
XML•Extensible Markup Language (XML) – A metamarkup language – The basic unit is called an element Element <tag attribute="attribute value">element value</tag> AttributeOpening tag Closing tag – Apparently similar to HTML but…
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 needsExamples • Office Open XML (ISO/IEC 29500) • Geography Markup Language (ISO 19136)
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
Well-Formed <idCitation> <resTitle>Title</resTitle> <date> <createDate>20110906</createDate> </date> </idCitation> <idCitation> Opening and closing tags <resTitle>Title</ResTitle> are different <date>Two root elements <createDate>20110906 No closing tag </date> </idCitation> <idPurp>Summary</idPurp>
Structure•The markup defines data structure: – It signifies which elements are associated – It can define semantics: <date> <createDate>20110906</createDate> </date> – It says nothing about how to display data (there are exceptions to this rule)
XML is machine readable•And… – Human readable… honestly
Schema•Schemas document the elements that arepermitted 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
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/
Why use Schematron?•XSD schema is unable to test someconstraints: – 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
XSLT•Extensible Stylesheet LanguageTransformations (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
ESRI XML to MEDIN XML•MEDIN XML must be follow the ISO 19139 XMLencoding – 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