From 1eff5e0eec20fd7298f43d1362e39b60d4feb4a7 Mon Sep 17 00:00:00 2001 From: Peter Rushforth Date: Tue, 2 Mar 2021 11:16:23 -0500 Subject: [PATCH] Add element child of (#163) * Get rid of references to MicroXML, update Abstract * Add link to UCR * Add text-valued element child of <feature> per https://github.com/Maps4HTML/Web-Map-Custom-Element/issues/316. Change mapml vocabulary to the xhtml namespace. Fix error in URL introduced in previous commit. * Rename <feature><title> to <feature><featurecaption> * Add spec description of <featurecaption>. Remove obsolete sch file. * Revise feature, featurecaption, properties specifications, links. * Delete redundant paragraph. Fix incorrect link reference. Remove redundant text description. --- schema/README.md | 17 ++++++--------- schema/mapml.rnc | 4 +++- schema/microxml.sch | 10 --------- spec/index.html | 53 ++++++++++++++++++++++++++++++++++++--------- 4 files changed, 53 insertions(+), 31 deletions(-) delete mode 100644 schema/microxml.sch diff --git a/schema/README.md b/schema/README.md index 28c3674..0b06da7 100644 --- a/schema/README.md +++ b/schema/README.md @@ -1,25 +1,22 @@ # MapML -[Map Markup Language](http://maps4html.github.io/MapML/spec/) is 'MicroXML' vocabulary for maps. +[Map Markup Language](https://maps4html.org/MapML/spec/) is a proposed HTML vocabulary for maps. Although document validity is not a concept that can be strictly enforced on the internet, the documents in this directory are an attempt to provide guidance to map authors on what constitutes markup that is understood as being within scope of the MapML specification. -In principle, a MapML document should be parseable with an HTML-like parser, because -many of the elements are copied from the HTML vocabulary and are intended to have -identical processing semantics to their counterpart in HTML. +In principle, a MapML document should be parseable the HTML parser, because +many of the elements are extended from the HTML namespace and are intended to have +identical processing semantics to their counterpart in HTML apart from extensions specified in MapML. -In practice, no such MapML parser exists at the time of writing, and it should be good enough to encode -a MapML document in [MicroXML](https://dvcs.w3.org/hg/microxml/raw-file/tip/spec/microxml.html) syntax so that an XML parser can be used. When such a parser is used, +In practice, no such MapML/HTML parser exists at the time of writing, and it should be good enough to encode +a MapML document in HTML5 XML syntax so that Web browsers' XML parsers can be used. When such a parser is used, it should be possible to use the schema / schematron documents in this directory to validate certain rules of MapML documents. The schemas / schematron files in this directory are intended to -evolve as the concept of MapML evolves, and perhaps at some point when enough people -get involved we will be able to 'fork' the nu validator / parser for HTML to provide a similarly -robust parsing and validation service online. +evolve as the concept of MapML evolves. ## Instructions -The files microxml.sch (a single [schematron](http://schematron.com/) validation rule for MicroXML syntax), mapml.rnc (a [RelaxNG](http://www.relaxng.org/compact-tutorial-20030326.html) compact syntax schema) and mapml.sch (post-schema validation MapML schematron rules) are intended to be applied in that order. diff --git a/schema/mapml.rnc b/schema/mapml.rnc index 1d7b9dd..9915639 100644 --- a/schema/mapml.rnc +++ b/schema/mapml.rnc @@ -1,4 +1,5 @@ datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" +default namespace = "https://www.w3.org/1999/xhtml/" start = mapml mapml = element mapml { head?, attribute lang {text}?, body } head = element head { headContent } @@ -78,7 +79,7 @@ feature = element feature { attribute id { text }?, attribute class { text }?, attribute zoom { text }?, - (geometry? & properties?) + (geometry? & properties? & featurecaption?) } tile = element tile { attribute col { xsd:integer }, @@ -89,6 +90,7 @@ bbox = element bbox { twoPositions } image = element image { ImageModel } geometry = element geometry { GeometryContent } properties = element properties { PropertyContent } +featurecaption = element featurecaption { text? } ImageResourceMetadataAttributes = attribute src { text }, diff --git a/schema/microxml.sch b/schema/microxml.sch deleted file mode 100644 index 507435d..0000000 --- a/schema/microxml.sch +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2" - xmlns:sqf="http://www.schematron-quickfix.com/validator/process" xmlns:xs="http://www.w3.org/2001/XMLSchema-datatypes" > - <sch:pattern > - <sch:rule context="*"> - <!-- I could not figure out how to ban xmlns="", but that might be a bit extreme anyway --> - <sch:report test="exists(namespace::node()[name() ne 'xml'])">Namespaces are not allowed in MicroXML</sch:report> - </sch:rule> - </sch:pattern> -</sch:schema> \ No newline at end of file diff --git a/spec/index.html b/spec/index.html index 0ca3974..720c983 100644 --- a/spec/index.html +++ b/spec/index.html @@ -2139,7 +2139,9 @@ <h5>The <code><<dfn id="the-feature-element">feature</dfn>></code> element <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-contexts">Contexts in which this element can be used</a>:</dt> <dd>Child of the <a href="#the-body-element"><code>body</code></a> element.</dd> <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-content-model">Content model</a>:</dt> - <dd>An optional <a href="#the-geometry-element"><code>geometry</code></a> element and an optional <a href="#the-properties-element"><code>properties</code></a> element.</dd> + <dd>Optional <a href="#the-featurecaption-element"><code>featurecaption</code></a> element, + optional <a href="#the-geometry-element"><code>geometry</code></a> element, + optional <a href="#the-properties-element"><code>properties</code></a> element.</dd> <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-attributes">Content attributes</a>:</dt> <dd><a href="https://html.spec.whatwg.org/multipage/dom.html#global-attributes">Global attributes</a></dd> <dd><code>zoom</code> — the 'native' zoom level of the feature geometry.</dd> @@ -2157,8 +2159,36 @@ <h5>The <code><<dfn id="the-feature-element">feature</dfn>></code> element </dl> <p> - A <a href="#the-feature-element"><code>feature</code></a> element represents a geographic feature. A <a href="#the-feature-element"><code>feature</code></a> element has an optional <a href="#the-properties-element"><code>properties</code></a> child element, and a required child - <a href="#the-geometry-element"><code>geometry</code></a> element. + A <a href="#the-feature-element"><code>feature</code></a> element represents a map feature. + </p> + </section> + <section> + <h5>The <code><<dfn id="the-featurecaption-element">featurecaption</dfn>></code> element</h5> + <dl class="def"> + <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-categories">Categories</a>:</dt> + <dd>Feature data.</dd> + <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-contexts">Contexts in which this element can be used</a>:</dt> + <dd>Child of the <a href="#the-feature-element"><code>feature</code></a> element.</dd> + <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-content-model">Content model</a>:</dt> + <dd><a href="https://html.spec.whatwg.org/multipage/dom.html#flow-content">Flow content</a>.</dd> + <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-attributes">Content attributes</a>:</dt> + <dd>N/A.</dd> + <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-dom">DOM interface</a>:</dt> + <dd> + <pre class="idl"> + [Exposed=Window] + interface HTMLFeaturecaptionElement : HTMLElement { + [HTMLConstructor] constructor(); + + }; + </pre> + </dd> + </dl> + <p> + The <a href="#the-featurecaption-element"><code>featurecaption</code></a> element + represents a caption for the contents of the + <a href="#the-featurecaption-element"><code>featurecaption</code></a> element's + parent <a href="#the-feature-element"><code>feature</code></a> element. </p> </section> <section> @@ -2167,9 +2197,9 @@ <h5>The <code><<dfn id="the-properties-element">properties</dfn>></code> e <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-categories">Categories</a>:</dt> <dd>Feature data.</dd> <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-contexts">Contexts in which this element can be used</a>:</dt> - <dd>A child of the <a href="#the-feature-element"><code>feature</code></a> element, containing elements representing the properties of the feature.</dd> + <dd>A child of the <a href="#the-feature-element"><code>feature</code></a> element.</dd> <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-content-model">Content model</a>:</dt> - <dd>One or more unknown elements with text values. <div class="ednote">TODO: Allow HTML content.</div></dd> + <dd><a href="https://html.spec.whatwg.org/multipage/dom.html#palpable-content">Palpable content</a></dd> <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-attributes">Content attributes</a>:</dt> <dd>N/A.</dd> <dt><a href="https://html.spec.whatwg.org/multipage/dom.html#concept-element-dom">DOM interface</a>:</dt> @@ -2183,9 +2213,6 @@ <h5>The <code><<dfn id="the-properties-element">properties</dfn>></code> e </dd> </dl> - <p> - A <a href="#the-feature-element"><code>feature</code></a> element can have zero or one <a href="#the-properties-element"><code>properties</code></a> element, which contains zero or more unknown elements, whose content is text. - </p> </section> <section> <h5>The <code><<dfn id="the-geometry-element">geometry</dfn>></code> element</h5> @@ -2211,8 +2238,14 @@ <h5>The <code><<dfn id="the-geometry-element">geometry</dfn>></code> eleme </dd> </dl> - <p>A <a href="#the-geometry-element"><code>geometry</code></a> element has one child element, which can be a <a href="#the-point-element"><code>point</code></a>, - <a href="#the-linestring-element"><code>linestring</code></a>, <a href="#the-polygon-element"><code>polygon</code></a>, <a href="#the-multipoint-element"><code>multipoint</code></a>, <a href="#the-multilinestring-element"><code>multilinestring</code></a>, <a href="#the-multipolygon-element"><code>multipolygon</code></a>, or <a href="#the-geometrycollection-element"><code>geometrycollection</code></a>.</p> + <p>A <a href="#the-geometry-element"><code>geometry</code></a> element has one child element, + which can be a <a href="#the-point-element"><code>point</code></a>, + <a href="#the-linestring-element"><code>linestring</code></a>, + <a href="#the-polygon-element"><code>polygon</code></a>, + <a href="#the-multipoint-element"><code>multipoint</code></a>, + <a href="#the-multilinestring-element"><code>multilinestring</code></a>, + <a href="#the-multipolygon-element"><code>multipolygon</code></a>, or + <a href="#the-geometrycollection-element"><code>geometrycollection</code></a>.</p> <table id="geometry-values" class="def"> <thead>