ACTION A-645-07: schema for serialization parameters

I was assigned an action to revise the serialization schema to avoid
problems with the Microsoft schema processor.

> ACTION A-645-07: MSM to prepare a schema with a workaround for the 
> issue reported in bug 29658 and post it. 
> 
> Status: Pending; ETA 2016-06-21 

I attach a draft copy of the new schema.  There are two points that
may need WG discussion (items 2 and 3 below).

1 The change is not minimal; in making it, I created several new named
types because I find names helpful in reading schemas:

  output:EQName (what the XPath spec calls a URIQualifiedName)
  output:Qualified-EQName (restriction of above, requires non-nil URI)
  output:Prefixed-QName (QName with a prefix)
  output:Namespaced-Name (Qualified-EQName or Prefixed-QName)

I have tested this against the document shown below, which has various
examples of method-type and/or json-node-output-method-type.  All the
items valid against the old schema are valid against the new schema,
and all the items invalid against the old schema are invalid against
the new one, with the exceptions noted below.

2 The literal "Q{ }bar" is accepted by the status-quo schema and
rejected by the new one.  The old one uses the pattern

  (.*\{.+\}.*)

to force the namespace name to be non-empty; the new schema uses

  Q\{(.*\S.*)\}.*

Perhaps the 'Q' should be '.*', but 'Q' seemed clearer.

I realize this is a change unrelated to the bug report, but unless I
have misunderstood the point, it's a change that needs to be made.

3 The current schema prohibits whitespace within a URIQualifiedName,
e.g. it makes "Q {http://example.com/nss/foo} bar" and "Q {
http://example.com/nss/foo } bar" and similar variations illegal as
EQNames.

I think the whitespace rules of XPath say that this should be legal,
since the grammar given in XPath is

[117] URIQualifiedName ::= BracedURILiteral NCName
[118] BracedURILiteral ::= "Q" "{" [^{}]* "}"

and neither rule carries the /* ws:explicit */ annotation.

So the new schema makes these values legal.

The new schema is attached; the test document is appended so it can be
read, as well as being attached for the convenience of those who would
like to use it.

--CMSMcQ

<?xml version="1.0" encoding="UTF-8"?>
<s:serialization-parameters 
  xmlns:s="http://www.w3.org/2010/xslt-xquery-serialization"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:foo="http://example.com/nss/foo"
  xsi:schemaLocation="
    http://www.w3.org/2010/xslt-xquery-serialization 
    schema-for-serialization-parameters.xsd"
  >

  <!--* Was valid, stays valid *-->
  <s:method xml:id="method-v-htm" value="html"/>
  <s:method xml:id="method-v-tex" value="text"/>
  <s:method xml:id="method-v-xml"  value="xml"/>
  <s:method xml:id="method-v-xht" value="xhtml"/>
  <s:method xml:id="method-v-jso" value="json"/>
  <s:method xml:id="method-v-ada" value="adaptive"/>
  <s:method xml:id="method-v-QNm" value="foo:bar"/>
  <s:method xml:id="method-v-EQ1" value="Q{http://example.com/nss/foo}bar"/>
  <s:method xml:id="method-v-EQ2" value="Q{ http://example.com/nss/foo }bar"/>
  <!--* I'm not sure the following should be valid, but this
      * is valid against the status-quo schema. *-->
  <s:method xml:id="method-v-EQ4" value="Q{ 
    http://www.w3.org/2010/xslt-xquery-serialization 
    schema-for-serialization-parameters.xsd }bar"/>
  
  <s:json-node-output-method xml:id="json-v-htm" value="html"/>
  <s:json-node-output-method xml:id="json-v-tex" value="text"/>
  <s:json-node-output-method xml:id="json-v-xml"  value="xml"/>
  <s:json-node-output-method xml:id="json-v-xht" value="xhtml"/>
  <s:json-node-output-method xml:id="json-v-QNm" value="foo:bar"/>
  <s:json-node-output-method xml:id="json-v-EQ1" value="Q{http://example.com/nss/foo}bar"/>
  <s:json-node-output-method xml:id="json-v-EQ2" value="Q{ http://example.com/nss/foo }bar"/>
  <s:json-node-output-method xml:id="json-v-EQ4" value="Q{ 
    http://www.w3.org/2010/xslt-xquery-serialization 
    schema-for-serialization-parameters.xsd }bar"/>
  
  <!--* Was invalid, stays invalid *-->
  <s:method xml:id="method-inv-HTM" value="HTML"/>
  <s:method xml:id="method-inv-xml" value="XML"/>
  <s:method xml:id="method-inv-QNm" value="bar"/>
  <s:method xml:id="method-inv-EQ1" value="Q{}bar"/>
  
  <s:json-node-output-method xml:id="json-inv-jso" value="json"/>
  <s:json-node-output-method xml:id="json-inv-ada" value="adaptive"/>
  <s:json-node-output-method xml:id="json-inv-htm" value="TEXT"/>
  <s:json-node-output-method xml:id="json-inv-tex" value="XHTML"/>
  <s:json-node-output-method xml:id="json-inv-QNm" value="bar"/>
  <s:json-node-output-method xml:id="json-inv-EQ1" value="Q{ } bar"/>
  <s:json-node-output-method xml:id="json-inv-EQ2" value="Q{} bar"/>
  <s:json-node-output-method xml:id="json-inv-EQ3" value="Q {}bar"/>
  <s:json-node-output-method xml:id="json-inv-EQ4" value="Q{}bar"/>
  
   
  <!--* Was valid, becomes invalid *-->
  <s:method xml:id="method-v-i-EQ1" value="Q{ }bar"/>
  <s:json-node-output-method xml:id="json-v-i-EQ1" value="Q{  }bar"/>
  
  <!--* Was invalid, becomes valid *-->
  <s:method xml:id="method-i-v-EQ1" value="Q{ http://example.com/nss/foo } bar"/>
  <s:method xml:id="method-i-v-EQ2" value="Q { http://example.com/nss/foo }bar"/>
  <s:method xml:id="method-i-v-EQ3" value="Q { http://example.com/nss/foo } bar"/>
  
  <s:json-node-output-method xml:id="json-i-v-EQ1" value="Q{http://example.com/nss/foo} bar"/>
  <s:json-node-output-method xml:id="json-i-v-EQ1" value="Q {http://example.com/nss/foo}bar"/>
  <s:json-node-output-method xml:id="json-i-v-EQ1" value="Q {http://example.com/nss/foo} bar"/>
  
</s:serialization-parameters>
-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************

Received on Tuesday, 21 June 2016 02:18:51 UTC