[Bug 3946] [FS] Typing of processing-instructions

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3946


jmdyck@ibiblio.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Comment #2 from jmdyck@ibiblio.org  2007-05-08 02:06 -------
(personal response)

I agree, the Formal Semantics does appear to be wrong in this respect.

Proposed solution:

A)
The formal type system must model the target of a PI. In analogy to ElementType
and AttributeType, we can define (in 2.4.2 Item types, duplicated in A.2):
    [? (Formal)] ProcessingInstructionType ::=
                     "processing-instruction" PITargetOrWildcard
    [? (Formal)] PITargetOrWildcard ::= NCName | "*"

In [27 (Formal)] ElementContentType, replace
    "processing-instruction"
with
    ProcessingInstructionType

B)
Except as handled otherwise below, wherever
    processing-instruction
appears as a type, replace it with
    processing-instruction *

Specifically, that would be in:
    3.5.1 / example 1,7
    3.5.4 / Norm / rule 17,18,19,20,25,26
    4.7.3.1 / STA / rule 1,2,3,4
    4.7.3.1 / DEv / rule 1,2
    4.7.3.3 / DEv / rule 1,2
    4.7.3.5 / STA / rule 2
    7.1.5 / STA / rule 1
    7.1.6 / STA / rule 1
    7.2.5 / STA / rule 3,4
    7.2.6 / STA / rule 6
    8.1.7 / Sem / rule 1,2
    8.2.2.1.3 / Sem / rule 8,9
    8.2.2.1.4 / Sem / rule 6
    8.2.2.1.5 / Sem / rule 3
    8.3.1 / Sem / rule 4

C)
In 3.5.4 / Norm, delete the paragraph beginning "The [XPath/XQuery] type system
does not model the target of a processing-instruction", and replace the two
subsequent rules (21 & 22) with:

    [[ processing-instruction(NCName) ]]_sequencetype
        ==
    processing-instruction NCName

    StringLiteral has atomic value String
    xs:NCName(String) = NCName
    --------------------------------------------------------
    [[ processing-instruction(StringLiteral) ]]_sequencetype
        =
    processing-instruction NCName

D)
In 4.7.3.5 / STA / rule 1 / conclusion, change the type to
    processing-instruction NCName

E)
In 8.2.3.1.2 / Sem 4 (Processing instruction, comment, and text kind tests),
replace rule 1 with:

    [[ PITest ]]_sequencetype = processing-instruction *
    -----------------------------
    statEnv |- test PITest with PrincipalNodeKind
               of ProcessingInstructionType
               : ProcessingInstructionType

And replace rule 2 with:

    [[ PITest ]]_sequencetype = processing-instruction NCName
    -----------------------------
    statEnv |- test PITest with PrincipalNodeKind
               of processing-instruction NCName
               : processing-instruction NCName

    [[ PITest ]]_sequencetype = processing-instruction NCName
    -----------------------------
    statEnv |- test PITest with PrincipalNodeKind
               of processing-instruction *
               : processing-instruction NCName ?

F)
In 8.3.1 / Sem, after rule 4, insert

    statEnv |- processing-instruction NCName { String }
               matches processing-instruction NCName

Received on Tuesday, 8 May 2007 02:06:40 UTC