[Bug 28174] New: [F+O 3.1] schema for json-to-xml() namespace: automatically imported?

https://www.w3.org/Bugs/Public/show_bug.cgi?id=28174

            Bug ID: 28174
           Summary: [F+O 3.1] schema for json-to-xml() namespace:
                    automatically imported?
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath 3.1
          Assignee: jonathan.robie@gmail.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org

The spec of json-to-xml() defines a schema for the target namespace
http://www.w3.org/2005/xpath-functions/json.

The spec states that 

(a) a particular error occurs "if the processor is not schema-aware"

(b) if the processor is schema-aware, then for validation to succeed, the
schema does not need to be explicitly imported

(c) <quote>
If the stylesheet or query does import a schema for the namespace
http://www.w3.org/2005/xpath-functions/json, then:

* The processor (if it is schema-aware) must recognize an import declaration
for this namespace, whether or not a schema location is supplied.

* If a schema location is provided, then the schema document at that location
must be equivalent to the schema document at C.2 Schema for the result of
fn:json-to-xml; the effect if it is not equivalent is ·implementation
dependent·

It's not clear that any of these statements should properly appear in the F+O
spec.

(a) Both XSLT and XQuery have some kind of notion that schema-awareness is
optional, but the details vary, and they could vary again in other host
languages

(b) importing a schema is a host language concept

It would be better in F+O only to refer to properties of the static and dynamic
context. Probably it should say simply that the schema components for this
namespace must be present in the in-scope schema definitions for validation to
succeed. This isn't ideal, because the in-scope schema definitions are part of
the static context, and there's absolutely no reason that these schema
definitions need to be available at compile time (they are only needed at
evaluation time). But introducing a notion that we can have schema definitions
present in the dynamic context that weren't present in the static context is
probably overkill.

That leaves the question what XQuery, XPath, and XSLT should say about how the
static context is populated and whether it should always include components for
this namespace. That decision can be made separately for each host language.
For XSLT the rule in effect has been that if you want to refer to the schema
components explicitly by name, e.g. in "instance of", you have to import the
namespace, but if you just want to invoke validation, you don't. That's
consistent with the way things like <xsl:element validation="strict"/> work in
XSLT, though it can't really be explained fully in terms of the static and
dynamic context as currently defined.

It also leaves the question about whether and how F+O can make the statement
that "a particular error occurs "if the processor is not schema-aware". Perhaps
it should say that the error occurs if these schema components are not
available in the context, and leave it to the host language specs to make clear
that the components will not be in the context if the processor is "not
schema-aware".

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 9 March 2015 11:37:46 UTC