Errata for XQuery 1.0 and XPath 2.0 Formal Semantics

31 March 2009

Latest version:
http://www.w3.org/XML/2007/qt-errata/xquery-semantics-errata.html
Editor:
Michael Dyck, mailto:jmdyck@ibiblio.org

Abstract

This document addresses errors in the XQuery 1.0 and XPath 2.0 Formal Semantics Recommendation published on 23 January 2007. It records all errors that, at the time of this document's publication, have solutions that have been approved by the XSL Working Group and the XML Query Working Group. For updates see the latest version of that document.

The errata are numbered, and are listed in reverse chronological order of their date of origin. Each erratum is classified as Substantive, Editorial, or Markup. These categories are defined as follows:

Each entry contains the following information:

Colored boxes and shading are used to help distinguish new text from old, however these visual clues are not essential to an understanding of the change. The styling of old and new text is an approximation to its appearance in the published Recommendation, but is not normative. Hyperlinks are shown underlined in the erratum text, but the links are not live.

A number of indexes appear at the end of the document.

Substantive corrections are proposed by the XSL Working Group and the XML Query Working Group (part of the XML Activity), where there is consensus that they are appropriate; they are not to be considered normative until approved by a Call for Review of Proposed Corrections or a Call for Review of an Edited Recommendation.

Please report errors in this document using W3C's public Bugzilla system (instructions can be found at http://www.w3.org/XML/2005/04/qt-bugzilla). If access to that system is not feasible, you may send your comments to the W3C XSLT/XPath/XQuery public comments mailing list, public-qt-comments@w3.org. It will be very helpful if you include the string [FSerrata] in the subject line of your report, whether made in Bugzilla or in email. Each Bugzilla entry and email message should contain only one error report. Archives of the comments and responses are available at http://lists.w3.org/Archives/Public/public-qt-comments/.

Status of this Document

This is a public draft. None of the errata reported in this document have been approved by a Call for Review of Proposed Corrections or a Call for Review of an Edited Recommendation. As a consequence, they must not be considered to be normative.

The Working Group does not intend to progress these errata to normative status; instead, it intends to publish a second edition of the Recommendation incorporating these errata, and to progress the second edition to normative status.

Table of Contents

  Errata

     FS.E062   Don't define the static type of the namespace axis.

     FS.E061   Fix unsoundness of 'data on' judgment.

     FS.E060   Fix behaviour of following-sibling axis re attribute nodes.

     FS.E059   Fix various bugs in the 'union interpretation' rules.

     FS.E058   Fix the static typing for ValidateExpr.

     FS.E057   Fix the static typing for fs:convert-operand().

     FS.E056   Fix italicization in C.2 [Mapping of Overloaded Internal Functions].

     FS.E055   Change wording re fs:convert-operand in 4.5.2 [General Comparisons].

     FS.E054   Fix typo in 8.4 [Judgments for FLWOR and other expressions on sequences].

     FS.E053   Fix incorrect references to standard functions/operators.

     FS.E052   Change some wording in 4.7.1 [Direct Element Constructors].

     FS.E051   Correctly render metavariables in mapping subscripts.

     FS.E050   Fix typo in 4.2.1 [Steps].

     FS.E049   Minor changes in 4.1.5 [Function Calls] / Dynamic Evaluation.

     FS.E048   Change some wording in 4.1.5 [Function Calls] / Static Type Analysis.

     FS.E047   Change some wording in 4.1.5 [Function Calls] / Normalization.

     FS.E046   Fix typos in 4 [Expressions].

     FS.E045   Fix typo in 3.2.2 [Normalization mapping rules].

     FS.E044   Fix typo in 2.5 [Functions and operators].

     FS.E043   Fix typos in 2.4.4 [Top level definitions].

     FS.E042   In the production for Definitions, add a semicolon after each Definition.

     FS.E041   Fix typos in 2.4.3 [Content models].

     FS.E040   Fix typos in 2.4.1 [XML Schema and the [XPath/XQuery] Type System].

     FS.E039   Fix typo in 2.3.2 [Examples of values].

     FS.E038   Fix typos in 2.3.1 [Formal values].

     FS.E037   Fix typo in 2.1.4 [Notations for inference rules].

     FS.E036   Introduce Formal symbol OptDerivation.

     FS.E035   Fix typo in 5.14 [Variable Declaration].

     FS.E034   Adjust the formatting of a rule in 8.2.2.2 [Dynamic semantics of axes].

     FS.E033   Fix the static typing for numeric and aggregate functions.

     FS.E032   Rework the rules for CastableExpr to avoid raising type errors (and fix various other problems).

     FS.E031   Don't use the "interleave with empty text nodes" technique for attribute constructors.

     FS.E030   Fix cross-reference in 4.7.3.4.

     FS.E029   Don't use the "interleave with empty text nodes" technique for element constructors.

     FS.E028   Call fn:boolean() in normalization of Where clause

     FS.E027   Provide (non-default) static typing for fn:not().

     FS.E026   Fix small errors in section 7.2.4 [The fn:boolean function].

     FS.E025   For internal function fs:div, correct the result type in the Binary Operators table.

     FS.E024   Introduce fs:item-at() function.

     FS.E023   ElementNameOrWildcard and AttributeNameOrWildcard do not derive empty.

     FS.E022   Make the static typing of processing-instructions consistent with their dynamic typing.

     FS.E021   Avoid loss of type information in normalized path expressions.

     FS.E020   Correct errors in examples in section 2.4.4.

     FS.E019   Correct a normalization error in section 4.3.2 Filter Expressions.

     FS.E018   Correct various errors in section 8.2.3.1.1.

     FS.E017   Update the "Processing Model" diagram.

     FS.E016   For internal function fs:idiv, correct the operand types and supporting op: function given in the Binary Operators table.

     FS.E015   Fix some small errors in section 8.4.

     FS.E014   Fix small errors in section 7.2.3.

     FS.E013   Fix small errors in sections 7.2.1 and 7.2.2.

     FS.E012   Static Type Analysis must allow for empty text nodes introduced during normalization of direct element constructors.

     FS.E011   Correct/simplify/complete the Normalization rules defining []ElementContent and []AttributeContent, and simplify the corresponding Dynamic Evaluation rules.

     FS.E010   Clean up due to the removal of op:anyURI-equal from the F+O spec.

     FS.E009   Fix some errors in the productions for FunctionSig and TypeList.

     FS.E008   Fix a bug in the normalization of function calls.

     FS.E007   Fix miscellaneous small errors in section 5.

     FS.E006   Fix problems involving the domains of statEnv.funcType and dynEnv.funcDefn: Although section 3.1.1 declares the domain of statEnv.funcType to be (expanded-QName, arity), some inference rules neglect the arity.

     FS.E005   Put 'Expr' in parentheses when it occurs as a function argument.

     FS.E004   Fix typo in function signature.

     FS.E003   Complete the changes entailed by adding a local-namespaces component to the Core CompElemConstructor.

     FS.E002   Both Core and Formal grammars had symbols 'NamespaceBinding' and 'NamespaceBindings'.

     FS.E001   Make normalization of DirAttributeValue more explicit.

  Indexes

    Index by Bugzilla entry

    Index by section

    Index by production


FS.E062 - substantive

See Bug 5452

Description

Don't define the static type of the namespace axis.

History

23 Oct 2008: Proposed

24 Feb 2009: Accepted

6 Mar 2009: Issued

Change

In 8.2.2.1.6 Inference rules for the namespace axis / Semantics, replace:

The type for the namespace axis is always empty.


statEnv |-  axis namespace:: of NodeType : empty

with:

This document does not specify inference rules for the namespace axis (which is allowed, though deprecated, in XPath 2.0, and is not allowed in XQuery 1.0). Implementations choosing to support the namespace axis will need to define an additional node kind for namespace nodes in the type hierarchy, and to add the appropriate inference rules.

FS.E061 - substantive

See Bug 4273

Description

Fix unsoundness of 'data on' judgment.

History

7 Feb 2009: Proposed

17 Feb 2009: Accepted

17 Feb 2009: Issued

Change

In 7.2.6 The fn:data function / Static Type Analysis, replace:

When applied to an element type whose type annotationXQ denotes a complex type of mixed content, the data on filter returns xs:untypedAtomic.

statEnv |-  ElementType type lookup of type TypeName
statEnv |-  TypeName of elem/type expands to expanded-QName      statEnv.typeDefn(expanded-QName) = define type TypeName Derivation mixed { Type1 }

statEnv |-  data on ElementType : xs:untypedAtomic

The data on filter is not defined on any element type whose type annotationXQ denotes a complex type of complex content and therefore applying data on to such a node raises a static error.

with:

For any element node whose type annotationXQ is a complex type with element-only content, the typed-value is undefined, and applying fn:data to such a node raises a type error. Consequently, the data on judgment is not defined on any element type whose type annotationXQ denotes a complex type of element-only content. Attempting to apply data on to such a type raises a type error.

Because we can derive complex types with element-only content from complex types with mixed content (including xs:anyType), the data on judgment is also not defined on any element type whose type annotationXQ is a complex type of mixed content (other than xs:untyped, which is handled above). Attempting to satisfy the data on judgment for such a type will fail, and the processor will raise a type error.

FS.E060 - substantive

See Bug 6538

Description

Fix behaviour of following-sibling axis re attribute nodes.

History

7 Feb 2009: Proposed

11 Feb 2009: Accepted

16 Feb 2008: Issued

Changes

  1. In 4.2.1.1 Axes / Normalization / rule 1, replace:

     
    [following-sibling:: NodeTest]Axis
    ==
    [ let $e := . return $e/parent::node()/child:: NodeTest [.>>$e] ]Expr

    with:

     
    [following-sibling:: NodeTest]Axis
    ==
    [
    let $e := .
    where fn:not($e/self::attribute())
    return $e/parent::node()/child:: NodeTest [.>>$e]
    ]Expr
  2. In 4.2.1.1 Axes / Normalization / rule 2, replace:

     
    [following:: NodeTest]Axis
    ==
    [ ancestor-or-self::node()/following-sibling::node()/descendant-or-self:: NodeTest ]Expr

    with:

     
    [following:: NodeTest]Axis
    ==
    [
    let $e := .
    return
      fn:root() / descendant:: NodeTest [. >> $e]
      except
      $e / descendant::node()
    ]Expr

FS.E059 - substantive

See Bug 4189

Description

Fix various bugs in the 'union interpretation' rules.

History

2 Feb 2009: Proposed

10 Feb 2009: Accepted

16 Feb 2009: Issued

Changes

  1. In 8.1.9 Type expansion, replace:

    The judgment takes a type name and computes the union of all types derived from the given type. ... The judgment depends on the extended with union interpretation of judgment to recursively compute all derived types.

    with:

    The judgment takes a type name and computes the union of all types derived from the given type. ... The judgment depends on the union interpretation of judgment to recursively compute all derived types.

  2. In 8.1.9 Type expansion / Semantics / rule 2, replace:

    statEnv.typeDefn(expanded-QName) = define type TypeName extends BaseTypeName OptMixed { Type1 }
    statEnv |-  Type2 is Type1 extended with union interpretation of TypeName
    statEnv |- OptMixed Type2 adjusts to Type3

    with:

    statEnv.typeDefn(expanded-QName) = Definition
    statEnv |- union interpretation of Definition is TypeU
    statEnv |- TypeU adjusts to Type3
  3. In 8.1.9 Type expansion / Semantics / rule 3, replace:

    statEnv.typeDefn(expanded-QName) = define type xs:untyped extends xs:anyType { Type1 }

    with:

    statEnv.typeDefn(expanded-QName) = define type xs:untyped restricts xs:anyType { Type1 }
  4. In 8.1.10 Union interpretation of derived types / Notation, replace:

    The judgment

    statEnv |- Type2isType1extended with union interpretation ofTypeName

    holds when the type Type2 is the expansion of the type name TypeName with definition Type1 to include all types derived by extension and restriction from the given type name. This rule is recursive, because each type name itself may have other type names that are derived from it. The recursive rules traverse the entire derivation tree, identifying every type name derived from the original type name.

    with:

    The judgment

    statEnv |- union interpretation ofDefinitionisTypeU

    holds when the type TypeU is the union of all types derived (directly and indirectly, by extension and restriction) from the type defined by Definition.

  5. In 8.1.10 Union interpretation of derived types / Semantics, replace:

    No type derives from TypeName0

    statEnv |- Type0 is Type0 extended with union interpretation of TypeName0

    statEnv.typeDefn(expanded-QNameR,1) = define type TypeNameR,1 restricts TypeName0 OptMixedR,1 { TypeR,1 }
    · · ·
    statEnv.typeDefn(expanded-QNameR,n) = define type TypeNameR,n restricts TypeName0 OptMixedR,n { TypeR,n }
    statEnv |-  TypeR,1' is TypeR,1 extended with union interpretation of TypeNameR,1
    · · ·
    statEnv |-  TypeR,n' is TypeR,n extended with union interpretation of TypeNameR,n
    statEnv.typeDefn(expanded-QNameE,1) = define type TypeNameE,1 extends TypeName0 OptMixedE,1 { TypeE,1 }
    · · ·
    statEnv.typeDefn(expanded-QNameE,m) = define type TypeNameE,m extends TypeName0 OptMixedE,m { TypeE,m }
    statEnv |-  TypeE,1' is TypeE,1 extended with union interpretation of TypeNameE,1
    · · ·
    statEnv |-  TypeE,m' is TypeE,m extended with union interpretation of TypeNameE,m
    Type1 = TypeR,1' | · · · | TypeR,n' | Type0 | (Type0, TypeE,1' ) | · · · | (Type0,TypeE,m')

    statEnv |- Type1 is Type0 extended with union interpretation of TypeName0

    with:

    statEnv |- Definition = define type TypeName OptDerivation OptMixed { Type }
    statEnv |- inheritance due to OptDerivation is TypeI
    statEnv |- OptMixed (TypeI, Type) opt-mixes to TypeM
    statEnv |- type definitions derived from TypeName are Definition 1 ... Definition n
    statEnv |- union interpretation of Definition 1 is Type1
    ...
    statEnv |- union interpretation of Definition n is Typen
    TypeM | Type1 | ... | Typen = TypeU

    statEnv |- union interpretation of Definition is TypeU

    The auxilliary judgment

    statEnv |- inheritance due toOptDerivationisType

    looks "up" the type hierarchy to find out what OptDerivation contributes to the content model of a derived type. It is defined as follows:

    statEnv |- TypeName of elem/type expands to expanded-QName
    statEnv.typeDefn(expanded-QName) = define type TypeName' OptDerivation OptMixed { Type }
    statEnv |- inheritance due to OptDerivation is TypeI

    statEnv |- inheritance due to extends TypeName is (TypeI, Type)


    statEnv |- inheritance due to restricts TypeName is empty


    statEnv |- inheritance due to is empty

    The auxiliary judgment:

    statEnv |- OptMixedType1opt-mixes toType2

    holds when Type2 is the result of making Type1 'mixed' or not, as determined by OptMixed. It is defined as follows:

    statEnv |- Type1 mixes to Type2

    statEnv |- mixed Type1 opt-mixes to Type2


    statEnv |- Type1 opt-mixes to Type1

    Finally, the auxiliary judgment:

    statEnv |- type definitions derived fromTypeNameareDefinition 1 ... Definition n

    is defined informally: all type definitions in statEnv.typeDefn that involve "restricts TypeName" or "extends TypeName" are returned as a list (in arbitrary order) of Definitions.

    and replace:

                    define type T1 { element a }
                    define type T2 extends T1 { element b }
                    
                    (element a | element a, element b) is (element a) extended with union interpretation of T1
                    

    with:

                    define type T1 { element a }
                    define type T2 extends T1 { element b }
                    
                    union interpretation of 
                        define type T1 { element a }
                    is
                        (element a | element a, element b)
                    

    and replace:

                    (element a, (() | element b)) is (element a) extended with union interpretation of T1
                    

    with:

                    union interpretation of 
                        define type T1 { element a }
                    is
                        (element a, (() | element b))
                    

FS.E058 - substantive

See Bug 5254

Description

Fix the static typing for ValidateExpr.

History

1 Feb 2009: Proposed

3 Feb 2009: Accepted

15 Feb 2009: Issued

Change

In 4.13 Validate Expressions / Static Type Analysis, replace:

Static typing of the validate operation is defined by the following rule. Note the use of a subtyping check to ensure that the type of the expression to validate is either an element or a well-formed document node (i.e., with only one root element and no text nodes). The type of the expression to validate may be a union of more than one element type. We apply the with mode judgment to each element type to determine the meaning of that element type with the given validation mode, which yields a new element type. The result type is the union over all new element types.

statEnv |- Expr : Type
statEnv |- Type <: (element * | document { ElementType })
statEnv |- prime(Type) = ElementType1 | ... | ElementTypen
ElementType1 = element ElementNameOrWildcard 1 OptTypeSpecifier 1
···
ElementTypen = element ElementNameOrWildcard n OptTypeSpecifier n
statEnv |- ElementNameOrWildcard 1 with mode ValidationMode resolves to ElementType1
···
statEnv |- ElementNameOrWildcard n with mode ValidationMode resolves to ElementTypen
Type1 = ElementType1 | ... | ElementTypen

statEnv |- validate ValidationMode { Expr } : Type1

with:

Static typing of the validate operation begins with the following rule. We infer the type of the argument expression, and ensure that it is consistent with a run-time argument that is either an element or a well-formed document node (i.e., with only one root element and no text nodes). Then we hand off the type and the validation mode to the validate judgment.

statEnv |- Expr : Type
statEnv |- Type <: element * | document { element * & (processing-instruction * | comment)* }
statEnv |- validate ValidationMode Type : TypeU

statEnv |- validate ValidationMode { Expr } : TypeU

Because the type of the argument expression may be a union of multiple element and document types, the judgment:

statEnv |- validateValidationModeType:TypeU

extracts the prime type of the argument type, applies the validate item type judgment to each type in the union, and yields the union of the results.

prime(Type) = FormalItemType 1 | ... | FormalItemType n
statEnv |- validate ValidationMode item type FormalItemType 1 : Type1
...
statEnv |- validate ValidationMode item type FormalItemType n : Typen
Type1 | ... | Typen = TypeU

statEnv |- validate ValidationMode Type : TypeU

The judgement

statEnv |- validateValidationModeitem typeFormalItemType:Type

does a case analysis on the different item types that it can encounter.

DocumentType = document { Type }
statEnv |- validate ValidationMode Type : TypeU

statEnv |- validate ValidationMode item type DocumentType : document { TypeU }

ElementType = element ElementNameOrWildcard OptTypeSpecifier
statEnv |- ElementNameOrWildcard with mode ValidationMode resolves to ElementType'

statEnv |- validate ValidationMode item type ElementType : ElementType'


statEnv |- validate ValidationMode item type ProcessingInstructionType : none


statEnv |- validate ValidationMode item type comment : none

FS.E057 - substantive

See Bug 6160

Description

Fix the static typing for fs:convert-operand().

History

14 Oct 2008: Proposed

11 Nov 2008: Accepted

15 Feb 2009: Issued

Changes

  1. In 7.1.1 The fs:convert-operand function / Static Type Analysis, replace:

    No conversion is needed unless $actual is an instance of type xs:untypedAtomic.

    statEnv  |-  not(Type1 <: xs:untypedAtomic?)

    statEnv |-  (FS-URI,"convert-operand")( Type1, Type2) : Type1

    Pairs of untyped atomic operands are converted to strings.

    statEnv |- Type1 <: xs:untypedAtomic ?
    statEnv |- Type2 <: (xs:untypedAtomic| xs:string)

    statEnv |-  (FS-URI,"convert-operand")( Type1, Type2) : xs:string · quantifier (Type1)

    When an untyped operand is paired with a numeric operand, it is converted to xs:double.

    statEnv |- Type1 <: xs:untypedAtomic ?
    statEnv |- Type2 <: fs:numeric

    statEnv |-  (FS-URI,"convert-operand")( Type1, Type2) : xs:double · quantifier (Type1)

    Finally, an untyped atomic operand not dealt with by the above rules is converted to the type of the other operand.

    statEnv |- Type1 <: xs:untypedAtomic ?
    statEnv |- Type2 <: xs:anyAtomicType
    statEnv  |-  not(Type2 <: (xs:untypedAtomic| xs:string|fs:numeric))

    statEnv |-  (FS-URI,"convert-operand")( Type1, Type2) : Type2 · quantifier(Type1)

    with:

    To analyze a call to fs:convert-operand, we extract the prime type of the static type of each of the two arguments. (Each prime type will be a union of atomic types.) We consider all possible pairs formed by taking one atomic type from each prime type, apply the convert_operand judgment to each pair, form the union of the results, and adjust that by the quantifier of the first argument's type.

    statEnv |- TypeA <: xs:anyAtomicType?
    statEnv |- TypeE <: xs:anyAtomicType
    prime(TypeA) = AtomicTypeName A1 | ... | AtomicTypeName Am
    prime(TypeE) = AtomicTypeName E1 | ... | AtomicTypeName En
    statEnv |- convert_operand AtomicTypeName A1 against AtomicTypeName E1 is AtomicTypeName 1,1
    ...
    statEnv |- convert_operand AtomicTypeName A1 against AtomicTypeName En is AtomicTypeName 1,n
    ...
    statEnv |- convert_operand AtomicTypeName Am against AtomicTypeName E1 is AtomicTypeName m,1
    ...
    statEnv |- convert_operand AtomicTypeName Am against AtomicTypeName En is AtomicTypeName m,n
    AtomicTypeName 1,1 | ... | AtomicTypeName m,n = TypeR

    statEnv |- (FS-URI,"convert-operand")( TypeA, TypeE) : TypeR . quantifier(TypeA)

    The auxiliary judgment:

    statEnv |- convert_operandAtomicTypeName AagainstAtomicTypeName EisAtomicTypeName R

    is the static analog of the fs:convert-operand function. It is defined by the following rules.

    No conversion is needed if the first argument isn't an instance of type xs:untypedAtomic.

    statEnv |- not(AtomicTypeName A <: xs:untypedAtomic)

    statEnv |- convert_operand AtomicTypeName A against AtomicTypeName E is AtomicTypeName A

    The remaining rules cover the cases when the first argument is an instance of type xs:untypedAtomic. The outcome depends on the type of the second argument.

    If the second argument is of type xs:untypedAtomic or xs:string, the first is converted to a string.

    statEnv |- AtomicTypeName A <: xs:untypedAtomic
    statEnv |- AtomicTypeName E <: xs:untypedAtomic | xs:string

    statEnv |- convert_operand AtomicTypeName A against AtomicTypeName E is xs:string

    If the second argument is numeric, the first is converted to xs:double.

    statEnv |- AtomicTypeName A <: xs:untypedAtomic
    statEnv |- AtomicTypeName E <: fs:numeric

    statEnv |- convert_operand AtomicTypeName A against AtomicTypeName E is xs:double

    Otherwise, the first argument is converted to the type of the second argument.

    statEnv |- AtomicTypeName A <: xs:untypedAtomic
    statEnv |- not(AtomicTypeName E <: xs:untypedAtomic | xs:string | fs:numeric)

    statEnv |- convert_operand AtomicTypeName A against AtomicTypeName E is AtomicTypeName E

  2. In 8.4 Judgments for FLWOR and other expressions on sequences / Semantics 1, insert:

    Note

    This function is typically used in judgments of the form:

    prime(Type) = FormalItemType 1 | ... | FormalItemType n

    In cases where prime(Type) = none, there may be a temptation to bind FormalItemType 1 to none and n to 1. However, it is important to note that none is not a FormalItemType, rather it is equivalent to a union type with no member types. Thus, in such cases, the proper way to satisfy the given judgment is to bind n to 0.

FS.E056 - markup

See Bug 6007

Description

Fix italicization in C.2 [Mapping of Overloaded Internal Functions].

History

1 Sep 2008: Proposed

1 Sep 2008: Accepted

1 Sep 2008: Issued

Changes

  1. In C.2 Mapping of Overloaded Internal Functions / Notation 2 / rule 1, replace:

    [fs:opname1(Expr1, Expr2)]OverloadedOp == op:opname2(Expr1,Expr2)

    with:

    [fs:opname1(Expr1,Expr2)]OverloadedOp == op:opname2(Expr1,Expr2)
  2. In C.2 Mapping of Overloaded Internal Functions / Notation 2 / rule 2, replace:

    [fs:opname1(Expr1)]OverloadedOp == op:opname2(Expr1)

    with:

    [fs:opname1(Expr1)]OverloadedOp == op:opname2(Expr1)

FS.E055 - editorial

See Bug 4601

Description

Change wording re fs:convert-operand in 4.5.2 [General Comparisons].

History

8 Jun 2007: Proposed

1 Sep 2008: Accepted

1 Sep 2008: Issued

Change

In 4.5.2 General Comparisons / Normalization, replace:

The normalization rule for a general comparison expression first atomizes each argument by applying fn:data and then applies the existentially quantified SomeExpr expression to each sequence. The internal function fs:convert-operand is applied to each pair of atomic values. If the first argument to this function has type xs:untypedAtomic, then the first argument is cast to type of the second argument. If the second argument has type xs:untypedAtomic, the first argument is cast to a string. The overloaded internal function corresponding to the general comparison operator is then applied to the two converted values.

with:

The normalization rule for a general comparison expression first atomizes each argument by applying fn:data, resulting in two sequences of atomic values. Two nested some expressions then examine (potentially) every pair of values (one value from each sequence). For each pair, the internal function fs:convert-operand is called twice; if either of the two values is of type xs:untypedAtomic, one of the calls will cast it to a type determined by the other value. The overloaded internal function corresponding to the general comparison operator is then applied to the two converted values.

FS.E054 - editorial

See Bug 4593

Description

Fix typo in 8.4 [Judgments for FLWOR and other expressions on sequences].

History

1 Jun 2007: Proposed

4 Jun 2007: Accepted

1 Sep 2008: Issued

Change

In 8.4 Judgments for FLWOR and other expressions on sequences / Semantics 2, replace:

Note that prime(Type) · quantifier(Type) is always a super type of the original type Type I.e., prime(Type) · quantifier(Type) <: Type always holds.

with:

Note that prime(Type) · quantifier(Type) is always a super type of the original type Type I.e., Type <: prime(Type) · quantifier(Type) always holds.

FS.E053 - editorial

See Bug 4447

Description

Fix incorrect references to standard functions/operators.

History

3 Apr 2007: Proposed

16 Apr 2007: Accepted

1 Sep 2008: Issued

Changes

  1. In 8.4 Judgments for FLWOR and other expressions on sequences / Introduction, replace:

    [Definition: A prime type is a choice of item types.] This section defines two functions on types that compute the prime type of an arbitrary type, and approximate the occurrence of items in an arbitrary type. These type functions are used in the static semantics of many expressions, including "for", "some", and "every" expressions, and many functions, including "fn:unordered" and "fn:distinct" .

    with:

    [Definition: A prime type is a choice of item types.] This section defines two functions on types that compute the prime type of an arbitrary type, and approximate the occurrence of items in an arbitrary type. These type functions are used in the static semantics of many expressions, including "for", "some", and "every" expressions, and many functions, including "fn:unordered" and "fn:distinct-values".

  2. In C.2 Mapping of Overloaded Internal Functions / Notation 2 / Binary Operators table, replace:

    fs:minus(A, B) xs:date xs:date fn:subtract-dates(A, B) xs:dayTimeDuration
    ...
    fs:minus(A, B) xs:time xs:time fn:subtract-times(A, B) xs:dayTimeDuration
    ...
    fs:minus(A, B) xs:dateTime xs:dateTime fn:subtract-dateTimes(A, B) xs:dayTimeDuration

    with:

    fs:minus(A, B) xs:date xs:date op:subtract-dates(A, B) xs:dayTimeDuration
    ...
    fs:minus(A, B) xs:time xs:time op:subtract-times(A, B) xs:dayTimeDuration
    ...
    fs:minus(A, B) xs:dateTime xs:dateTime op:subtract-dateTimes(A, B) xs:dayTimeDuration

    and replace:

    fs:eq(A, B) xs:hexBinary xs:hexBinary op:hex-binary-equal(A, B) xs:boolean
    fs:eq(A, B) xs:base64Binary xs:base64Binary op:base64-binary-equal(A, B) xs:boolean
    ...
    fs:ne(A, B) xs:hexBinary xs:hexBinary fn:not(op:hex-binary-equal(A, B)) xs:boolean
    fs:ne(A, B) xs:base64Binary xs:base64Binary fn:not(op:base64-binary-equal(A, B)) xs:boolean

    with:

    fs:eq(A, B) xs:hexBinary xs:hexBinary op:hexBinary-equal(A, B) xs:boolean
    fs:eq(A, B) xs:base64Binary xs:base64Binary op:base64Binary-equal(A, B) xs:boolean
    ...
    fs:ne(A, B) xs:hexBinary xs:hexBinary fn:not(op:hexBinary-equal(A, B)) xs:boolean
    fs:ne(A, B) xs:base64Binary xs:base64Binary fn:not(op:base64Binary-equal(A, B)) xs:boolean

FS.E052 - editorial

See Bug 3895

Description

Change some wording in 4.7.1 [Direct Element Constructors].

History

30 Oct 2006: Proposed

31 Aug 2008: Accepted

31 Aug 2008: Issued

Changes

  1. In 4.7.1 Direct Element Constructors / Introduction, replace:

    The static and dynamic semantics of the direct forms of element and attribute constructors are specified on the equivalent computed element and attribute constructors.

    with:

    The static and dynamic semantics of the direct forms of element and attribute constructors are specified in terms of the equivalent computed element and attribute constructors.

  2. In 4.7.1 Direct Element Constructors / Notation 1, replace:

    The auxiliary mapping rules []ElementContent, []ElementContentUnit, []PartitionIntoUnits, and []DirCharsUnits are defined in this section and are used for the normalization of the content of direct element constructors.

    with:

    The auxiliary mapping rules []ElementContent, []ElementContentUnit, []PartitionIntoUnits, and []DirCharsUnit are defined in this section and are used for the normalization of the content of direct element constructors.

  3. In 4.7.1 Direct Element Constructors / Notation 2, replace:

    An element-content unit is either a maximal contiguous sequence of literal characters (including character references, escaped braces, and predefined entity references), an enclosed expression, a direct element constructor, an XML comment, or an XML processing instruction.

    with:

    An element-content unit is either a DirCharsUnit ( a maximal contiguous sequence of literal characters , CDataSections, character references, escaped braces, and predefined entity references), an enclosed expression, a direct element constructor, an XML comment, or an XML processing instruction.

  4. In 4.7.1 Direct Element Constructors / Normalization, replace:

    Adjacent element-content units are convenient because they permit arbitrary interleaving of text and atomic data.

    with:

    Adjacent element-content units permit arbitrary interleaving of text and atomic data.

    and replace:

                    <date>{ xs:date("2003-03-18") }</date>
                     =
                    element date { 
                      fs:item-sequence-to-node-sequence(
                        xs:date("2003-03-18")
                      )
                    }
                    
                    <address>
                      <!-- Dizzy's address -->
                      { 123 }-0A <street>Roosevelt Ave.</street> Flushing, NY { 11368 }
                    </address>
                     =
                    element address {
                      fs:item-sequence-to-node-sequence(
                        comment { " Dizzy's address "},
                        123, 
                        text { "-0A "}, 
                        element street {"Roosevelt Ave."},
                        text { " Flushing, NY "  },
                        11368
                      )
                    }
                    

    with:

                    <date>{ xs:date("2003-03-18") }</date>
                     =
                    element date { 
                      fs:item-sequence-to-node-sequence(
                        xs:date("2003-03-18")
                      )
                    } {}
                    
                    <address>
                      <!-- Dizzy's address -->
                      { 123 }-0A <street>Roosevelt Ave.</street> Flushing, NY { 11368 }
                    </address>
                     =
                    element address {
                      fs:item-sequence-to-node-sequence(
                        comment { " Dizzy's address "},
                        123, 
                        text { "-0A "}, 
                        element street {"Roosevelt Ave."} {},
                        text { " Flushing, NY "  },
                        11368
                      )
                    } {}
                    

    and replace:

    The following normalization rule takes the longest consecutive sequence of individual characters that include literal characters, escaped curly braces, character references, and predefined entity references and normalizes the character sequence as a text node containing the string of characters.

    with:

    The following normalization rule takes a maximal contiguous sequence of individual characters that include literal characters, CDataSections, escaped curly braces, character references, and predefined entity references and normalizes the character sequence as a text node containing the string of characters.

  5. In 4.7.1 Direct Element Constructors / Normalization / rule 5, replace:

     
    [DirCharsUnit]ElementContentUnit
    ==
    text { [ DirCharsUnit ]DirCharsUnits }

    with:

     
    [DirCharsUnit]ElementContentUnit
    ==
    text { [ DirCharsUnit ]DirCharsUnit }
  6. In 4.7.1 Direct Element Constructors / Normalization, replace:

    The application of []DirCharsUnits to DirCharsUnit is defined informally. It produces a string literal corresponding to the content of the DirCharsUnit, in boundary whitespace is processed and non-literal characters (CharRefs, PredefinedEntityRefs, CDataSections, and escaped-braces) are resolved according to the rules in Section 3.7.1.3 ContentXQ.

    with:

    The application of []DirCharsUnit to DirCharsUnit is defined informally. It produces a string literal corresponding to the content of the DirCharsUnit, in which boundary whitespace is processed as specified in Section 3.7.1.4 Boundary WhitespaceXQ, and non-literal characters (CharRefs, PredefinedEntityRefs, CDataSections, and escaped-braces) are resolved according to the rules in Section 3.7.1.3 ContentXQ.

  7. In 4.7.1.4 Boundary Whitespace, replace:

    Section 3.7.1.4 Boundary WhitespaceXQ describes how whitespace is processed in element constructors depending on the value of the boundary-space declaration in the query prolog. The Formal Semantics assumes that the rules for handling whitespace are applied by the (informally defined) auxiliary rule []DirCharsUnits.

    with:

    Section 3.7.1.4 Boundary WhitespaceXQ describes how whitespace is processed in element constructors depending on the value of the boundary-space declaration in the query prolog. The Formal Semantics assumes that the rules for handling whitespace are applied by the (informally defined) auxiliary rule []DirCharsUnit.

FS.E051 - markup

See Bug 6005

Description

Correctly render metavariables in mapping subscripts.

History

31 Aug 2008: Proposed

31 Aug 2008: Accepted

31 Aug 2008: Issued

Changes

  1. In

    replace:

    FunctionArgument(Type)

    with:

    FunctionArgument(Type)
  2. In

    replace:

    AtomizeAtomic(Type)

    with:

    AtomizeAtomic(Type)

    and replace:

    Convert(Type)

    with:

    Convert(Type)
  3. In 4.1.5 Function Calls / Normalization / rule 1, replace:

    FunctionArgument(Type1) ... FunctionArgument(Typen)

    with:

    FunctionArgument(Type1) ... FunctionArgument(Typen)
  4. In

    replace:

    definition(targetNCName)

    with:

    definition(targetNCName)
  5. In

    replace:

    content(targetNCName)

    with:

    content(targetNCName)
  6. In

    replace:

    pragma(targetAnyURI)

    with:

    pragma(targetAnyURI)
  7. In

    replace:

    mixed_content(targetNCName)

    with:

    mixed_content(targetNCName)
  8. In

    replace:

    simple_content(targetNCName)

    with:

    simple_content(targetNCName)

FS.E050 - editorial

See Bug 3886

Description

Fix typo in 4.2.1 [Steps].

History

30 Oct 2006: Proposed

30 Aug 2008: Accepted

30 Aug 2008: Issued

Change

In 4.2.1 Steps / Dynamic Evaluation / rule 1 / premise 1, replace:

dynEnv.varValue( $fs:dot ) = Value1

with:

dynEnv.varValue( (FS-URI,"dot") ) = Value1

FS.E049 - editorial

See Bug 3885

Description

Minor changes in 4.1.5 [Function Calls] / Dynamic Evaluation.

History

29 Oct 2006: Proposed

30 Aug 2008: Accepted

30 Aug 2008: Issued

Changes

  1. In 4.1.5 Function Calls / Dynamic Evaluation / rule 3 / premise 3, replace:

    dynEnv1.varValue  |- Expr => Value

    with:

    dynEnv1  |- Expr => Value
  2. In 4.1.5 Function Calls / Dynamic Evaluation, replace:

    The rule for evaluating an function imported from a module ...

    with:

    The rule for evaluating a function imported from a module ...

  3. In 4.1.5 Function Calls / Dynamic Evaluation / rule 5 / premise 7, replace:

    dynEnv1.varValue  |- Expr => Value

    with:

    dynEnv1  |- Expr => Value
  4. In 4.1.5 Function Calls / Dynamic Evaluation, replace:

    If the function is a built-in function (resp. special formal semantics function), the value returned by the function is the one specified in [Functions and Operators] (resp. [7 Additional Semantics of Functions] ).

    with:

    If the function is a built-in function (resp. special formal semantics function), the value returned by the function is the one specified in [Functions and Operators] (resp. [7.1 Formal Semantics Functions] or [C.2 Mapping of Overloaded Internal Functions]).

  5. In 4.1.5 Function Calls / Dynamic Evaluation / rule 7, replace:

    dynEnv.funcDefn(expanded-QName,0) = #BUILT-IN
    The built-in function expanded-QName (See [Functions and Operators] or [7 Additional Semantics of Functions] ) yields the value Value

    dynEnv |-  function expanded-QName with types on values yields Value

    with:

    dynEnv.funcDefn(expanded-QName,0) = #BUILT-IN
    The built-in function expanded-QName (See [Functions and Operators] or [7.1 Formal Semantics Functions] or [C.2 Mapping of Overloaded Internal Functions]) yields the value Value

    dynEnv |-  function expanded-QName with types on values yields Value

  6. In 4.1.5 Function Calls / Dynamic Evaluation / rule 8, replace:

    dynEnv.funcDefn(expanded-QName,n) = #BUILT-IN
    The built-in function expanded-QName (See [Functions and Operators] or [7 Additional Semantics of Functions] ) applied to values (Value1,...,Valuen) yields the value Value

    dynEnv |-  function expanded-QName with types (Type1,...,Typen) on values (Value1,...,Valuen) yields Value

    with:

    dynEnv.funcDefn(expanded-QName,n) = #BUILT-IN
    The built-in function expanded-QName (See [Functions and Operators] or [7.1 Formal Semantics Functions] or [C.2 Mapping of Overloaded Internal Functions]) applied to values (Value1,...,Valuen) yields the value Value

    dynEnv |-  function expanded-QName with types (Type1,...,Typen) on values (Value1,...,Valuen) yields Value

FS.E048 - editorial

See Bug 3883

Description

Change some wording in 4.1.5 [Function Calls] / Static Type Analysis.

History

29 Oct 2006: Proposed

30 Aug 2008: Accepted

30 Aug 2008: Issued

Change

In 4.1.5 Function Calls / Static Type Analysis, replace:

Different sets of static typing rules are used to type check function calls depending on which of the following categories the belong to: ...

with:

Different sets of static typing rules are used to type check function calls depending on which of the following categories they belong to: ...

and replace:

The following two rules are common to all those categories, and are used to bootstrap type inference, by first looking-up the expanded QName for the function, then applying the appropriate set of static typing rules depending on the category in which the function is.

with:

The following two rules factor out the step (common to all those categories) of translating a type-inference judgment on syntactic objects (QName and Expri) into a type-inference judgment on semantic objects (expanded-QName and Typei).

and replace:

The two following rules look up the function in the static environment and check that some signature for the function satisfies the following constraint: the type of each actual argument is a subtype of some type that can be promoted to the type of the corresponding function parameter.

with:

Recall that statEnv.funcType contains at most one function signature for any given (function name, arity) pair. The two following rules look up the function in the static environment and check that the type of each actual argument can be promoted to the type of the corresponding function parameter.

and remove:

Notice that the static context contains at most one function declaration for each function. This is possible since the treatment of overloaded operators is done through a set of specific static typing rules which do not require access to the environment. See [C.2 Mapping of Overloaded Internal Functions].

FS.E047 - editorial

See Bug 3882

Description

Change some wording in 4.1.5 [Function Calls] / Normalization.

History

29 Oct 2006: Proposed

30 Aug 2008: Accepted

30 Aug 2008: Issued

Changes

  1. In 4.1.5 Function Calls / Normalization, replace:

    Each argument expression in a function call is normalized to its corresponding Core expression by applying []FunctionArgument(Type) for each argument with the expected SequenceType for the argument inserted.

    with:

    Each argument expression in a function call is normalized to its corresponding Core expression by applying []FunctionArgument(Type) where Type is the corresponding parameter type.

  2. In 4.1.5 Function Calls / Normalization / rule 1, remove:

     
    ==
    QName ( [Expr1]FunctionArgument(Type1), ..., [Exprn]FunctionArgument(Typen) )
  3. In 4.1.5 Function Calls / Normalization, replace:

    Note that this normalization rule depends on the function signatures, which is used to get the types of the function parameters (SequenceType1,...,SequenceTypen) . For user-defined functions, the function signature can be obtained from the XQuery prolog where the function is declared. For built-in functions, the signature is given in the [Functions and Operators] document. For overloaded built-in functions, several signatures may exists, however, because they all correspond to sequences of atomic values, they all result in the same normalization.

    with:

    Note that this normalization rule depends on the function signature (found in statEnv.funcType), which is used to get the types of the function parameters (Type1, ..., Typen).

FS.E046 - editorial

See Bug 3879

Description

Fix typos in 4 [Expressions].

History

29 Oct 2006: Proposed

30 Aug 2008: Accepted

30 Aug 2008: Issued

Change

In 4 Expressions / Static Type Analysis, replace:

In general, static type errors are raised whenever there is no static typing rules which can compute the type of a given expression. This is the reason for the absence of a formal post-condition in this rules .

with:

In general, static type errors are raised whenever there are no static typing rules which can compute the type of a given expression. This is the reason for the absence of a formal conclusion in this rule.

FS.E045 - editorial

See Bug 3876

Description

Fix typo in 3.2.2 [Normalization mapping rules].

History

28 Oct 2006: Proposed

30 Aug 2008: Accepted

30 Aug 2008: Issued

Change

In 3.2.2 Normalization mapping rules / Notation, replace:

                    for $i in (1, 2) return
                      for $j in (3, 4) return
                          element pair { ($i,$j) }
                

with:

                    for $i in (1, 2) return
                      for $j in (3, 4) return
                          element pair { ($i,$j) } {}
                

FS.E044 - editorial

See Bug 3873

Description

Fix typo in 2.5 [Functions and operators].

History

28 Oct 2006: Proposed

30 Aug 2008: Accepted

30 Aug 2008: Issued

Change

In 2.5 Functions and operators, replace:

For instance, the fn:unordered returns its input sequence in an implementation-dependent order.

with:

For instance, the fn:unordered function returns its input sequence in an implementation-dependent order.

FS.E043 - editorial

See Bug 3871

Description

Fix typos in 2.4.4 [Top level definitions].

History

28 Oct 2006: Proposed

30 Aug 2008: Accepted

30 Aug 2008: Issued

Change

In 2.4.4 Top level definitions, replace:

is represented as follow

                  define type SKU restrict xsd:string;
                

with:

is represented as follows

                  define type SKU restricts xsd:string;
                

FS.E042 - editorial

See Bug 3871

Description

In the production for Definitions, add a semicolon after each Definition. Adjust the rest of the spec accordingly.

History

28 Oct 2006: Proposed

30 Aug 2008: Accepted

30 Aug 2008: Issued

Changes

  1. In 2.4.4 Top level definitions, replace:

    [40 (Formal)]    Definitions    ::=    (Definition Definitions)?

    with:

    [40 (Formal)]    Definitions    ::=    (Definition Separator Definitions)?

    (and similarly in A.2 Formal BNF)

    and replace:

                    define type listOfMyIntType restricts xs:anySimpleType {
                      myInteger*
                    }
                    
                    define type zipUnion restricts xs:anySimpleType {
                      USState | FrenchRegion
                    }
                    

    with:

                    define type listOfMyIntType restricts xs:anySimpleType {
                      myInteger*
                    };
                    
                    define type zipUnion restricts xs:anySimpleType {
                      USState | FrenchRegion
                    };
                    

    and replace:

    When the type derivation is omitted, the type derives by restriction from xs:anyType. For instance:

                      define type Bib { element book* } =
                      define type Bib restricts xs:anyType { element book* }
                    

    with:

    When the type derivation is omitted, the type derives by restriction from xs:anyType. For instance, the following two type definitions are equivalent:

                      define type Bib { element book* };
                      define type Bib restricts xs:anyType { element book* };
                    

    and replace:

                      define type Bib { } =
                      define type Bib { empty }
                    

    with:

                      define type Bib { };
                      define type Bib { empty };
                    
  2. In 2.4.5 Example of a complete Schema, replace:

                      define type NYCAddress extends USAddress {
                        element apt
                      }
                    
                      define element apt of type fs:anon3
                    
                      define type fs:anon3 restricts xsd:positiveInteger
                    
                      define element usaddress  substitutes for address of type USAddress
                      define element nycaddress substitutes for usaddress of type NYCAddress
                    

    with:

                      define type NYCAddress extends USAddress {
                        element apt
                      };
                    
                      define element apt of type fs:anon3;
                    
                      define type fs:anon3 restricts xsd:positiveInteger;
                    
                      define element usaddress  substitutes for address of type USAddress;
                      define element nycaddress substitutes for usaddress of type NYCAddress;
                    
  3. In 3.5.1 Predefined Schema Types, replace:

                      define type xs:string       restricts xs:anyAtomicType
                      define type xs:boolean      restricts xs:anyAtomicType
                      define type xs:decimal      restricts xs:anyAtomicType
                      define type xs:float        restricts xs:anyAtomicType
                      define type xs:double       restricts xs:anyAtomicType
                      define type xs:duration     restricts xs:anyAtomicType
                      define type xs:dateTime     restricts xs:anyAtomicType
                      define type xs:time         restricts xs:anyAtomicType
                      define type xs:date         restricts xs:anyAtomicType
                      define type xs:gYearMonth   restricts xs:anyAtomicType
                      define type xs:gYear        restricts xs:anyAtomicType
                      define type xs:gMonthDay    restricts xs:anyAtomicType
                      define type xs:gDay         restricts xs:anyAtomicType
                      define type xs:gMonth       restricts xs:anyAtomicType
                      define type xs:hexBinary    restricts xs:anyAtomicType
                      define type xs:base64Binary restricts xs:anyAtomicType
                      define type xs:anyURI       restricts xs:anyAtomicType
                      define type xs:QName        restricts xs:anyAtomicType
                      define type xs:NOTATION     restricts xs:anyAtomicType
                    

    with:

                      define type xs:string       restricts xs:anyAtomicType;
                      define type xs:boolean      restricts xs:anyAtomicType;
                      define type xs:decimal      restricts xs:anyAtomicType;
                      define type xs:float        restricts xs:anyAtomicType;
                      define type xs:double       restricts xs:anyAtomicType;
                      define type xs:duration     restricts xs:anyAtomicType;
                      define type xs:dateTime     restricts xs:anyAtomicType;
                      define type xs:time         restricts xs:anyAtomicType;
                      define type xs:date         restricts xs:anyAtomicType;
                      define type xs:gYearMonth   restricts xs:anyAtomicType;
                      define type xs:gYear        restricts xs:anyAtomicType;
                      define type xs:gMonthDay    restricts xs:anyAtomicType;
                      define type xs:gDay         restricts xs:anyAtomicType;
                      define type xs:gMonth       restricts xs:anyAtomicType;
                      define type xs:hexBinary    restricts xs:anyAtomicType;
                      define type xs:base64Binary restricts xs:anyAtomicType;
                      define type xs:anyURI       restricts xs:anyAtomicType;
                      define type xs:QName        restricts xs:anyAtomicType;
                      define type xs:NOTATION     restricts xs:anyAtomicType;
                    

    and replace:

                      define type xs:normalizedString   restricts xs:string
                      define type xs:token              restricts xs:normalizedString
                      define type xs:language           restricts xs:token
                      define type xs:NMTOKEN            restricts xs:token
                      define type xs:Name               restricts xs:token
                      define type xs:NCName             restricts xs:Name
                      define type xs:ID                 restricts xs:NCName
                      define type xs:IDREF              restricts xs:NCName
                      define type xs:ENTITY             restricts xs:NCName
                      define type xs:integer            restricts xs:decimal
                      define type xs:nonPositiveInteger restricts xs:integer
                      define type xs:negativeInteger    restricts xs:nonPositiveInteger
                      define type xs:long               restricts xs:integer
                      define type xs:int                restricts xs:long
                      define type xs:short              restricts xs:int
                      define type xs:byte               restricts xs:short
                      define type xs:nonNegativeInteger restricts xs:integer
                      define type xs:unsignedLong       restricts xs:nonNegativeInteger
                      define type xs:unsignedInt        restricts xs:unsignedLong
                      define type xs:unsignedShort      restricts xs:unsignedInt
                      define type xs:unsignedByte       restricts xs:unsignedShort
                      define type xs:positiveInteger    restricts xs:nonNegativeInteger
                    

    with:

                      define type xs:normalizedString   restricts xs:string;
                      define type xs:token              restricts xs:normalizedString;
                      define type xs:language           restricts xs:token;
                      define type xs:NMTOKEN            restricts xs:token;
                      define type xs:Name               restricts xs:token;
                      define type xs:NCName             restricts xs:Name;
                      define type xs:ID                 restricts xs:NCName;
                      define type xs:IDREF              restricts xs:NCName;
                      define type xs:ENTITY             restricts xs:NCName;
                      define type xs:integer            restricts xs:decimal;
                      define type xs:nonPositiveInteger restricts xs:integer;
                      define type xs:negativeInteger    restricts xs:nonPositiveInteger;
                      define type xs:long               restricts xs:integer;
                      define type xs:int                restricts xs:long;
                      define type xs:short              restricts xs:int;
                      define type xs:byte               restricts xs:short;
                      define type xs:nonNegativeInteger restricts xs:integer;
                      define type xs:unsignedLong       restricts xs:nonNegativeInteger;
                      define type xs:unsignedInt        restricts xs:unsignedLong;
                      define type xs:unsignedShort      restricts xs:unsignedInt;
                      define type xs:unsignedByte       restricts xs:unsignedShort;
                      define type xs:positiveInteger    restricts xs:nonNegativeInteger;
                    

    and replace:

                      define type xs:NMTOKENS restricts xs:anySimpleType { xs:NMTOKEN+ }
                      define type xs:IDREFS   restricts xs:anySimpleType { xs:IDREF+ }
                      define type xs:ENTITIES restricts xs:anySimpleType { xs:ENTITY+ }
                    

    with:

                      define type xs:NMTOKENS restricts xs:anySimpleType { xs:NMTOKEN+ };
                      define type xs:IDREFS   restricts xs:anySimpleType { xs:IDREF+ };
                      define type xs:ENTITIES restricts xs:anySimpleType { xs:ENTITY+ };
                    

    and replace:

                      define type xs:yearMonthDuration restricts xs:duration
                      define type xs:dayTimeDuration   restricts xs:duration
                    

    with:

                      define type xs:yearMonthDuration restricts xs:duration;
                      define type xs:dayTimeDuration   restricts xs:duration;
                    
  4. In 5.10 Schema Import / Static Context Processing / rule 5, replace:

    statEnv |- Definitions =>type statEnv1
    statEnv1 |- Definition 1 =>type statEnv2

    statEnv |- Definition 1 Definitions =>type statEnv2

    with:

    statEnv |- Definitions =>type statEnv1
    statEnv1 |- Definition 1 =>type statEnv2

    statEnv |- Definition 1 ; Definitions =>type statEnv2

  5. In 8.1.8 Builtin attributes, replace:

                      define attribute xsi:type of type xs:QName
                      define attribute xsi:nil of type xs:boolean
                      define attribute xsi:schemaLocation of type fs:anon
                      define type fs:anon1 { xs:anyURI* }
                      define attribute xsi:noNamespaceSchemaLocation of type xs:anyURI
                    

    with:

                      define attribute xsi:type of type xs:QName;
                      define attribute xsi:nil of type xs:boolean;
                      define attribute xsi:schemaLocation of type fs:anon;
                      define type fs:anon1 { xs:anyURI* };
                      define attribute xsi:noNamespaceSchemaLocation of type xs:anyURI;
                    

FS.E041 - editorial

See Bug 3868

Description

Fix typos in 2.4.3 [Content models].

History

27 Oct 2006: Proposed

29 Aug 2008: Accepted

29 Aug 2008: Issued

Changes

  1. In 2.4.3 Content models / Notation, replace:

    The grammar for Type describe above is general enough to capture type infered for arbitrary expression, as well as to represent the content of an in [Schema Part 1].

    with:

    The grammar for Type described above is general enough to capture the type inferred for an arbitrary expression.

    and replace:

    [42 (Formal)]    AttributeModel    ::=    AttributeType
    | (AttributeType "?")
    | (AttributeModel "&" AttributeModel)
    | "(" ")"
    [43 (Formal)]    ElementModel    ::=    ElementType
    | (ElementType "?")
    | (ElementModel "&" ElementModel)
    | "(" ")"
    | "none"

    with:

    [42 (Formal)]    AttributeModel    ::=    AttributeType
    | (AttributeType "?")
    | (AttributeModel "&" AttributeModel)
    | "empty"
    [43 (Formal)]    ElementModel    ::=    ElementType
    | (ElementType "?")
    | (ElementModel "&" ElementModel)
    | "empty"
    | "none"
  2. In A.2 Formal BNF / Non-Terminals, make the same grammar changes.

FS.E040 - editorial

See Bug 3866

Description

Fix typos in 2.4.1 [XML Schema and the [XPath/XQuery] Type System].

History

26 Oct 2006: Proposed

29 Aug 2008: Accepted

29 Aug 2008: Issued

Change

In 2.4.1 XML Schema and the [XPath/XQuery] Type System, replace:

This document describe types in the [XPath/XQuery] types system, as well as the operations and properties over those types which are used to define the [XPath/XQuery] static typing feature. The two most important properties are whether a data instances matches a type, and whether a type is a subtype of another. Those properties are described in [8.3 Judgments for type matching]. This document does not describe all other possible properties over those types.

with:

This document describes types in the [XPath/XQuery] types system, as well as the operations and properties over those types which are used to define the [XPath/XQuery] static typing feature. The two most important properties are whether a data instance matches a type, and whether a type is a subtype of another. Those properties are described in [8.3 Judgments for type matching]. This document does not describe all other possible properties over those types.

and replace:

The mapping from XML Schema into the [XPath/XQuery] type system is given in [D Importing Schemas]. The rest of this section is organized as follows. [2.4.2 Item types] describes item types, [2.4.3 Content models] describes content models, and [2.4.4 Top level definitions] describe top-level type declarations.

with:

The mapping from XML Schema into the [XPath/XQuery] type system is given in [D Importing Schemas]. The rest of this section is organized as follows. [2.4.2 Item types] describes item types, [2.4.3 Content models] describes content models, and [2.4.4 Top level definitions] describes top-level type declarations.

FS.E039 - editorial

See Bug 3865

Description

Fix typo in 2.3.2 [Examples of values].

History

26 Oct 2006: Proposed

29 Aug 2008: Accepted

29 Aug 2008: Issued

Change

In 2.3.2 Examples of values, replace:

                  element fact of type xs:untyped {
                    text { "The cat weighs " },
                    element weight of type xs:untyped {
                      attribute units of type xs:untypedAtomic {
                        "lbs" of type xs:untypedAtomic
                      }
                      text { "12" }
                    },
                    text { " pounds." }
                  }
                

with:

                  element fact of type xs:untyped {
                    text { "The cat weighs " },
                    element weight of type xs:untyped {
                      attribute units of type xs:untypedAtomic {
                        "lbs" of type xs:untypedAtomic
                      }, 
                      text { "12" }
                    },
                    text { " pounds." }
                  }
                

FS.E038 - editorial

See Bug 3864

Description

Fix typos in 2.3.1 [Formal values].

History

26 Oct 2006: Proposed

29 Aug 2008: Accepted

29 Aug 2008: Issued

Change

In 2.3.1 Formal values / Notation, replace:

(The mapping is obvious, except that "expanded-QName" corresponds to xs:QName)

with:

(The mapping is obvious, except that expanded-QName corresponds to xs:QName.)

and replace:

For familiarity, these objects have been given the same appearance as StringLiterals from the XQuery and Core grammars; however, these are formal objects, with a distinct role in the FS.

with:

For familiarity, these objects have been given the same appearance as StringLiterals from the XQuery and Core grammars; however, these are formal objects, with a distinct role in the Formal Semantics.

FS.E037 - editorial

See Bug 3861

Description

Fix typo in 2.1.4 [Notations for inference rules].

History

25 Oct 2006: Proposed

29 Aug 2008: Accepted

29 Aug 2008: Issued

Change

In 2.1.4 Notations for inference rules, replace:

This means that, in the context of a particular instantiation of a rule, one can talk about "the value of $VarName" instead of the value bound to the first (second, etc) occurrence of $VarName.

with:

This means that, in the context of a particular instantiation of a rule, one can talk about "the value of $VarName" instead of "the value bound to the first (second, etc) occurrence of $VarName".

FS.E036 - editorial

See Bug 3268

Description

Introduce Formal symbol OptDerivation.

History

9 May 2006: Proposed

29 Aug 2008: Accepted

29 Aug 2008: Issued

Changes

  1. In 2.4.4 Top level definitions, replace:

    [34 (Formal)]    ComplexTypeDerivation    ::=    Derivation? OptMixed "{" Type? "}"

    with:

    [34 (Formal)]    ComplexTypeDerivation    ::=    OptDerivation OptMixed "{" Type? "}"

    and insert:

    [95 (Formal)]    OptDerivation    ::=    Derivation?
  2. In A.2 Formal BNF, replace:

    [34]    ComplexTypeDerivation    ::=    Derivation? OptMixed "{" Type? "}"

    with:

    [34]    ComplexTypeDerivation    ::=    OptDerivation OptMixed "{" Type? "}"

    and insert:

    [95]    OptDerivation    ::=    Derivation?
  3. In F.1.1 Type resolution / Semantics / rule 1, replace:

    statEnv |-  Derivation? OptMixed { empty } resolves to TypeName { Type }

    statEnv |-  Derivation? OptMixed { } resolves to TypeName { Type }

    with:

    statEnv |-  OptDerivation OptMixed { empty } resolves to TypeName { Type }

    statEnv |-  OptDerivation OptMixed { } resolves to TypeName { Type }

  4. In F.1.1 Type resolution / Semantics / rule 4 / premise 2, replace:

    statEnv.typeDefn(expanded-QName) = define type TypeName Derivation? BaseOptMixed { BaseType? }

    with:

    statEnv.typeDefn(expanded-QName) = define type TypeName OptDerivation BaseOptMixed { BaseType? }

FS.E035 - editorial

See Bug 3193

Description

Fix typo in 5.14 [Variable Declaration].

History

4 May 2006: Proposed

29 Aug 2008: Accepted

29 Aug 2008: Issued

Changes

  1. In 5.14 Variable Declaration / Static Context Processing / rule 2 / conclusion, replace:

    statEnv |- declare variable $VarName as SequenceType := Expr =>stat statEnv2

    with:

    statEnv |- declare variable $VarName as SequenceType := Expr =>stat statEnv1
  2. In 5.14 Variable Declaration / Static Context Processing / rule 3 / conclusion, replace:

    statEnv |- declare variable $VarName as SequenceType external =>stat statEnv2

    with:

    statEnv |- declare variable $VarName as SequenceType external =>stat statEnv1

FS.E034 - editorial

See Bug 1776

Description

Adjust the formatting of a rule in 8.2.2.2 [Dynamic semantics of axes].

History

20 Jul 2005: Proposed

29 Aug 2008: Accepted

29 Aug 2008: Issued

Change

In 8.2.2.2 Dynamic semantics of axes / Semantics / rule 11, replace:

dynEnv |- axisAxisofNodeValue=> ()

with:

Otherwise

dynEnv |-  axis Axis of NodeValue => ()

FS.E033 - substantive

See Bug 5459

See Bug 5460

Description

Fix the static typing for numeric and aggregate functions.

History

21 Jul 2008: Proposed

30 Jul 2008: Accepted

27 Aug 2008: Issued

Changes

  1. In 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions, replace the whole content of the section:

    Static Type Analysis

    The static typing rules for the fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions promote their input type to the (least) base primitive numeric type from which the input type is derived. Note that the fact that the type should be the least is not expressed by the inference rule notation used here. Parameters of type xs:untypedAtomic are always promoted to xs:double. Instead of writing a separate judgment for each function, we write one rule for the functions whose name is either (FN-URI,"abs"), (FN-URI,"ceiling"), (FN-URI,"floor"), (FN-URI,"round"), or (FN-URI,"round-half-to-even") functions.

    Type1 in { xs:integer, xs:decimal, xs:float, xs:double }
    statEnv |- Type <: xs:anyAtomicType ?
    Type2 = convert_untypedAtomic(Type, xs:double)
    statEnv |- Type2 can be promoted to Type1
    expanded-QName in { (FN-URI,"abs"), (FN-URI,"ceiling"), (FN-URI,"floor"), (FN-URI,"round"), (FN-URI,"round-half-to-even") }

    statEnv |-  expanded-QName (Type) : Type1 · quantifier(Type)

    with:

    Notation

    The auxiliary judgment has base atomic type is used in the next subsection and also in [7.2.10 The fn:min, fn:max, fn:avg, and fn:sum functions].

    statEnv |- AtomicTypeName 1has base atomic typeAtomicTypeName 2

    To a first approximation, this judgment holds when AtomicTypeName 1 is (or is derived from) primitive atomic type AtomicTypeName 2. However, for the purpose of typing the functions that use this judgment, there are three non-primitive atomic types that are treated similarly to primitive types: xs:integer (derived from xs:decimal), and xs:yearMonthDuration and xs:dayTimeDuration (derived from xs:duration).

    If AtomicTypeName 1 is (or is a subtype of) any primitive atomic type other than xs:decimal or xs:duration, then that type is its base atomic type.

    statEnv |- AtomicTypeName 1 <: AtomicTypeName 2
    AtomicTypeName 2 is a primitive atomic type
    not(AtomicTypeName 2 in { xs:decimal, xs:duration })

    statEnv |- AtomicTypeName 1 has base atomic type AtomicTypeName 2

    Similarly for xs:integer, xs:yearMonthDuration, and xs:dayTimeDuration .

    statEnv |- AtomicTypeName 1 <: AtomicTypeName 2
    AtomicTypeName 2 in { xs:integer, xs:yearMonthDuration, xs:dayTimeDuration }

    statEnv |- AtomicTypeName 1 has base atomic type AtomicTypeName 2

    For xs:decimal, we exclude xs:integer and its subtypes:

    statEnv |- AtomicTypeName 1 <: xs:decimal
    statEnv |- not( AtomicTypeName 1 <: xs:integer )

    statEnv |- AtomicTypeName 1 has base atomic type xs:decimal

    And finally, for xs:duration, we exclude xs:yearMonthDuration and xs:dayTimeDuration , and their subtypes.

    statEnv |- AtomicTypeName 1 <: xs:duration
    statEnv |- not( AtomicTypeName 1 <: xs:yearMonthDuration )
    statEnv |- not( AtomicTypeName 1 <: xs:dayTimeDuration )

    statEnv |- AtomicTypeName 1 has base atomic type xs:duration

    Static Type Analysis

    Note that, in the declarations for the built-in functions fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even, the (first) parameter is declared with type "numeric?". Thus, for a call to one of these functions, the normalization rules of [4.1.5 Function Calls] will have wrapped the argument in calls to fn:data() and fs:convert-simple-operand() (with a 'prototypical value' of type xs:double). Thus, static analysis of the call is guaranteed that the argument type is a subtype of xs:anyAtomicType*, with no occurrences of xs:untypedAtomic.

    In the static typing rule for these functions, we check that the argument type is numeric, extract its prime type (which must be a choice of atomic types), find the base atomic type for each, and then form the choice of those results.

    expanded-QName in { (FN-URI,"abs"), (FN-URI,"ceiling"), (FN-URI,"floor"), (FN-URI,"round"), (FN-URI,"round-half-to-even") }
    statEnv |- Type1 <: fs:numeric ?
    prime(Type1) = AtomicTypeName 1 | ... | AtomicTypeName n
    statEnv |- AtomicTypeName 1 has base atomic type AtomicTypeName 1'
    ...
    statEnv |- AtomicTypeName n has base atomic type AtomicTypeName n'
    Type3 = AtomicTypeName 1' | ... | AtomicTypeName n'

    statEnv |- expanded-QName(Type1) : Type3 · quantifier(Type1)

    The fn:round-half-to-even function also has a two-parameter version. Its static type-checking can be reduced to that of the one-parameter version.

    statEnv |- Type2 <: xs:integer
    statEnv |- expanded-QName(Type1) : Type3

    statEnv |- (FN-URI,"round-half-to-even")( Type1, Type2) : Type3

  2. In 7.2.10 The fn:min, fn:max, fn:avg, and fn:sum functions / Static Type Analysis 1 / rule 1, replace:

    statEnv |-  (FN-URI,"sum")( Expr,0 ) : Type

    statEnv |-  (FN-URI,"sum")( Expr ) : Type

    with:

    statEnv |-  (FN-URI,"sum")( Type1, xs:integer ) : Type2

    statEnv |-  (FN-URI,"sum")( Type1 ) : Type2

  3. In 7.2.10 The fn:min, fn:max, fn:avg, and fn:sum functions / Static Type Analysis 2, replace the whole of the subsection:

    Now we can define the static typing rules for the aggregate functions. First, the input type is converted to a prime type. Second, the type function convert_untypedAtomic is applied to the prime type, yielding a new prime type, in which occurrences of xs:untypedAtomic are converted to xs:double. Third, the judgment can be promoted to is applied to the new prime type and target type. The result type is combined with the aggregate quantifier of the input type.

    For a given aggregate function, instead of writing a separate judgment for each target type, we write one rule using a target type Type0.

    For fn:min and fn:max, the target type Type0 is either xs:string, xs:integer, xs:decimal, xs:float, xs:double, xs:date, xs:time, xs:dateTime, xs:yearMonthDuration, or xs:dayTimeDuration .

    Type1 = prime(Type)
    Type2 = convert_untypedAtomic(Type1, xs:double)
    Type2 = empty

    statEnv |-  (FN-URI,"min")(Type) : empty

    Type1 = prime(Type)
    Type2 = convert_untypedAtomic(Type1, xs:double)
    FormalItemType 1, ...,FormalItemType n = Type2
    statEnv |- FormalItemType 1 can be promoted to Type0
    ...
    statEnv |- FormalItemType n can be promoted to Type0
    Type0 in { xs:string, xs:integer, xs:decimal, xs:float, xs:double, xs:date, xs:time, xs:dateTime, xs:yearMonthDuration, xs:dayTimeDuration }

    statEnv |-  (FN-URI,"min")(Type) : Type0 · aggregate_quantifier(quantifier(Type))

    Type1 = prime(Type)
    Type2 = convert_untypedAtomic(Type1, xs:double)
    Type2 = empty

    statEnv |-  (FN-URI,"max")(Type) : empty

    Type1 = prime(Type)
    Type2 = convert_untypedAtomic(Type1, xs:double)
    Type2 = FormalItemType 1, ...,FormalItemType n
    statEnv |- FormalItemType 1 can be promoted to Type0
    ...
    statEnv |- FormalItemType n can be promoted to Type0
    Type0 in { xs:string, xs:integer, xs:decimal, xs:float, xs:double, xs:date, xs:time, xs:dateTime, xs:yearMonthDuration, xs:dayTimeDuration }

    statEnv |-  (FN-URI,"max")(Type) : Type0 · aggregate_quantifier(quantifier(Type))

    For fn:avg, the target type Type0 is either xs:decimal, xs:float, xs:double, xs:yearMonthDuration, or xs:dayTimeDuration .

    Type1 = prime(Type)
    Type2 = convert_untypedAtomic(Type1, xs:double)
    Type2 = empty

    statEnv |-  (FN-URI,"avg")(Type) : empty

    Type1 = prime(Type)
    Type2 = convert_untypedAtomic(Type1, xs:double)
    FormalItemType 1, ...,FormalItemType n = Type2
    statEnv |- FormalItemType 1 can be promoted to Type0
    ...
    statEnv |- FormalItemType n can be promoted to Type0
    Type0 in { xs:decimal, xs:float, xs:double, xs:yearMonthDuration, xs:dayTimeDuration }

    statEnv |-  (FN-URI,"avg")(Type) : Type0 · aggregate_quantifier(quantifier(Type))

    For fn:sum, the target type Type0 is either xs:integer, xs:decimal, xs:float, xs:double, xs:yearMonthDuration, or xs:dayTimeDuration . The second argument in fn:sum is the value that should be returned if the input sequence is empty. The result type is the union of the target type and the type of the second argument. Note that the rule checks that the type for the zero value is consistent with the type of the input sequence.

    Type1 = prime(Type)
    Type2 = convert_untypedAtomic(Type1, xs:double)
    Type2 = empty

    statEnv |-  (FN-URI,"sum")(Type) : xs:integer

    statEnv |- Type2 <: xs:anyAtomicType ?
    Type3 = prime(Type1)
    Type4 = convert_untypedAtomic(Type3, xs:double)
    FormalItemType 1, ...,FormalItemType n = Type4
    statEnv |- FormalItemType 1 can be promoted to Type0
    ...
    statEnv |- FormalItemType n can be promoted to Type0
    statEnv |- Type2 <: Type0
    Type0 in { xs:integer, xs:decimal, xs:float, xs:double, xs:yearMonthDuration }

    statEnv |-  (FN-URI,"sum")(Type1,Type2) : Type0 · aggregate_quantifier(quantifier(Type1))

    with:

    Now we can define the static typing rules for the aggregate functions. Note that the normalization rules of [4.1.5 Function Calls] will have wrapped each argument in calls to fn:data() and fs:convert-simple-operand() (with a 'prototypical value' of type xs:double). Thus, static analysis of the call to an aggregate function is guaranteed that any argument type is a subtype of xs:anyAtomicType*, with no occurrences of xs:untypedAtomic.

    First, we can quickly deal with fn:avg. For the purposes of static type analysis, fn:avg($arg) is equivalent to fs:div( fn:sum($arg,()), fn:count($arg) ) Thus, we have the rule:

    statEnv |- (FN-URI,"sum")( Type1, empty) : Type2
    statEnv |- (FS-URI,"div")( Type2, xs:integer) : Type3

    statEnv |- (FN-URI,"avg")( Type1) : Type3

    For the remaining aggregate functions (fn:min, fn:max, and fn:sum), the general approach is as follows. First, we check that the input type(s) are acceptable for the function. Then we construct the (first) argument's prime type, a union of AtomicTypeNames. For each of the latter, we find the 'base atomic type'. The union of these base atomic types is the basis for the result type, which may finally be adjusted for cardinality (fn:min and fn:max) or for the effect of the second argument (fn:sum). In addition, we provide a rule for the special case when the (first) argument has type 'empty'.

    For fn:min and fn:max, the permitted input types are all those for which ge(T,T) and le(T,T) are defined. An empty input sequence yields an empty result.

    expanded-QName in { (FN-URI,"min"), (FN-URI,"max") }
    Type = empty

    statEnv |- expanded-QName(Type) : empty

    expanded-QName in { (FN-URI,"min"), (FN-URI,"max") }
    statEnv |- Type1 <: Type3*
    Type3 in { fs:numeric, xs:anyURI|xs:string, xs:yearMonthDuration, xs:dayTimeDuration , xs:date, xs:time, xs:dateTime, xs:boolean }
    prime(Type1) = AtomicTypeName 1 | ... | AtomicTypeName n
    statEnv |- AtomicTypeName 1 has base atomic type AtomicTypeName 1'
    ...
    statEnv |- AtomicTypeName n has base atomic type AtomicTypeName n'
    AtomicTypeName 1' | ... | AtomicTypeName n' = Type4

    statEnv |-  expanded-QName(Type1) : Type4 · aggregate_quantifier(quantifier(Type1))

    For fn:sum, the permitted input types for the first argument are all those for which plus(T,T) is defined. If you pass an empty sequence as the first argument, the function returns the value of the second argument.

    Type1 = empty
    statEnv |- Type2 <: xs:anyAtomicType?

    statEnv |- (FN-URI,"sum")( Type1,Type2) : Type2

    statEnv |- Type1 <: Type3*
    Type3 in {fs:numeric, xs:yearMonthDuration, xs:dayTimeDuration }
    statEnv |- Type2 <: xs:anyAtomicType?
    prime(Type1) = AtomicTypeName 1 | ... | AtomicTypeName n
    statEnv |- AtomicTypeName 1 has base atomic type AtomicTypeName 1'
    ...
    statEnv |- AtomicTypeName n has base atomic type AtomicTypeName n'
    AtomicTypeName 1' | ... | AtomicTypeName n' = Type4
    statEnv |- second argument contribution for sum with Type1 and Type2 is Type2'

    statEnv |- (FN-URI,"sum")( Type1,Type2) : Type4 | Type2'

    The second argument's contribution (if any) to the above result type is determined as follows. If the first argument could be the empty sequence, we add the type of the second argument to the result type. Otherwise, the type of the second argument is ignored.

    statEnv |- empty <: Type1

    statEnv |- second argument contribution for sum with Type1 and Type2 is Type2

    statEnv |- not (empty <: Type1)

    statEnv |- second argument contribution for sum with Type1 and Type2 is none

  4. In B Index of judgments, insert:

    and insert:

FS.E032 - substantive

See Bug 5747

Description

Rework the rules for CastableExpr to avoid raising type errors (and fix various other problems).

History

5 Jul 2008: Proposed

15 Jul 2008: Accepted

25 Aug 2008: Issued

Changes

  1. In 4.12.4 Castable / Normalization, replace:

     
    [Expr castable as AtomicType]Expr
    ==
    let $v as xs:anyAtomicType := fn:data(([ Expr ]Expr)) return
    $v castable as AtomicType
     
    [Expr castable as AtomicType?]Expr
    ==
    let $v as xs:anyAtomicType? := fn:data(([ Expr ]Expr)) return
    $v castable as AtomicType?

    with:

     
    [Expr castable as SingleType]Expr
    ==
    ( [Expr]Expr ) castable as SingleType
  2. In 4.12.4 Castable, before Dynamic Evaluation, insert:

    Notation

    The auxiliary judgment:

    Valuecan be cast toSingleType

    holds when Value can be atomized and cast to SingleType. Its definition depends on the cast value to type judgment.


    () can be cast to AtomicType?

    Value can be cast to AtomicType

    Value can be cast to AtomicType?

    fn:data(Value) = AtomicValue1
    AtomicValue1 cast value to type AtomicType => AtomicValue2

    Value can be cast to AtomicType

  3. In 4.12.4 Castable / Dynamic Evaluation, replace:

    If casting succeeds, then the castable expression evaluates to true.

    with:

    If the value of the operand expression can be cast to the given type, then the castable expression evaluates to true.

  4. In 4.12.4 Castable / Dynamic Evaluation / rule 1, replace:

    dynEnv |- Expr cast as AtomicType => Value2

    dynEnv |- Expr castable as AtomicType => true

    with:

    dynEnv |- Expr => Value
    Value can be cast to SingleType

    dynEnv |- Expr castable as SingleType => true

  5. In 4.12.4 Castable / Dynamic Evaluation / rule 2, replace:

    dynEnv |- not(Expr => Value1)

    dynEnv |-  Expr1 castable as AtomicType2 => false

    with:

    dynEnv |- Expr => Value
    not(Value can be cast to SingleType)

    dynEnv |-  Expr castable as SingleType => false

  6. In B Index of judgments, insert:

FS.E031 - substantive

See Bug 3771

Description

Don't use the "interleave with empty text nodes" technique for attribute constructors.

History

18 Mar 2008: Proposed

18 Mar 2008: Accepted

24 Aug 2008: Issued

Changes

  1. In 4.7.1.1 Attributes / Normalization, replace:

    To apply []AttributeContent to zero or more attribute-content units, we normalize each unit individually and construct a sequence of the normalized results interleaved with empty text nodes. The empty text nodes guarantee that the results of evaluating consecutive attribute-content units can be distinguished. Then we apply the function fs:item-sequence-to-untypedAtomic, which applies the appropriate conversion rules to the normalized attribute content:

    with:

    To apply []AttributeContent to zero or more attribute-content units, we normalize each unit individually and construct a sequence of the normalized results . Then we apply the function fn:string-join, which will concatenate the values of the normalized units.

  2. In 4.7.1.1 Attributes / Normalization / rule 5, replace:

     
    [ AttributeContentUnit1 ... AttributeContentUnitn ]AttributeContent
    ==
    fs:item-sequence-to-untypedAtomic (([ AttributeContentUnit1 ]AttributeContentUnit , text { "" }, ..., text {""}, [ AttributeContentUnitn]AttributeContentUnit) )

    with:

     
    [ AttributeContentUnit1 ... AttributeContentUnitn ]AttributeContent
    ==
    fn:string-join (([ AttributeContentUnit1 ]AttributeContentUnit , ..., [ AttributeContentUnitn]AttributeContentUnit) , '' )
  3. In 4.7.1.1 Attributes / Normalization, replace:

    We normalize an enclosed expression by normalizing each individual expression in its expression sequence and then constructing a sequence of the normalized values:

    with:

    We normalize an enclosed expression into a call to the function fs:item-sequence-to-string, which implements various rules for converting a sequence of atomic values and nodes into a string.

  4. In 4.7.1.1 Attributes / Normalization / rule 8, replace:

     
    [ { Expr1, ..., Exprn } ]AttributeContentUnit
    ==
    ([ Expr1 ]Expr , ..., [ Exprn]Expr)

    with:

     
    [ { Expr } ]AttributeContentUnit
    ==
    fs:item-sequence-to-string(( [ Expr ]Expr ))
  5. In 4.7.3.2 Computed Attribute Constructors / Normalization, replace:

    Computed attribute constructors are normalized by mapping their name and content expression in a similar way as computed element constructors. The normalization rule uses the fs:item-sequence-to-untypedAtomic function.

    with:

    Computed attribute constructors are normalized by mapping their name and content expression in a similar way as computed element constructors. The normalization rule uses the fs:item-sequence-to-string function.

  6. In 4.7.3.2 Computed Attribute Constructors / Normalization / rule 2, replace:

     
    [attribute QName { Expr }]Expr
    ==
    attribute QName { fs:item-sequence-to-untypedAtomic (([Expr]Expr)) }

    with:

     
    [attribute QName { Expr }]Expr
    ==
    attribute QName { fs:item-sequence-to-string (([Expr]Expr)) }
  7. In 4.7.3.2 Computed Attribute Constructors / Normalization / rule 3, replace:

     
    [attribute { Expr1 } { Expr2 }]Expr
    ==
    attribute { fn:data(([Expr1]Expr)) } { fs:item-sequence-to-untypedAtomic (([Expr2]Expr)) }

    with:

     
    [attribute { Expr1 } { Expr2 }]Expr
    ==
    attribute { fn:data(([Expr1]Expr)) } { fs:item-sequence-to-string (([Expr2]Expr)) }
  8. In 4.7.3.2 Computed Attribute Constructors / Static Type Analysis / rule 1, replace:

    statEnv |-  Expr : Type
    statEnv  |- Type <: xs:untypedAtomic

    statEnv |-  attribute QName { Expr } : attribute QName of type xs:untypedAtomic

    with:

    statEnv |-  Expr : Type
    statEnv  |- Type <: xs:string

    statEnv |-  attribute QName { Expr } : attribute QName of type xs:untypedAtomic

  9. In 4.7.3.2 Computed Attribute Constructors / Static Type Analysis / rule 2, replace:

    statEnv |-  Expr1 : Type1
    statEnv |- Type1 <: (xs:QName | xs:string | xs:untypedAtomic)
    statEnv |-  Expr2 : Type2
    statEnv |- Type2 <: xs:untypedAtomic

    statEnv |-  attribute { Expr1 } { Expr2 } : attribute * of type xs:untypedAtomic

    with:

    statEnv |-  Expr1 : Type1
    statEnv |- Type1 <: (xs:QName | xs:string | xs:untypedAtomic)
    statEnv |-  Expr2 : Type2
    statEnv |- Type2 <: xs:string

    statEnv |-  attribute { Expr1 } { Expr2 } : attribute * of type xs:untypedAtomic

  10. In 7.1.7 The fs:item-sequence-to-untypedAtomic function, replace every occurrence of:

    fs:item-sequence-to-untypedAtomic

    with:

    fs:item-sequence-to-string

    and in the function prototype, replace the return type:

    xs:untypedAtomic

    with:

    xs:string

    and replace

    ... converts a sequence of item values to a string of type xs:untypedAtomic by applying ...

    with:

    ... converts a sequence of item values to a string by applying ...

  11. In C.1 Functions and Operators used in the Formal Semantics, add:

FS.E030 - editorial

See Bug 5986

Description

Fix cross-reference in 4.7.3.4.

History

24 Aug 2008: Proposed

24 Aug 2008: Accepted

24 Aug 2008: Issued

Change

In 4.7.3.4 Text Node Constructors / Normalization, replace:

As formal specification of these conversion rules is not instructive, [7.1.7 The fs:item-sequence-to-untypedAtomic function] implements this conversion.

with:

As formal specification of these conversion rules is not instructive, the fs:item-sequence-to-untypedAtomic-text function implements this conversion.

FS.E029 - substantive

See Bug 3655

See Bug 3771

See Bug 4869

Description

Don't use the "interleave with empty text nodes" technique for element constructors.

History

14 May 2008: Proposed

7 Jul 2008: Accepted

21 Aug 2008: Issued

Changes

  1. In 4.7.1 Direct Element Constructors / Normalization, replace:

    We normalize each unit individually and construct a sequence of the normalized results interleaved with empty text nodes. The empty text nodes guarantee that the results of evaluating consecutive element-content units can be distinguished. Then we apply the function fs:item-sequence-to-node-sequence. Section 3.7.1 Direct Element ConstructorsXQ specifies the rules for converting a sequence of atomic values and nodes into a sequence of nodes before element construction. The Formal Semantics function fs:item-sequence-to-node-sequence implements these conversion rules.

    with:

    We normalize each unit individually and construct a sequence of the normalized results.

  2. In 4.7.1 Direct Element Constructors / Normalization / rule 4, replace:

     
    [ElementContentUnit 1, ..., ElementContentUnit n]ElementContent
    ==
    fs:item-sequence-to-node-sequence(( [ ElementContentUnit 1 ]ElementContentUnit , text { "" }, ..., text { "" }, [ ElementContentUnit n]ElementContentUnit ))

    with:

     
    [ElementContentUnit 1, ..., ElementContentUnit n]ElementContent
    ==
    [ ElementContentUnit 1 ]ElementContentUnit , ..., [ ElementContentUnit n]ElementContentUnit
  3. In 4.7.1 Direct Element Constructors / Normalization, remove:

    We must distinguish between the results of consecutive element-content units, because the rule for converting sequences of atomic values into strings applies to sequences within distinct enclosed expressions. The empty text nodes are eliminated during evaluation of fs:item-sequence-to-node-sequence when consecutive text nodes are coalesced into a single text node. The text node guarantees that a whitespace character will not be inserted between atomic values computed by distinct enclosed expressions. For example, here is an expression, its normalization, and the resulting XML value:

                    <example>{ 1 }{ 2 }</example>
                     =
                    element example { fs:item-sequence-to-node-sequence ((1, text {""}, 2)) }
                     ==>
                    <example>12</example>
                    

    In the absence of the empty text node, the expression would evaluate to the following incorrect value:

                    <example>{ 1 }{ 2 }</example>
                     (incorrect normalization) =
                    element example { fs:item-sequence-to-node-sequence ((1, 2)) }
                     (incorrect value) ==>
                    <example>1 2</example>
                    

    and replace:

    An enclosed expression in element content is normalized by normalizing each individual expression in its expression sequence and then constructing a sequence of the normalized values:

    with:

    An enclosed expression in element content is normalized into a call to the function fs:item-sequence-to-node-sequence, which implements various rules for converting a sequence of atomic values and nodes into a sequence of nodes before element construction.

  4. In 4.7.1 Direct Element Constructors / Normalization / rule 9, replace:

     
    [ { Expr1, ..., Exprn } ]ElementContentUnit
    ==
    [ Expr1 ]Expr , ..., [ Exprn]Expr

    with:

     
    [ { Expr } ]ElementContentUnit
    ==
    fs:item-sequence-to-node-sequence(( [Expr]Expr ))
  5. In 4.7.3.1 Computed Element Constructors, before Dynamic Evaluation, insert:

    Notation

    The following auxiliary judgment is used in the dynamic semantics of node constructors.

    Value0with text nodes processed isValue1

    This judgment is informally defined to hold when Value1 is obtained by applying the following modifications to Value0:

    • Adjacent text nodes in Value0 are merged into a single text node by concatenating their contents, with no intervening blanks.

    • After concatenation, any text node whose content is a zero-length string is deleted from the sequence.

  6. In 4.7.3.1 Computed Element Constructors / Dynamic Evaluation, replace:

    Second, the expression is evaluated, and the resulting value Value0 must match zero-or-more attributes followed by zero-or-more element, text, processing-instruction or comment nodes.

    with:

    Second, the expression is evaluated, and its value's text nodes are processed. The resulting sequence must match zero-or-more attributes followed by zero-or-more element, text, processing-instruction or comment nodes.

  7. In 4.7.3.1 Computed Element Constructors / Dynamic Evaluation / rule 1, replace:

    Expr = Expr0
    statEnvn; dynEnv |-  Expr0 => Value0
    statEnv  |-  Value0 matches (attribute**, (element * | text | processing-instruction * | comment)*)

    statEnv; dynEnv |-  element QName { Expr } {} => element QName of type xs:anyType { Value0 } { }

    with:

    Expr = Expr0
    statEnvn; dynEnv |-  Expr0 => Value0
    Value0 with text nodes processed is Value1
    statEnv  |-  Value1 matches (attribute**, (element * | text | processing-instruction * | comment)*)

    statEnv; dynEnv |-  element QName { Expr } {} => element QName of type xs:anyType { Value1 } { }

  8. In 4.7.3.1 Computed Element Constructors / Dynamic Evaluation / rule 2, replace:

    ...
    statEnvn; dynEnv |- Expr0 => Value0
    statEnv  |-  Value0 matches (attribute**, (element * | text | processing-instruction * | comment)*)
    NamespaceBindings = NamespaceBinding 1, ..., NamespaceBinding n, fs:active_ns(statEnv), fs:get_static_ns_from_items(statEnv, Value0 )

    statEnv; dynEnv |-  element QName { Expr } { LocalNamespaceDecls } => element QName of type xs:anyType { Value0 } { NamespaceBindings }

    with:

    ...
    statEnvn; dynEnv |- Expr0 => Value0
    Value0 with text nodes processed is Value1
    statEnv  |-  Value1 matches (attribute**, (element * | text | processing-instruction * | comment)*)
    NamespaceBindings = NamespaceBinding 1, ..., NamespaceBinding n, fs:active_ns(statEnv), fs:get_static_ns_from_items(statEnv, Value1 )

    statEnv; dynEnv |-  element QName { Expr } { LocalNamespaceDecls } => element QName of type xs:anyType { Value1 } { NamespaceBindings }

  9. In 4.7.3.3 Document Node Constructors / Normalization, replace:

    A document node constructor contains an expression, which must evaluate to a sequence of element, text, comment, or processing-instruction nodes. Section 3.7.3.3 Document Node ConstructorsXQ specifies the rules for converting a sequence of atomic values and nodes into a sequence of nodes before document construction. The built-in function [7.1.6 The fs:item-sequence-to-node-sequence-doc function] implements this conversion.

    with:

    A document node constructor contains an expression, which must evaluate to a sequence of element, text, comment, or processing-instruction nodes. Section 3.7.3.3 Document Node ConstructorsXQ specifies the rules for converting a sequence of atomic values and nodes into a sequence of nodes before document construction. The built-in function fs:item-sequence-to-node-sequence implements most of this conversion.

  10. In 4.7.3.3 Document Node Constructors / Normalization / rule 1, replace:

     
    [document { Expr }]Expr
    ==
    document { fs:item-sequence-to-node-sequence-doc (([Expr]Expr)) }

    with:

     
    [document { Expr }]Expr
    ==
    document { fs:item-sequence-to-node-sequence (([Expr]Expr)) }
  11. In 4.7.3.3 Document Node Constructors / Static Type Analysis, replace:

    The static typing rule does not need to check that the type of the argument expression is a sequence of element, text, processing-instruction, and comment nodes, as it is already checked by the fs:item-sequence-to-node-sequence-doc introduced during normalization. The type of the entire expression is the most general document type, because the document constructor erases all type annotationXQ on its content nodes.

    with:

    The type of the entire expression is the most general document type, because the document constructor erases all type annotationXQ on its content nodes.

  12. In 4.7.3.3 Document Node Constructors / Static Type Analysis / rule 1, replace:

    statEnv |-  Expr : Type

    statEnv |-  document { Expr } : document { Type }

    with:

    statEnv |-  Expr : Type
    statEnv |- Type <: (element*|text|processing-instruction*|comment)*

    statEnv |-  document { Expr } : document { Type }

  13. In 4.7.3.3 Document Node Constructors / Dynamic Evaluation / rule 1, replace:

    statEnv.constructionMode = preserve
    dynEnv |-  Expr => Value
    statEnv |-  Value matches (element * | text | processing-instruction * | comment)*

    dynEnv |-  document { Expr } => document { Value }

    with:

    statEnv.constructionMode = preserve
    dynEnv |-  Expr => Value1
    Value1 with text nodes processed is Value2
    statEnv |-  Value2 matches (element * | text | processing-instruction * | comment)*

    dynEnv |-  document { Expr } => document { Value2 }

  14. In 4.7.3.3 Document Node Constructors / Dynamic Evaluation / rule 2, replace:

    statEnv.constructionMode = strip
    dynEnv |-  Expr => Value1
    Value1 erases to Value2
    statEnv |-  Value2 matches (element * | text | processing-instruction * | comment)*

    dynEnv |-  document { Expr } => document { Value2 }

    with:

    statEnv.constructionMode = strip
    dynEnv |-  Expr => Value1
    Value1 erases to Value2
    Value2 with text nodes processed is Value3
    statEnv |-  Value3 matches (element * | text | processing-instruction * | comment)*

    dynEnv |-  document { Expr } => document { Value3 }

  15. In 7.1.5 The fs:item-sequence-to-node-sequence function, replace:

    The fs:item-sequence-to-node-sequence function converts a sequence of item values to nodes by applying the normative rules numbered 1, 2, 3 after the sentence "Processing of the computed element constructor proceeds as follows:" in Section 3.7.3.1 Computed Element ConstructorsXQ.

    with:

    The fs:item-sequence-to-node-sequence function converts a sequence of item values to nodes by applying the normative rules numbered 1e and 2 in Section 3.7.1.3 ContentXQ (with the value bound to $items playing the role of "the value of an enclosed expression").

    and replace:

    If the input sequence contains any attribute nodes, they must precede any other items, with the exception that text nodes are allowed throughout. This exception results in looser type checking, but it is necessitated by the possible presence of empty text nodes introduced by normalization of direct element constructors (see [4.7.1 Direct Element Constructors]).

    with:

    If the input sequence contains any attribute nodes, they must precede any other items.

  16. In 7.1.5 The fs:item-sequence-to-node-sequence function / Static Type Analysis, insert:

    statEnv |-  Type <: attribute**

    statEnv |-  (FS-URI,"item-sequence-to-node-sequence")( Type) : attribute**

    statEnv |-  Type <: (element*|text|processing-instruction*|comment|document|xs:anyAtomicType)*

    statEnv |-  (FS-URI,"item-sequence-to-node-sequence")( Type) : (element*|text|processing-instruction*|comment)*

  17. In 7.1.5 The fs:item-sequence-to-node-sequence function / Static Type Analysis / rule 1, replace:

    statEnv |- Type <: ( attribute**, (element *|document|processing-instruction *|comment|xs:string|xs:float|...| xs:NOTATION)* ) & text*

    statEnv |- (FS-URI,"item-sequence-to-node-sequence") (Type) : attribute**, (element *|text|processing-instruction *|comment)*

    with:

    statEnv |- Type <: attribute**, (element *|text|processing-instruction *|comment|document|xs:anyAtomicType)*

    statEnv |- (FS-URI,"item-sequence-to-node-sequence") (Type) : attribute**, (element *|text|processing-instruction *|comment)*

  18. In 7.1 Formal Semantic Functions, remove:

    7.1.6 The fs:item-sequence-to-node-sequence-doc function

    fs:item-sequence-to-node-sequence-doc( $items as item()*) as node()*

    The fs:item-sequence-to-node-sequence-doc function converts a sequence of item values to nodes by applying the normative rules numbered 1, 2, 3 after the sentence "Processing of the document node constructor then proceeds as follows:" in Section 3.7.3.3 Document Node ConstructorsXQ.

    Static Type Analysis

    statEnv |- Type <: (element *|document|text|processing-instruction *|comment|xs:string|xs:float| ...|xs:NOTATION)*

    statEnv |- (FS-URI,"item-sequence-to-node-sequence-doc") (Type) : (element *|text|processing-instruction *|comment)*

  19. In B Index of judgments, insert:

FS.E028 - substantive

See Bug 5670

Description

Call fn:boolean() in normalization of Where clause

History

29 Apr 2008: Proposed

13 May 2008: Accepted

19 Aug 2008: Issued

Change

In 4.8.1 FLWOR expressions / Normalization / rule 3, replace:

if ( [Expr1]Expr ) then ...

with:

if ( fn:boolean(([Expr1]Expr)) ) then ...

FS.E027 - substantive

See Bug 5651

Description

Provide (non-default) static typing for fn:not().

History

24 Apr 2008: Proposed

29 Apr 2008: Accepted

17 Aug 2008: Issued

Changes

  1. In 7.2.4 The fn:boolean function, replace the title:

    The fn:boolean function

    with:

    The fn:boolean and fn:not functions
  2. In 7.2.4 The fn:boolean function / Static Type Analysis, after the first paragraph, add:

    The fn:not function has an implicit call to fn:boolean, and raises type errors for the same cases, so its static typing is the same as fn:boolean.

  3. In 7.2.4 The fn:boolean function / Static Type Analysis / rule 1, replace:

    statEnv |- Type <: (...)

    statEnv  |- (FN-URI,"boolean")( Type) : xs:boolean

    with:

    expanded-QName in { (FN-URI,"boolean"), (FN-URI,"not") }
    statEnv |- Type <: (...)

    statEnv  |- expanded-QName(Type) : xs:boolean

FS.E026 - editorial

See Bug 1757

Description

Fix small errors in section 7.2.4 [The fn:boolean function].

History

6 Oct 2006: Proposed

17 Aug 2008: Accepted

17 Aug 2008: Issued

Changes

  1. In 7.2.4 The fn:boolean function / Static Type Analysis, replace:

    The fn:boolean function as described in the [Functions and Operators] document takes an empty sequence, a sequence of one or more nodes, or a singleton value of type xs:boolean, xs:string, xs:untypedAtomic or some numeric type. All other values are illegal.

    with:

    The fn:boolean function as described in the [Functions and Operators] document takes an empty sequence, a sequence whose first item is a node, or a singleton value of type xs:boolean, xs:string, xs:anyURI,xs:untypedAtomic or some numeric type. All other values are illegal. The static typing of fn:boolean reflects these restrictions, but further constrains "a sequence whose first item is a node" to "a sequence of nodes".
  2. In 7.2.4 The fn:boolean function / Static Type Analysis / rule 1, replace:

    NodeType+

    with:

    [ node()+ ]sequencetype

FS.E025 - substantive

See Bug 5601

Description

For internal function fs:div, correct the result type in the Binary Operators table.

History

1 Apr 2008: Proposed

29 Apr 2008: Accepted

16 Aug 2008: Issued

Change

In C.2 Mapping of Overloaded Internal Functions / Notation 2, in the 'Binary Operators' table, replace:

fs:div(A, B) xs:integer xs:integer op:numeric-divide(A, B) xs:double

with:

fs:div(A, B) xs:integer xs:integer op:numeric-divide(A, B) xs:decimal

FS.E024 - editorial

See Bug 4841

Description

Introduce fs:item-at() function.

History

13 Nov 2007: Proposed

28 Nov 2007: Accepted

16 Aug 2008: Issued

Changes

  1. In 4.2.1 Steps / Normalization / rules 1+2+3+4, replace:

    fn:subsequence(..., ..., 1)

    with:

    fs:item-at(..., ...)
  2. In 4.2.1 Steps / Normalization, in the paragraph after rule 4, replace:

    The normalization rules above all use the function fn:subsequence to select a particular item. The static typing rules for this function are defined in [7.2.13 The fn:subsequence function].

    with:

    The normalization rules above all use the function fs:item-at to select a particular item. The static typing rules for this function are defined in [7.1.14 The fs:item-at function].
  3. In 4.3.2 Filter Expressions / Normalization, in the first paragraph, replace:

    it is normalized using the fn:subsequence function

    with:

    it is normalized using the fs:item-at function
  4. In 4.3.2 Filter Expressions / Normalization / rules 1+2, replace:

    fn:subsequence(..., ..., 1)

    with:

    fs:item-at(..., ...)
  5. In 7.1 Formal Semantics Functions, insert a new section:

    7.1.14 The fs:item-at function

    fs:item-at($sourceSeq as item()*, $loc as xs:double) as item()?

    The fs:item-at function returns the item at a specified position in a sequence.

    Dynamic Evaluation

    If $loc is numeric-equal to the position of some item in $sourceSeq, that item is returned. (This implies that $sourceSeq is non-empty, and $loc is numeric-equal to an integer between 1 and n inclusive, where n is the number of items in $sourceSeq.)

    Otherwise, the empty sequence is returned.

    The function is roughly equivalent to the following user-defined function.

                      declare function fs:item-at(
                          $sourceSeq as item()*,
                          $loc as xs:double) as item()?
                      {
                          if ($loc mod 1 eq 0) then
                              fn:subsequence($sourceSeq,$loc,1)
                          else
                              ()
                      };
                    

    Static Type Analysis

    The static typing rules for invocations of fs:item-at depend on the syntactic form of the second argument. If it is the IntegerLiteral 1, then we can be relatively precise about the resulting type.

    statEnv |- QName of func expands to (FS-URI,"item-at")
    statEnv |- Expr1 : Type1
    quantifier(Type1) in { 1, + }

    statEnv |- QName(Expr 1, 1) : prime(Type1)

    Otherwise, the following less precise rule is used.

    statEnv |- QName of func expands to (FS-URI,"item-at")
    statEnv |- Expr1 : Type1

    statEnv |- QName(Expr 1, Expr2) : prime(Type1) ?

    (Since invocations of fs:item-at arise only as the result of particular normalization rules, Expr2 in the above rule must be either $fs:last, $fs:position, or a NumericLiteral. Thus, there is no need to check its type.)

  6. In 7.2.13 The fn:subsequence function, replace the whole of the section content:

    Introduction

    The fn:subsequence function has special static typing rules when its second argument is the numeric literal value 1 or the built-in variable $fs:last. These rules provide better typing for path expressions such as Expr[1] and Expr[fn:last()].

    The static typing rules for fn:subsequence depends on the syntactic form of their input expression. As a result, the corresponding static typing rules must be written directly over the input expression, unlike the other functions in this section.

    Static Type Analysis

    If the type of the input expression has exactly one or one-or-more items, then the type inferred for fn:subsequence is the prime type of the input type.

    statEnv |- QName of func expands to (FN-URI,"subsequence")
    statEnv |- Expr : Type    quantifier(Type) in { 1, + }

    statEnv  |- QName(Expr, 1, 1) : prime(Type)

    If the type of the input expression has zero or more items, fn:subsequence is applied on a numeric literal, $fs:position, or $fs:last, then the static type is zero-or-one of the prime type of the input type. Those static typing rules are intended to support more precise typing for the cases where fn:subsequence is the result of normalizing an XPath predicate of the form Expr[NumericLiteral] of Expr[last()], see [4.2.1 Steps].

    statEnv |- QName of func expands to (FN-URI,"subsequence")
    statEnv |- Expr : Type    quantifier(Type) in { *, + }

    statEnv  |- QName(Expr, NumericLiteral, 1) : prime(Type) ?

    The same rule applies when the last item in the input sequence is selected.

    statEnv |- QName of func expands to (FN-URI,"subsequence")
    statEnv |- Expr : Type    quantifier(Type) in { *, + }

    statEnv  |- QName(Expr, $fs:last, 1) : prime(Type) ?

    The same rule applies when an item is selected based on its position in the input sequence.

    statEnv |- QName of func expands to (FN-URI,"subsequence")
    statEnv |- Expr : Type    quantifier(Type) in { *, + }

    statEnv  |- QName(Expr, $fs:position, 1) : prime(Type) ?

    The last rule applies to all other applications of the fn:subsequence function.

    statEnv |- QName of func expands to (FN-URI,"subsequence")
    statEnv |- Expr : Type
    statEnv |- Expr1 : xs:double    statEnv |- Expr2 : xs:double

    statEnv |-  QName(Expr, Expr1, Expr2) : prime(Type) · quantifier(Type) · ?

    with:

    Static Type Analysis

    The static type of a call to fn:subsequence is computed using prime() and quantifier(), which are defined in [8.4 Judgments for FLWOR and other expressions on sequences].

    statEnv |- Type2 <: fs:numeric    statEnv |- Type3 <: fs:numeric

    statEnv |-  (FN-URI,"subsequence")(Type1, Type2, Type3) : prime(Type1) · quantifier(Type1) · ?

  7. In C.1 Functions and Operators used in the Formal Semantics, remove:

  8. Section 15.1.10 fn:subsequenceFO

FS.E023 - editorial

See Bug 3269

Description

ElementNameOrWildcard and AttributeNameOrWildcard do not derive empty.

History

9 May 2006: Proposed

15 Jul 2006: Accepted

15 Jul 2008: Issued

Change

Wherever a judgment assumes that ElementNameOrWildcard or AttributeNameOrWildcard derives the empty string, change it to "*". For example, where "element" or "element of type TypeName" appears as an ElementType, insert a "*" after "element". Similarly, where "attribute" or "attribute of type TypeName" appears as an AttributeType, insert a "*" after "attribute".

The affected rules are as follows:

FS.E022 - substantive

See Bug 3946

Description

Make the static typing of processing-instructions consistent with their dynamic typing.

History

8 May 2007: Proposed

28 Nov 2007: Accepted

14 Jul 2008: Issued

Changes

  1. In 2.4.2 Item types (and identically in A.2 Formal BNF), replace:

    [27 (Formal)]    ElementContentType    ::=    ElementType
    | "comment"
    | "processing-instruction"
    | "text"

    with:

    [27 (Formal)]    ElementContentType    ::=    ElementType
    | "comment"
    | ProcessingInstructionType
    | "text"

    and insert:

    [93 (Formal)]    ProcessingInstructionType    ::=    "processing-instruction" PITargetOrWildcard
    [94 (Formal)]    PITargetOrWildcard    ::=    NCName | "*"
  2. In 3.5.4 SequenceType Matching / Normalization, replace:

    The [XPath/XQuery] type system does not model the target of a processing-instruction, which is treated as a dynamic property. Therefore a "processing-instruction" SequenceType with a string or NCName parameter is normalized into an optional processing-instruction type.

     
    [processing-instruction(StringLiteral) ]sequencetype
    ==
    processing-instruction?
     
    [processing-instruction(NCName)]sequencetype
    ==
    processing-instruction?

    with:

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

    For backward compatibility with XPath 1.0, the PITarget of a PITest may also be expressed as a string literal. The following rule handles that case.

    StringLiteral has atomic value String
    xs:NCName(String) = NCName

    [processing-instruction(StringLiteral) ]sequencetype = processing-instruction NCName

  3. In 4.7.3.5 Computed Processing Instruction Constructors / Static Type Analysis / rule 1, replace:

    processing-instruction

    with:

    processing-instruction NCName
  4. In 8.2.3.1.2 Kind Tests / Processing instruction, comment, and text kind tests, replace:


    statEnv |-  test processing-instruction() with PrincipalNodeKind of processing-instruction : processing-instruction

    A processing-instruction node test with a string literal or NCName matches a processing instruction whose target has the given name. Since target matching cannot be checked statically, the static type of the node test is zero-or-one processing instruction.


    statEnv |-  test processing-instruction(StringLiteral | NCName) with PrincipalNodeKind of processing-instruction : processing-instruction?

    with:

    [PITest]sequencetype = processing-instruction *

    statEnv |-  test PITest with PrincipalNodeKind of ProcessingInstructionType : ProcessingInstructionType

    A processing-instruction node test with a string literal or NCName matches a processing instruction whose target has the given name.

    [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 ?

  5. In 8.3.1 Matches / Semantics, replace:

    A processing-instruction node matches processing-instruction.


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

    with:

    A processing-instruction node matches the general processing-instruction type, and also the particular processing-instruction type that shares its PITarget.


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


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

  6. Anywhere else that "processing-instruction" is used as a Type, replace:

    processing-instruction

    with:

    processing-instruction *

    More specifically, that's in:

FS.E021 - substantive

See Bug 3818

Description

Avoid loss of type information in normalized path expressions.

History

20 Feb 2007: Proposed

3 May 2007: Accepted

8 Jul 2008: Issued

Changes

  1. In 4.2 Path Expressions / Normalization / rule 5, replace:

    let $fs:sequence as node()* := [RelativePathExpr]Expr return

    with:

    let $fs:sequence := fs:node-sequence( [RelativePathExpr]Expr ) return
  2. In 7.1 Formal Semantics Functions, add the section:

    7.1.13 The fs:node-sequence function

    fs:node-sequence($nodes as node()*) as node()*

    If the input is a (possibly empty) sequence of nodes, fs:node-sequence simply returns that sequence. Otherwise, it raises a type error.

    Static Type Analysis

    The static type of a call to fs:node-sequence is that of its argument, as long as that type is a subtype of node()*.

    statEnv |-  Type <: [node()*]sequencetype

    statEnv |-  (FS-URI,"node-sequence")( Type) : Type

FS.E020 - editorial

See Bug 4766

Description

Correct errors in examples in section 2.4.4.

History

26 Jun 2007: Proposed

26 Jun 2007: Accepted

4 Oct 2007: Issued

Changes

  1. In 2.4.4 Top level definitions / Example 1, replace:

                      define type UKAddress extends ipo:Address {
                        attribute exportCode of type ipo:UKPostcode
                        element postcode of type positiveInteger
                      };
                    

    with:

                      define type UKAddress extends ipo:Address {
                        attribute exportCode of type positiveInteger,
                        element postcode of type ipo:UKPostcode
                      };
                    
  2. In 2.4.4 Top level definitions / Example 6, replace:

    A type declaration with one element name of type xs:string follows by one or more elements street of type xs:string.

                      define type Address {
                        element name of type xs:string,
                        element street of type xs:string*
                      }
                    

    with:

    A type declaration with one element name of type xs:string followed by one or more elements street of type xs:string.

                      define type Address {
                        element name of type xs:string,
                        element street of type xs:string+
                      }
                    
  3. In 2.4.4 Top level definitions / Example 7, replace:

                      define type USAddress extends Address {
                        element zip name of type xs:integer
                      }
                    

    with:

                      define type USAddress extends Address {
                        element zip of type xs:integer
                      }
                    

FS.E019 - substantive

See Bug 4578

Description

Correct a normalization error in section 4.3.2 Filter Expressions.

History

24 May 2007: Proposed

30 May 2007: Accepted

4 Oct 2007: Issued

Change

In 4.3.2 Filter Expressions / Normalization / rule 2, replace:

let $fs:sequence := [PrimaryExpr PredicateList]Expr return
fn:subsequence($fs:sequence, $fs:last,1)

with:

let $fs:sequence := [PrimaryExpr PredicateList]Expr return
let $fs:last := fn:count($fs:sequence) return
fn:subsequence($fs:sequence, $fs:last,1)

FS.E018 - substantive

See Bug 4242

See Bug 4261

See Bug 4512

See Bug 4581

See Bug 5129

See Bug 3269

Description

Correct various errors in section 8.2.3.1.1.

History

28 Apr 2007: Proposed

3 May 2007: Accepted

3 Oct 2007: Issued

Changes

  1. The following 6 changes resolve bugs 4242, 4261(a), and 4581 (by adding a "?" at the end of the result types), and some of 3269 (by fixing the input types in four of the rules).

  2. In rule 2 / conclusion, replace:

    statEnv |-  test QName2 with element of element * OptTypeSpecifier : element QName2 OptTypeSpecifier

    with:

    statEnv |-  test QName2 with element of element * OptTypeSpecifier : element QName2 OptTypeSpecifier ?
  3. In rule 5 / conclusion, replace:

    statEnv |-  test *:LocalPart2 with element of element * OptTypeSpecifier : element *:LocalPart2 OptTypeSpecifier

    with:

    statEnv |-  test *:LocalPart2 with element of element * OptTypeSpecifier : element * OptTypeSpecifier ?
  4. In rule 7 / conclusion, replace:

    statEnv |-  test Prefix2:* with element of element * OptTypeSpecifier : element Prefix2:* OptTypeSpecifier

    with:

    statEnv |-  test Prefix2:* with element of element * OptTypeSpecifier : element * OptTypeSpecifier ?
  5. In rule 10 / conclusion, replace:

    statEnv |-  test QName2 with attribute of attribute * OptTypeReference : attribute QName2 OptTypeReference

    with:

    statEnv |-  test QName2 with attribute of attribute * OptTypeReference : attribute QName2 OptTypeReference ?
  6. In rule 13 / conclusion, replace:

    statEnv |-  test *:LocalPart2 with attribute of attribute * OptTypeReference : attribute *:LocalPart2 OptTypeReference

    with:

    statEnv |-  test *:LocalPart2 with attribute of attribute * OptTypeReference : attribute * OptTypeReference ?
  7. In rule 15 / conclusion, replace:

    statEnv |-  test Prefix2:* with attribute of attribute * OptTypeReference : attribute Prefix2:* OptTypeReference

    with:

    statEnv |-  test Prefix2:* with attribute of attribute * OptTypeReference : attribute * OptTypeReference ?
  8. The following 3 changes resolve bugs 4261(b), 4261(c), and 5129, respectively.

  9. In rule 4, delete premises 2 and 3:

    statEnv.namespace(Prefix1) = (NamespaceKind,AnyURI)
    fn:namespace-uri-from-QName(expanded-QName1) = AnyURI
  10. In rule 6 / premise 2, replace:

    statEnv.namespace(Prefix 1 ) = (NamespaceKind,AnyURI)

    with:

    statEnv.namespace(Prefix 2 ) = (NamespaceKind,AnyURI)
  11. In rule 14 / premise 2, replace:

    statEnv |-  QName1 of elem/type expands to expanded-QName1

    with:

    statEnv |-  QName1 of attr expands to expanded-QName1
  12. The following 7 changes resolve bug 4261(d).

  13. Between rules 1 and 2, insert this rule:

    statEnv |-  QName1 of elem/type expands to expanded-QName1
    statEnv |-  QName2 of elem/type expands to expanded-QName2
    not( expanded-QName1 = expanded-QName2 )

    statEnv |-  test QName2 with element of element QName1 OptTypeSpecifier 1 : empty
  14. Between rules 4 and 5, insert this rule:

    statEnv |-  QName1 of elem/type expands to expanded-QName1
    fn:local-name-from-QName(expanded-QName1) = LocalPart1
    not( LocalPart1 = LocalPart2 )

    statEnv |-  test *:LocalPart2 with element of element QName1 OptTypeSpecifier 1 : empty
  15. Between rules 6 and 7, insert this rule:

    statEnv |-  QName1 of elem/type expands to expanded-QName1
    fn:namespace-uri-from-QName(expanded-QName1) = AnyURI1
    statEnv.namespace(Prefix2) = (NamespaceKind,AnyURI 2)
    not( AnyURI1 = AnyURI2 )

    statEnv |-  test Prefix2:* with element of element QName1 OptTypeSpecifier 1 : empty
  16. Between rules 9 and 10, insert this rule:

    statEnv |-  QName1 of attr expands to expanded-QName1
    statEnv |-  QName2 of attr expands to expanded-QName2
    not( expanded-QName1 = expanded-QName2 )

    statEnv |-  test QName2 with attribute of attribute QName1 OptTypeReference : empty
  17. Between rules 12 and 13, insert this rule:

    statEnv |-  QName1 of attr expands to expanded-QName1
    fn:local-name-from-QName(expanded-QName1) = LocalPart1
    not( LocalPart1 = LocalPart2 )

    statEnv |-  test *:LocalPart2 with attribute of attribute QName1 OptTypeReference : empty
  18. Between rules 14 and 15, insert this rule:

    statEnv |-  QName1 of attr expands to expanded-QName1
    fn:namespace-uri-from-QName(expanded-QName1) = AnyURI1
    statEnv.namespace(Prefix2) = (NamespaceKind,AnyURI 2)
    not( AnyURI1 = AnyURI2 )

    statEnv |-  test Prefix2:* with attribute of attribute QName1 OptTypeReference : empty
  19. Delete rule 17:

    Lastly, if none of the above rules holds, then the type of the input expression is empty.

    ElementNameOrWildcard 1 = NameTest
    TypeSpecifier1 = of type xs:anyType
    statEnv |-  not(element ElementNameOrWildcard 1 TypeSpecifier1 <: element ElementNameOrWildcard 2 TypeSpecifier2)
    statEnv |-  not(element ElementNameOrWildcard 2 TypeSpecifier2 <: element ElementNameOrWildcard 1 TypeSpecifier1)
    statEnv |-  TypeSpecifier1 expands to Type1
    statEnv |-  TypeSpecifier2 expands to Type2
    statEnv |-  not(Type1 <: Type2)
    statEnv |-  not(Type2 <: Type1)

    statEnv |-  test NameTest with element of element ElementNameOrWildcard 2 TypeSpecifier2 : empty
  20. The following 2 changes resolve bug 4512(a).

  21. In rule 8 / conclusion, replace:

    statEnv |-  test * with element of element QName OptTypeSpecifier : element QName OptTypeSpecifier

    with:

    statEnv |-  test * with element of ElementType : ElementType
  22. In rule 16 / conclusion, replace:

    statEnv |-  test * with attribute of attribute QName OptTypeReference : attribute QName OptTypeReference

    with:

    statEnv |-  test * with attribute of AttributeType : AttributeType
  23. The following 2 changes resolve bug 4512(b).

  24. Between rules 8 and 9, insert this rule:

    not( Type is an element type )

    statEnv |-  test NameTest with element of Type : empty
  25. Between rule 16 and 17, insert this rule:

    not( Type is an attribute type )

    statEnv |-  test NameTest with attribute of Type : empty
  26. The next 2 changes resolve some more of bug 3269.

  27. Delete rule 3:


    statEnv |-  test QName2 with element of element OptTypeSpecifier : element QName2 OptTypeSpecifier
  28. Delete rule 11:


    statEnv |-  test QName2 with attribute of attribute OptTypeReference : attribute QName2 OptTypeReference

FS.E017 - editorial

See Bug 4371

Description

Update the "Processing Model" diagram.

History

6 Mar 2007: Proposed

6 Mar 2007: Accepted

2 Oct 2007: Issued

Change

In 3.2.1 Processing model, in the diagram, add a box labelled "Modules", and an arrow labelled "(SQ3)" pointing from the "Modules" box to the "Static context" box.

FS.E016 - substantive

See Bug 3847

Description

For internal function fs:idiv, correct the operand types and supporting op: function given in the Binary Operators table.

History

18 Oct 2006: Proposed

14 Feb 2007: Accepted

2 Oct 2007: Issued

Change

In C.2 Mapping of Overloaded Internal Functions / Notation 2, in the 'Binary Operators' table, replace:

fs:idiv(A, B) xs:integer xs:integer op:integer-div(A, B) xs:integer

with:

fs:idiv(A, B) xs:integer xs:integer op:numeric-integer-divide(A, B) xs:integer
fs:idiv(A, B) xs:decimal xs:decimal op:numeric-integer-divide(A, B) xs:integer
fs:idiv(A, B) xs:float xs:float op:numeric-integer-divide(A, B) xs:integer
fs:idiv(A, B) xs:double xs:double op:numeric-integer-divide(A, B) xs:integer

FS.E015 - editorial

See Bug 1783

Description

Fix some small errors in section 8.4.

History

6 Oct 2006: Proposed

16 Jan 2007: Accepted

2 Oct 2007: Issued

Change

In 8.4 Judgments for FLWOR and other expressions on sequences, replace:

[Definition: A Prime types is a choice of item types].

with:

[Definition: A prime type is a choice of item types.]

FS.E014 - editorial

Superseded by Erratum FS.E033

See Bug 1756

Description

Fix small errors in section 7.2.3.

History

8 Sep 2006: Proposed

16 Jan 2007: Accepted

9 Aug 2007: Proposed

9 Aug 2007: Accepted

2 Oct 2007: Issued

Changes

  1. In 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions / Static Type Analysis / para 1, replace:

    Note that the fact that the type should be the least is cannot expressed by the inference rule notation used here.

    with:

    Note that the fact that the type should be the least is not expressed by the inference rule notation used here.

    and delete:

    Instead of writing a separate judgment for each function, we write one rule for the functions whose name is either (FN-URI,"abs"), (FN-URI,"ceiling"), (FN-URI,"floor"), (FN-URI,"round"), or (FN-URI,"round-half-to-even") functions.

  2. In 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions / Static Type Analysis / rule 1 / premise 5, replace:

    { (FN-URI,"ceiling"), (FN-URI,"floor"), (FN-URI,"round"), (FN-URI,"round-half-to-even") }

    with:

    { (FN-URI,"abs"), (FN-URI,"ceiling"), (FN-URI,"floor"), (FN-URI,"round"), (FN-URI,"round-half-to-even") }

FS.E013 - editorial

See Bug 1754

Description

Fix small errors in sections 7.2.1 and 7.2.2.

History

5 Oct 2006: Proposed

16 Jan 2007: Accepted

2 Oct 2007: Issued

Changes

  1. In 7.2.1 The fn:last context function / Dynamic Evaluation / rule 1 / conclusion, replace:

    dynEnv |-  function (FN-URI,"last")() with types on values yields Value

    with:

    dynEnv |-  function (FN-URI,"last") with types on values yields Value
  2. In 7.2.2 The fn:position context function / Dynamic Evaluation / rule 1 / conclusion, replace:

    dynEnv |-  function (FN-URI,"position")() with types on values yields Value

    with:

    dynEnv |-  function (FN-URI,"position") with types on values yields Value

FS.E012 - editorial

See Bug 3771

Description

Static Type Analysis must allow for empty text nodes introduced during normalization of direct element constructors.

History

10 Oct 2006: Proposed

19 Oct 2006: Accepted

2 Oct 2007: Issued

Changes

  1. In 4.7.3.1 Computed Element Constructors / Static Type Analysis, replace:

    The content expression must return a sequence of nodes with all the attribute nodes before any element, processing-instructions or comment nodes. Note that the type allows text nodes interleaved with attribute nodes in the beginning. Although this results in a looser type checking, this accounts for the possible presence of empty text nodes resulting from normalization of direct element constructors (See [4.7.1 Direct Element Constructors]).

    with:

    The content expression must return a sequence of nodes with attribute nodes at the beginning.

    and in each of the four rules, in the last premise, replace:

    (attribute*, (element | comment | processing-instruction)*) & text*

    with:

    attribute *, (element | text | comment | processing-instruction) *

  2. In 7.1.5 The fs:item-sequence-to-node-sequence function / Static Type Analysis, insert:

    If the input sequence contains any attribute nodes, they must precede any other items, with the exception that text nodes are allowed throughout. This exception results in looser type checking, but it is necessitated by the possible presence of empty text nodes introduced by normalization of direct element constructors (see [4.7.1 Direct Element Constructors]).

    and in the subsequent rule, replace:

    attribute*, (element|document|text|processing-instruction|comment|xs:string| xs:float| ...|xs:NOTATION)*

    with:

    ( attribute*, (element|document|processing-instruction|comment|xs:string| xs:float|...|xs:NOTATION)* ) & text*

FS.E011 - editorial

See Bug 3758

See Bug 3760

Description

Correct/simplify/complete the Normalization rules defining []ElementContent and []AttributeContent, and simplify the corresponding Dynamic Evaluation rules.

History

10 Oct 2006: Proposed

19 Oct 2006: Accepted

1 Oct 2007: Issued

Changes

  1. In 4.7.1 Direct Element Constructors / Normalization, delete:

    We distinguish between direct element constructors that contain only one element-content unit and those that contain more than one element-content unit.

    and delete rule 3:

     
    [ElementContentUnit 1]ElementContent
    ==
    fs:item-sequence-to-node-sequence(( [ ElementContentUnit 1]ElementContentUnit))

    and after the former rule 4 / now rule 3, insert:

    (Note that this rule should be understood to cover the degenerate cases of n=0 and n=1, where the element constructor's content consists of zero or one element-content units.)

  2. In 4.7.1.1 Attributes / Normalization, replace:

    As with literal XML elements, we need to distinguish between direct attribute constructors that contain one attribute-content unit and those that contain multiple attribute-content units, because the rule for converting sequences of atomic values into strings is applied to sequences within distinct enclosed expressions. If the direct attribute constructor contains exactly one attribute-content unit, we simply normalize that unit by applying the normalization rule for attribute content units:

     
    [ AttributeContentUnit1 ]AttributeContent
    ==
    [AttributeContentUnit1]AttributeContentUnit

    If the direct attribute constructor contains more than one attribute-content unit, we normalize each unit individually and ...

    with:

    To apply []AttributeContent to zero or more attribute-content units, we normalize each unit individually and ...

    and after the former rule 5 / now rule 4, insert:

    (Note that this rule should be understood to cover the degenerate cases of n=0 and n=1, where the attribute constructor's content consists of zero or one attribute-content units.)

  3. In 4.7.3.2 Computed Attribute Constructors / Dynamic Evaluation, replace:

    Second, the function fs:item-sequence-to-untypedAtomic is applied to the content expression and this function call is evaluated in the dynamic environment. Recall from [4.7.3.2 Computed Attribute Constructors] that during normalization, we do not convert the content of direct attribute constructors that contain one attribute-content unit. This guarantees that useful type information is preserved for static analysis. Since the conversion function fs:item-sequence-to-untypedAtomic was not applied to all attribute constructors during normalization, we have to apply it at evaluation time. (As before, it is possible to elide the application of fs:item-sequence-to-untypedAtomic injected during normalization and the application injected during evaluation.)

    with:

    Second, the content expression is evaluated in the dynamic environment.

    and in rule 1 / premise 1, replace:

    dynEnv |-  fs:item-sequence-to-untypedAtomic(( Expr)) => AtomicValue

    with:

    dynEnv |-  Expr => AtomicValue

    and in rule 2 / premise 4, replace:

    dynEnv |-  fs:item-sequence-to-untypedAtomic(( Expr2)) => AtomicValue2

    with:

    dynEnv |-  Expr2 => AtomicValue2

FS.E010 - editorial

See Bug 3670

Description

Clean up due to the removal of op:anyURI-equal from the F+O spec.

History

26 Sep 2006: Proposed

26 Sep 2006: Accepted

30 Sep 2007: Issued

Changes

  1. In C.2 Mapping of Overloaded Internal Functions / Notation 2, in the 'Binary Operators' table, replace:

    fs:eq(A, B) xs:anyURI xs:anyURI op:anyURI-equal(A, B) xs:boolean
    ...
    fs:ne(A, B) xs:anyURI xs:anyURI fn:not(op:anyURI-equal(A, B)) xs:boolean

    with:

    fs:eq(A, B) xs:anyURI xs:anyURI op:numeric-equal(fn:compare(A, B), 0) xs:boolean
    ...
    fs:ne(A, B) xs:anyURI xs:anyURI fn:not(op:numeric-equal(fn:compare(A, B), 0)) xs:boolean
  2. In 8.5.1 Type Promotion / Semantics, insert:

    xs:anyURI can be promoted to xs:string:


    statEnv |-  xs:anyURI can be promoted to xs:string

FS.E009 - editorial

See Bug 3142

Description

Fix some errors in the productions for FunctionSig and TypeList.

History

21 Apr 2006: Proposed

24 Apr 2006: Accepted

29 Sep 2007: Issued

Change

In 3.1.1 Static Context / Notation and A.2 Formal BNF / Non-Terminals, replace:

[85 (Formal)]    FunctionSig    ::=    "declare" "function" expanded-QName "(" TypeList? ")" "as" SequenceType
[86 (Formal)]    TypeList    ::=    SequenceType ("," Type)*

with:

[85 (Formal)]    FunctionSig    ::=    "declare" "function" expanded-QName "(" TypeList? ")" "as" Type
[86 (Formal)]    TypeList    ::=    Type ("," Type)*

FS.E008 - editorial

See Bug 1680

Description

Fix a bug in the normalization of function calls.

History

17 Jul 2005: Proposed

24 Apr 2006: Accepted

29 Sep 2007: Issued

Changes

  1. In 4.1.5 Function Calls / Normalization / rule 1 / premise 2, replace:

    statEnv.typeDefn(expanded-QName) = define type QName2 AtomicTypeDerivation

    with:

    statEnv |-  not(expanded-QName denotes a constructor function)
  2. In 4.12.5 Constructor Functions, add the subsection:

    Notation

    Calls to constructor functions are normalized differently from other function calls, so we introduce an auxiliary judgment to detect whether the function being called is a constructor function.

    statEnv |- expanded-QNamedenotes a constructor function

    This judgment holds when the expanded function name maps to an atomic type in the in-scope schema types.

    statEnv.typeDefn(expanded-QName) = define type QName AtomicTypeDerivation

    statEnv |-  expanded-QName denotes a constructor function

  3. In 4.12.5 Constructor Functions / Normalization / para 1, replace:

    ... and checks whether than name stands for an atomic type in the static context.

    with:

    ... and confirm that it denotes a constructor function in the static context.

  4. In 4.12.5 Constructor Functions / Normalization / rule 1 / premise 2, replace:

    statEnv.typeDefn(expanded-QName) = define type QName2 AtomicTypeDerivation

    with:

    statEnv |-  expanded-QName denotes a constructor function
  5. In B Index of judgments / Auxiliary judgments, add:

    statEnv |-  expanded-QName denotes a constructor function

FS.E007 - editorial

See Bug 1694

Description

Fix miscellaneous small errors in section 5.

History

17 Jul 2005: Proposed

18 Apr 2006: Accepted

29 Sep 2007: Issued

Changes

  1. In 5 Modules and Prologs / Static Context Processing / rules 2+3 / premise 2, replace:

    [PrologDecl]PrologDecl == PrologDecl1

    with:

    [PrologDecl]PrologDecl = PrologDecl1
  2. In 5 Modules and Prologs / Static Type Analysis / rule 1 / premise 2, replace:

    statEnv |-  [QueryBody]Expr == Expr2

    with:

    statEnv |-  [QueryBody]Expr = Expr2
  3. In 5 Modules and Prologs / Dynamic Evaluation / rule 1, replace:

    dynEnvDefault |-  PrologDeclList =>dyn dynEnv
    statEnvDefault |-  PrologDeclList =>stat statEnv1
    statEnv |-  [QueryBody]Expr == Expr2
    dynEnv |-  Expr2 => Value

    with:

    #MAIN ; statEnvDefault |-  PrologDeclList =>stat statEnv with PrologDeclList1
    statEnv |-  [QueryBody]Expr = Expr2
    dynEnvDefault |-  PrologDeclList1 =>dyn dynEnv
    dynEnv |-  Expr2 => Value

FS.E006 - editorial

See Bug 3875

See Bug 3184

See Bug 3885

See Bug 3194

See Bug 1715

Description

Fix problems involving the domains of statEnv.funcType and dynEnv.funcDefn:

History

3 May 2006: Proposed

20 Sep 2007: Accepted

20 Sep 2007: Issued

Changes

  1. In 3.1.1 Static Context / Notation, insert:

    In the static (and dynamic) context, each function is uniquely identified by its expanded QName and its arity (number of parameters). We introduce the auxilliary symbol FunctionKey to encapsulate this combination.

    [92 (Formal)]    FunctionKey    ::=    expanded-QName "," Arity

    (Arity is understood to be a non-negative integer.)

    Also, add the FunctionKey production to A.2 Formal BNF / Non-Terminals.

  2. In 3.1.1 Static Context / Notation / statEnv.funcType, replace:

    ... this environment component maps an expanded QName and an arity to a function signature FunctionSig.

    with:

    ... this environment component maps a FunctionKey (an expanded QName and arity) to a function signature FunctionSig.

  3. In 3.1.2 Dynamic Context / dynEnv.funcDefn, replace:

    The dynEnv.funcDefn environment component maps an expanded function name and parameter signature of the form "expanded-QName (Type1, ..., Typen)" to ...

    with:

    The dynEnv.funcDefn environment component maps a FunctionKey (expanded function name and arity) to ...
  4. In 4.1.5 Function Calls / Dynamic Evaluation / rule 1 / premise 2, replace:

    statEnv.funcType(expanded-QName) = FunctionSig

    with:

    statEnv.funcType(expanded-QName,0) = FunctionSig
  5. In 4.1.5 Function Calls / Dynamic Evaluation / rule 2 / premise 5, replace:

    statEnv.funcType(expanded-QName) = FunctionSig

    with:

    statEnv.funcType(expanded-QName,n) = FunctionSig
  6. In 4.1.5 Function Calls / Dynamic Evaluation / rule 3 / premise 1, replace:

    dynEnv.funcDefn(expanded-QName() = (Expr)

    with:

    dynEnv.funcDefn(expanded-QName,0) = (Expr)
  7. In 4.1.5 Function Calls / Dynamic Evaluation / rule 4 / premise 1, replace:

    dynEnv.funcDefn(expanded-QName(Type1, ..., Typen)) = (Expr, Variable1, ... , Variablen)

    with:

    dynEnv.funcDefn(expanded-QName,n) = (Expr, Variable1, ... , Variablen)
  8. In 4.1.5 Function Calls / Dynamic Evaluation / rule 5 / premises 1+4+6, replace:

    dynEnv.funcDefn(expanded-QName()) = #IMPORTED(AnyURI)
    ...
    statEnv.funcType1(expanded-QName) = FunctionSig'
    ...
    dynEnv1.funcDefn(expanded-QName() = (Expr)

    with:

    dynEnv.funcDefn(expanded-QName,0) = #IMPORTED(AnyURI)
    ...
    statEnv1.funcType(expanded-QName,0) = FunctionSig'
    ...
    dynEnv1.funcDefn(expanded-QName,0) = (Expr)

    (Note that this also fixes premise 4's "statEnv.funcType1" typo in passing.)

  9. In 4.1.5 Function Calls / Dynamic Evaluation / rule 6 / premises 1+4+9, replace:

    dynEnv.funcDefn(expanded-QName(Type1, ..., Typen)) = #IMPORTED(AnyURI)
    ...
    statEnv.funcType1(expanded-QName) = FunctionSig'
    ...
    dynEnv1.funcDefn(expanded-QName(Type1', ..., Typen')) = (Expr, Variable1, ... , Variablen)

    with:

    dynEnv.funcDefn(expanded-QName,n) = #IMPORTED(AnyURI)
    ...
    statEnv1.funcType(expanded-QName,n) = FunctionSig'
    ...
    dynEnv1.funcDefn(expanded-QName,n) = (Expr, Variable1, ... , Variablen)

    (Note that this also fixes premise 4's "statEnv.funcType1" typo in passing.)

  10. In 4.1.5 Function Calls / Dynamic Evaluation / rule 7 / premise 1, replace:

    dynEnv.funcDefn(expanded-QName()) = #BUILT-IN

    with:

    dynEnv.funcDefn(expanded-QName,0) = #BUILT-IN
  11. In 4.1.5 Function Calls / Dynamic Evaluation / rule 8 / premise 1, replace:

    dynEnv.funcDefn(expanded-QName(Type1, ..., Typen)) = #BUILT-IN

    with:

    dynEnv.funcDefn(expanded-QName,n) = #BUILT-IN
  12. In 4.1.5 Function Calls / Dynamic Evaluation / rule 9 / premise 1, replace:

    dynEnv.funcDefn(expanded-QName()) = #EXTERNAL

    with:

    dynEnv.funcDefn(expanded-QName,0) = #EXTERNAL
  13. In 4.1.5 Function Calls / Dynamic Evaluation / rule 10 / premise 1, replace:

    dynEnv.funcDefn(expanded-QName(Type1, ..., Typen)) = #EXTERNAL

    with:

    dynEnv.funcDefn(expanded-QName,n) = #EXTERNAL
  14. In 5 Modules and Prologs / Notation 3 / rule 4 / premise 8, replace:

    statEnv1 = statEnv + funcType(expanded-QName => FunctionSig)

    with:

    statEnv1 = statEnv + funcType(expanded-QName,n => FunctionSig)
  15. In 5.11 Module Import / Notation 1 / para 3, replace:

    The function fs:local-functions( statEnv, AnyURI) returns all the function signatures in statEnv.funcType such that ...

    with:

    The function fs:local-functions( statEnv, AnyURI) returns all the (FunctionKey, FunctionSig) pairs in statEnv.funcType such that ...

  16. In 5.11 Module Import / Notation 2 / rule 1 / premises 3+4, replace:

    fs:local-functions(statEnv2, AnyURI) = (expanded-QName1,FunctionSig1) ... (expanded-QNamen,FunctionSign)
    statEnv4 = statEnv3 + funcType(expanded-QName1 => FunctionSig1; ... ;expanded-QNamen => FunctionSign)

    with:

    fs:local-functions(statEnv2, AnyURI) = (FunctionKey1,FunctionSig1) ... (FunctionKeyn,FunctionSign)
    statEnv4 = statEnv3 + funcType( FunctionKey1 => FunctionSig1; ... ; FunctionKeyn => FunctionSign )
  17. In 5.11 Module Import / Notation 3 / rule 4, replace:

    dynEnv2 = dynEnv1 + funcDefn((expanded-QName1(Type1,1, ..., Type1,n)) => #IMPORTED(AnyURI))
    dynEnv2 ; AnyURI |-  (expanded-QName2(Type2,1, ..., Type2,n)), ···, (expanded-QNamek(Typek,1, ..., Typek,n)) =>import_functions dynEnv3

    dynEnv1 ; AnyURI |-  (expanded-QName1(Type1,1, ..., Type1,n)), ···, (expanded-QNamek(Typek,1, ..., Typek,n)) =>import_functions dynEnv3

    with:

    dynEnv2 = dynEnv1 + funcDefn(FunctionKey1 => #IMPORTED(AnyURI))
    dynEnv2 ; AnyURI |-  (FunctionKey2,FunctionSig2) ... (FunctionKeyn,FunctionSign) =>import_functions dynEnv3

    dynEnv1 ; AnyURI |-  (FunctionKey1,FunctionSig1) ... (FunctionKeyn,FunctionSign) =>import_functions dynEnv3

  18. In 5.15 Function Declaration / Dynamic Context Processing / rule 1 / premise 2, replace:

    dynEnv1 = dynEnv + funcDefn(expanded-QName() => (Expr))

    with:

    dynEnv1 = dynEnv + funcDefn(expanded-QName,0 => (Expr))
  19. In 5.15 Function Declaration / Dynamic Context Processing / rule 2 / premise 6+7+8, replace:

    [SequenceType1]sequencetype = Type1
    ...
    [SequenceTypen]sequencetype = Typen
    dynEnv1 = dynEnv + funcDefn(expanded-QName(Type1,...,Typen) => ( Expr , Variable1 , ···, Variablen))

    with:

    dynEnv1 = dynEnv + funcDefn(expanded-QName,n => ( Expr , Variable1 , ···, Variablen))
  20. In B Index of judgments / Auxiliary judgments, replace:

    dynEnv1 ; AnyURI |-  (expanded-QName1(Type1,1, ..., Type1,n)), ···, (expanded-QNamek(Typek,1, ..., Typek,n)) =>import_functions dynEnv2

    with:

    dynEnv1 ; AnyURI |-  (FunctionKey1,FunctionSig1) ... (FunctionKeyn,FunctionSign) =>import_functions dynEnv2

FS.E005 - editorial

Superseded by Erratum FS.E011

See Bug 1660

Description

Put 'Expr' in parentheses when it occurs as a function argument.

History

16 Jul 2005: Proposed

16 Apr 2006: Accepted

18 Sep 2007: Issued

Changes

  1. In 4.7.3.2 Dynamic Evaluation / Dynamic Evaluation / rule 1 / premise 1, replace:

    dynEnv |-  fs:item-sequence-to-untypedAtomic( Expr) => AtomicValue

    with:

    dynEnv |-  fs:item-sequence-to-untypedAtomic(( Expr)) => AtomicValue
  2. In 4.7.3.2 Dynamic Evaluation / Dynamic Evaluation / rule 2 / premise 4, replace:

    dynEnv |-  fs:item-sequence-to-untypedAtomic( Expr2) => AtomicValue2

    with:

    dynEnv |-  fs:item-sequence-to-untypedAtomic(( Expr2)) => AtomicValue2

FS.E004 - editorial

See Bug 1746

Description

Fix typo in function signature.

History

19 Jul 2005: Proposed

21 Feb 2006: Accepted

18 Sep 2007: Issued

Change

In 7.1.2 The fs:convert-simple-operand function, in the function signature, replace:

fs:convert-simple-operand( ... ) as xs:anyAtomicTypeAtomic *

with:

fs:convert-simple-operand( ... ) as xs:anyAtomicType *

FS.E003 - editorial

See Bug 1647

Description

Complete the changes entailed by adding a local-namespaces component to the Core CompElemConstructor.

History

16 Jul 2005: Proposed

22 Jul 2005: Accepted

18 Sep 2007: Issued

Changes

  1. In 4.7.3.1 Computed Element Constructors / Normalization / rules 2+3, add an empty brace-pair to each Core CompElemConstructor. Specifically, replace:

    element QName { fs:item-sequence-to-node-sequence(( [Expr]Expr)) }

    with:

    element QName { fs:item-sequence-to-node-sequence(( [Expr]Expr)) } {}

    and replace:

    element { fn:data(([Expr1]Expr)) }{ fs:item-sequence-to-node-sequence(( [Expr2]Expr)) }

    with:

    element { fn:data(([Expr1]Expr)) }{ fs:item-sequence-to-node-sequence(( [Expr2]Expr)) } {}
  2. In 4.7.3.1 Computed Element Constructors / Dynamic Evaluation / para 2, replace:

    First, the element's content expression is partitioned into the local namespace declarations and all other expressions, and the local namespace declarations are evaluated, yielding a sequence of namespace bindings.

    with:

    First, the constructor's local namespace declarations are evaluated, yielding a sequence of namespace bindings.

  3. In 4.7.3.1 Computed Element Constructors / Dynamic Evaluation / rule 1, add an empty brace-pair to the Core CompElemConstructor in the conclusion; that is, replace:

    statEnv; dynEnv |-  element QName { Expr } => element QName of type xs:anyType { Value0 } { }

    with:

    statEnv; dynEnv |-  element QName { Expr } {} => element QName of type xs:anyType { Value0 } { }
  4. In 4.7.3.1 Computed Element Constructors / Dynamic Evaluation / rule 2, replace:

    Expr = NamespaceBinding 1, ..., NamespaceBinding n, Expr0
    NamespaceBinding 1 = namespace NCName1 { AnyURI1 }
    ...
    NamespaceBinding n = namespace NCNamen { AnyURIn }
    statEnv1 = statEnv + namespace(NCName1 => (active, AnyURI1))
    ...
    statEnvn = statEnvn-1 + namespace(NCNamen => (active, AnyURIn))
    statEnvn; dynEnv |-  Expr0 => Value0
    statEnv  |-  Value0 matches (attribute*, (element | text | processing-instruction | comment)*)
    NamespaceBindings = NamespaceBinding 1, ..., NamespaceBinding n, fs:active_ns(statEnv), fs:get_static_ns_from_items(statEnv, Value0)

    statEnv; dynEnv |-  element QName { Expr } => element QName of type xs:anyType { Value0 } { NamespaceBindings }

    with:

    Expr = Expr0
    LocalNamespaceDecls = LocalNamespaceDecl 1 ... LocalNamespaceDecl n
    LocalNamespaceDecl 1 = namespace NCName1 { URILiteral1 }
    ...
    LocalNamespaceDecl n = namespace NCNamen { URILiteraln }
    dynEnvDefault |-  URILiteral1 has atomic value AnyURI1
    ...
    dynEnvDefault |-  URILiteraln has atomic value AnyURIn
    NamespaceBinding 1 = namespace NCName1 { AnyURI1 }
    ...
    NamespaceBinding n = namespace NCNamen { AnyURIn }
    statEnv1 = statEnv + namespace(NCName1 => (active, AnyURI1))
    ...
    statEnvn = statEnvn-1 + namespace(NCNamen => (active, AnyURIn))
    statEnvn; dynEnv |-  Expr0 => Value0
    statEnv  |-  Value0 matches (attribute*, (element | text | processing-instruction | comment)*)
    NamespaceBindings = NamespaceBinding 1, ..., NamespaceBinding n, fs:active_ns(statEnv), fs:get_static_ns_from_items(statEnv, Value0)

    statEnv; dynEnv |-  element QName { Expr } { LocalNamespaceDecls } => element QName of type xs:anyType { Value0 } { NamespaceBindings }

  5. In 4.7.3.1 Computed Element Constructors / Dynamic Evaluation / rule 3, replace:

    dynEnv |- Expr1 => Value0
    statEnv |-  Value0 matches xs:QName
    QName = fn:prefix-from-QName(Value0):fn:local-name-from-QName( Value0)
    dynEnv |-  element QName { Expr2 } => Value

    dynEnv |-  element { Expr1 } { Expr2 } => Value

    with:

    dynEnv |- Expr1 => Value0
    statEnv |-  Value0 matches xs:QName
    QName = fn:prefix-from-QName(Value0):fn:local-name-from-QName( Value0)
    dynEnv |-  element QName { Expr2 } { LocalNamespaceDecls } => Value

    dynEnv |-  element { Expr1 } { Expr2 } { LocalNamespaceDecls } => Value

FS.E002 - editorial

See Bug 3864

Description

Both Core and Formal grammars had symbols 'NamespaceBinding' and 'NamespaceBindings'. To avoid confusion, we rename the Core symbols 'NamespaceBinding[s]' as 'LocalNamespaceDecl[s]', changing all occurrences of the former to the latter. At the same time, we introduce a production for LocalNamespaceDecls (currently assumed).

History

26 Oct 2006: Proposed

15 Sep 2007: Accepted

17 Sep 2007: Issued

Changes

  1. In 4.7.3.1 Computed Element Constructors / Core Grammar and A.1 Core BNF / Non-Terminals, replace:

    [67 (Core)]    CompElemConstructor    ::=    "element" (QName | ("{" Expr "}")) "{" ContentExpr "}" "{" NamespaceBinding* "}"
    [68 (Core)]    NamespaceBinding    ::=    "namespace" NCName "{" URILiteral "}"

    with:

    [67 (Core)]    CompElemConstructor    ::=    "element" (QName | ("{" Expr "}")) "{" ContentExpr "}" "{" LocalNamespaceDecls "}"
    [98 (Core)]    LocalNamespaceDecls    ::=    LocalNamespaceDecl*
    [68 (Core)]    LocalNamespaceDecl    ::=    "namespace" NCName "{" URILiteral "}"
  2. In 4.7.1.2 Namespace Declaration Attributes / Normalization, 4.7.3.1 Computed Element Constructors / Notation, and 4.7.3.1 Computed Element Constructors / Static Type Analysis), change each occurrence of NamespaceBinding and NamespaceBindings to LocalNamespaceDecl and LocalNamespaceDecls respectively.

FS.E001 - editorial

See Bug 1641

See Bug 3896

Description

Make normalization of DirAttributeValue more explicit.

History

15 Jul 2005: Proposed

22 Jul 2005: Accepted

10 Sep 2007: Issued

Changes

  1. In 4.7.1.1 Attributes / Notation / para 1, where we list the mapping rules, add [] DirAttributeValue and [] AttributeCharsUnit.

  2. In 4.7.1.1 Attributes / Notation, replace:

    [87 (Formal)]    AttributeContentUnits    ::=    AttributeContentUnit*
    [88 (Formal)]    AttributeContentUnit    ::=    EscapeQuot | QuotAttrValueContent

    with:

    [87 (Formal)]    AttributeContentUnits    ::=    AttributeContentUnit*
    [88 (Formal)]    AttributeContentUnit    ::=    AttributeCharsUnit | EnclosedExpr
    [91 (Formal)]    AttributeCharsUnit    ::=    (QuotAttrContentChar | AposAttrContentChar | EscapeQuot | EscapeApos | PredefinedEntityRef | CharRef | "{{" | "}}")+

    An AttributeCharsUnit is required to be maximal, i.e., it must extend as far as possible in both directions. In other words, an AttributeContentUnits must not contain two adjacent AttributeCharsUnits.

    Also, make the same changes to productions in A.2 Formal BNF.

  3. In 4.7.1.1 Attributes / Normalization, replace:

     
    [Prefix:LocalPart S? = S? " AttributeContentUnits "]Attribute
    not(Prefix = xmlns)
    ==
    attribute Prefix:LocalPart { [AttributeContentUnits]AttributeContent}

    with:

     
    [Prefix:LocalPart S? = S? DirAttributeValue ]Attribute
    not(Prefix = xmlns)
    ==
    attribute Prefix:LocalPart { [ [DirAttributeValue ]DirAttributeValue ]AttributeContent }

    The effect of [DirAttributeValue ]DirAttributeValue is not specified formally; informally, it partitions the content of DirAttributeValue into a sequence of AttributeContentUnits, each of which is either an enclosed expression (EnclosedExpr) or a maximal run of character content (AttributeCharsUnit). These content units are then normalized via []AttributeContent, which is defined below.

  4. In 4.7.1.1 Attributes / Normalization, replace:

    Literal characters, escaped curly braces, character references, and predefined entity references in attribute content are treated as in element content. In addition, the normalization rule for characters in attributes assumes:

    1. that an escaped single or double quote is converted to an individual single or double quote.

    The following normalization rules take the longest consecutive sequence of individual characters that include literal characters, escaped curly braces, escaped quotes, character references, predefined entity references, and escaped single and double quotes and normalizes the character sequence as a string.

     
    [( Char | CharRef | EscapeQuot | EscapeApos | PredefinedEntityRef ) +]AttributeContentUnit
    ==
    fn:codepoints-to-string(( Char | CharRef | EscapeQuot | EscapeApos | PredefinedEntityRef )+)

    with:

    The next two rules specify the normalization of each attribute-content unit via []AttributeContentUnit.

    We normalize an AttributeCharsUnit (i.e., a maximal run of attribute-content characters, including literal characters, character references, predefined entity references, escaped curly braces, and escaped single and double quotes) by converting it into a string literal.

     
    [ AttributeCharsUnit ]AttributeContentUnit
    ==
    [ AttributeCharsUnit ]AttributeCharsUnit

    The effect of [AttributeCharsUnit]AttributeCharsUnit is not specified formally; informally, it unescapes any escaped braces or quotes, performs attribute value normalization as specified in Section 3.7.1.1 AttributesXQ, and then represents the resulting string value as a string literal.


Index by Bugzilla entry

Bug #1641: FS.E001

Bug #1647: FS.E003

Bug #1660: FS.E005

Bug #1680: FS.E008

Bug #1694: FS.E007

Bug #1715: FS.E006

Bug #1746: FS.E004

Bug #1754: FS.E013

Bug #1756: FS.E014

Bug #1757: FS.E026

Bug #1776: FS.E034

Bug #1783: FS.E015

Bug #3142: FS.E009

Bug #3184: FS.E006

Bug #3193: FS.E035

Bug #3194: FS.E006

Bug #3268: FS.E036

Bug #3269: FS.E018 FS.E023

Bug #3655: FS.E029

Bug #3670: FS.E010

Bug #3758: FS.E011

Bug #3760: FS.E011

Bug #3771: FS.E012 FS.E029 FS.E031

Bug #3818: FS.E021

Bug #3847: FS.E016

Bug #3861: FS.E037

Bug #3864: FS.E002 FS.E038

Bug #3865: FS.E039

Bug #3866: FS.E040

Bug #3868: FS.E041

Bug #3871: FS.E042 FS.E043

Bug #3873: FS.E044

Bug #3875: FS.E006

Bug #3876: FS.E045

Bug #3879: FS.E046

Bug #3882: FS.E047

Bug #3883: FS.E048

Bug #3885: FS.E006 FS.E049

Bug #3886: FS.E050

Bug #3895: FS.E052

Bug #3896: FS.E001

Bug #3946: FS.E022

Bug #4189: FS.E059

Bug #4242: FS.E018

Bug #4261: FS.E018

Bug #4273: FS.E061

Bug #4371: FS.E017

Bug #4447: FS.E053

Bug #4512: FS.E018

Bug #4578: FS.E019

Bug #4581: FS.E018

Bug #4593: FS.E054

Bug #4601: FS.E055

Bug #4766: FS.E020

Bug #4841: FS.E024

Bug #4869: FS.E029

Bug #5129: FS.E018

Bug #5254: FS.E058

Bug #5452: FS.E062

Bug #5459: FS.E033

Bug #5460: FS.E033

Bug #5601: FS.E025

Bug #5651: FS.E027

Bug #5670: FS.E028

Bug #5747: FS.E032

Bug #5986: FS.E030

Bug #6005: FS.E051

Bug #6007: FS.E056

Bug #6160: FS.E057

Bug #6538: FS.E060

Index by section

2.1.4 Notations for inference rules: FS.E037

2.3.1 Formal values / Notation: FS.E038

2.3.2 Examples of values: FS.E039

2.4.1 XML Schema and the [XPath/XQuery] Type System: FS.E040

2.4.2 Item types: FS.E022

2.4.3 Content models / Notation: FS.E041

2.4.4 Top level definitions: FS.E020 FS.E036 FS.E042 FS.E043

2.4.5 Example of a complete Schema: FS.E042

2.5 Functions and operators: FS.E044

3.1.1 Static Context / Notation: FS.E006 FS.E009

3.1.1 Static Context / Notation / statEnv.funcType: FS.E006

3.1.2 Dynamic Context / dynEnv.funcDefn: FS.E006

3.2.1 Processing model: FS.E017

3.2.2 Normalization mapping rules / Notation: FS.E045 FS.E051

3.5.1 Predefined Schema Types: FS.E022 FS.E042

3.5.4 SequenceType Matching / Normalization: FS.E022

4 Expressions / Static Type Analysis: FS.E046

4.1.5 Function Calls / Dynamic Evaluation: FS.E006 FS.E049

4.1.5 Function Calls / Normalization: FS.E008 FS.E047 FS.E051

4.1.5 Function Calls / Notation 1: FS.E051

4.1.5 Function Calls / Static Type Analysis: FS.E048

4.2 Path Expressions / Normalization: FS.E021

4.2.1 Steps / Dynamic Evaluation: FS.E050

4.2.1 Steps / Normalization: FS.E024

4.2.1.1 Axes / Normalization: FS.E060

4.3.2 Filter Expressions / Normalization: FS.E019 FS.E024

4.5.2 General Comparisons / Normalization: FS.E055

4.7.1 Direct Element Constructors / Introduction: FS.E052

4.7.1 Direct Element Constructors / Normalization: FS.E011 FS.E029 FS.E052

4.7.1 Direct Element Constructors / Notation 1: FS.E052

4.7.1 Direct Element Constructors / Notation 2: FS.E052

4.7.1.1 Attributes: FS.E001

4.7.1.1 Attributes / Normalization: FS.E011 FS.E031

4.7.1.2 Namespace Declaration Attributes / Normalization: FS.E002

4.7.1.4 Boundary Whitespace: FS.E052

4.7.3.1 Computed Element Constructors / Core Grammar: FS.E002

4.7.3.1 Computed Element Constructors / Dynamic Evaluation: FS.E003 FS.E022 FS.E023 FS.E029

4.7.3.1 Computed Element Constructors / Normalization: FS.E003

4.7.3.1 Computed Element Constructors / Notation: FS.E002

4.7.3.1 Computed Element Constructors / Notation 2: FS.E029

4.7.3.1 Computed Element Constructors / Static Type Analysis: FS.E002 FS.E012 FS.E022 FS.E023

4.7.3.2 Computed Attribute Constructors / Dynamic Evaluation: FS.E005 FS.E011

4.7.3.2 Computed Attribute Constructors / Normalization: FS.E031

4.7.3.2 Computed Attribute Constructors / Static Type Analysis: FS.E023 FS.E031

4.7.3.3 Document Node Constructors / Dynamic Evaluation: FS.E022 FS.E023 FS.E029

4.7.3.3 Document Node Constructors / Normalization: FS.E029

4.7.3.3 Document Node Constructors / Static Type Analysis: FS.E029

4.7.3.4 Text Node Constructors / Normalization: FS.E030

4.7.3.5 Computed Processing Instruction Constructors / Static Type Analysis: FS.E022

4.8.1 FLWOR expressions / Normalization: FS.E028

4.12.4 Castable / Dynamic Evaluation: FS.E032

4.12.4 Castable / Normalization: FS.E032

4.12.4 Castable / Notation: FS.E032

4.12.5 Constructor Functions / Normalization: FS.E008

4.12.5 Constructor Functions / Notation: FS.E008

4.13 Validate Expressions / Static Type Analysis: FS.E023 FS.E058

5 Modules and Prologs / Dynamic Evaluation: FS.E007

5 Modules and Prologs / Notation 3: FS.E006

5 Modules and Prologs / Static Context Processing: FS.E007

5 Modules and Prologs / Static Type Analysis: FS.E007

5.10 Schema Import / Static Context Processing: FS.E042

5.11 Module Import / Notation 1: FS.E006

5.11 Module Import / Notation 2: FS.E006

5.11 Module Import / Notation 3: FS.E006

5.14 Variable Declaration / Static Context Processing: FS.E035

5.15 Function Declaration / Dynamic Context Processing: FS.E006

5.15 Function Declaration / Normalization: FS.E051

7.1 Formal Semantics Functions: FS.E021

7.1.1 The fs:convert-operand function / Static Type Analysis: FS.E057

7.1.2 The fs:convert-simple-operand function: FS.E004

7.1.5 The fs:item-sequence-to-node-sequence function: FS.E029

7.1.5 The fs:item-sequence-to-node-sequence function / Static Type Analysis: FS.E012 FS.E022 FS.E023 FS.E029

7.1.6 The fs:item-sequence-to-node-sequence-doc function: FS.E029

7.1.6 The fs:item-sequence-to-node-sequence-doc function / Static Type Analysis: FS.E022 FS.E023

7.1.7 The fs:item-sequence-to-untypedAtomic function: FS.E031

7.1.7 The fs:item-sequence-to-untypedAtomic function / Dynamic Evaluation: FS.E031

7.1.7 The fs:item-sequence-to-untypedAtomic function / Introduction: FS.E031

7.1.14 The fs:item-at function: FS.E024

7.2.1 The fn:last context function / Dynamic Evaluation: FS.E013

7.2.2 The fn:position context function / Dynamic Evaluation: FS.E013

7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions: FS.E033

7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions / Static Type Analysis: FS.E014

7.2.4 The fn:boolean function: FS.E027

7.2.4 The fn:boolean function / Static Type Analysis: FS.E026 FS.E027

7.2.5 The fn:collection and fn:doc functions / Static Type Analysis: FS.E022 FS.E023

7.2.6 The fn:data function / Static Type Analysis: FS.E022 FS.E023 FS.E061

7.2.10 The fn:min, fn:max, fn:avg, and fn:sum functions: FS.E033

7.2.13 The fn:subsequence function: FS.E024

8.1.3 Element and attribute name lookup (Dynamic) / Semantics 1: FS.E023

8.1.3 Element and attribute name lookup (Dynamic) / Semantics 2: FS.E023

8.1.4 Element and attribute type lookup (Static) / Semantics 1: FS.E023

8.1.4 Element and attribute type lookup (Static) / Semantics 2: FS.E023

8.1.7 Type adjustment / Semantics: FS.E022

8.1.8 Builtin attributes: FS.E042

8.1.9 Type expansion: FS.E059

8.1.9 Type expansion / Semantics: FS.E059

8.1.10 Union interpretation of derived types / Notation: FS.E059

8.1.10 Union interpretation of derived types / Semantics: FS.E059

8.2.2.1.3 Inference rules for the child axis / Semantics: FS.E022 FS.E023

8.2.2.1.4 Inference rules for the attribute axis / Semantics: FS.E022 FS.E023

8.2.2.1.5 Inference rules for the parent axis / Semantics: FS.E022 FS.E023

8.2.2.1.6 Inference rules for the namespace axis / Semantics: FS.E062

8.2.2.1.9 Inference rules for the ancestor axis / Semantics: FS.E023

8.2.2.2 Dynamic semantics of axes / Semantics: FS.E034

8.2.3.1.1 [Static Semantics of] Name Tests: FS.E018

8.2.3.1.2 Kind Tests / Attribute kind test: FS.E023

8.2.3.1.2 Kind Tests / Element kind test: FS.E023

8.2.3.1.2 Kind Tests / Processing instruction, comment, and text kind tests: FS.E022

8.3.1 Matches / Semantics: FS.E022

8.4 Judgments for FLWOR and other expressions on sequences: FS.E015

8.4 Judgments for FLWOR and other expressions on sequences / Introduction: FS.E053

8.4 Judgments for FLWOR and other expressions on sequences / Semantics 1: FS.E057

8.4 Judgments for FLWOR and other expressions on sequences / Semantics 2: FS.E054

8.5.1 Type Promotion / Semantics: FS.E010

8.6.1 Elements in validation mode / Semantics: FS.E023

A.1 Core BNF / Non-Terminals: FS.E002

A.2 Formal BNF: FS.E001 FS.E022 FS.E036 FS.E041 FS.E042

A.2 Formal BNF / Non-Terminals: FS.E006 FS.E009

B Index of judgments: FS.E029 FS.E032 FS.E033

B Index of judgments / Auxiliary judgments: FS.E006 FS.E008

C.1 Functions and Operators used in the Formal Semantics: FS.E024 FS.E031

C.2 Mapping of Overloaded Internal Functions / Notation 2: FS.E056

C.2 Mapping of Overloaded Internal Functions / Notation 2 / Binary Operators table: FS.E010 FS.E016 FS.E025 FS.E053

D.1.3 Main mapping rules / Notation: FS.E051

D.2.1 Schema / Notation: FS.E051

D.2.1 Schema / Schema mapping: FS.E051

D.3.1 Global attributes declarations / Schema mapping: FS.E051

D.3.2 Local attribute declarations / Schema mapping: FS.E051

D.4.1 Global element declarations / Schema mapping: FS.E051

D.4.2 Local element declarations / Schema mapping: FS.E051

D.5.1 Global complex type / Schema mapping: FS.E051

D.5.2 Local complex type / Schema mapping: FS.E051

D.5.3 Complex type with simple content / Notation: FS.E051

D.5.3 Complex type with simple content / Schema mapping: FS.E051

D.5.4 Complex type with complex content / Schema mapping: FS.E051

D.9.1 All groups / Schema mapping: FS.E051

D.9.2 Choice groups / Schema mapping: FS.E051

D.9.3 Sequence groups / Schema mapping: FS.E051

D.10.1 Element reference / Schema mapping: FS.E051

D.11.1 Attribute wildcards / Schema mapping: FS.E051

D.11.2 Element wildcards / Schema mapping: FS.E051

D.15.1 Global simple type definition / Schema mapping: FS.E051

D.15.2 Local simple type definition / Schema mapping: FS.E051

D.15.3 Simple type content / Notation: FS.E051

D.15.3 Simple type content / Schema mapping: FS.E051

F.1.1 Type resolution / Semantics: FS.E036

Index by production

(Core) CompElemConstructor: FS.E002

(Core) LocalNamespaceDecl: FS.E002

(Core) LocalNamespaceDecls: FS.E002

(Core) NamespaceBinding: FS.E002

(Core) NamespaceBindings: FS.E002

(Formal) AttributeCharsUnit: FS.E001

(Formal) AttributeContentUnit: FS.E001

(Formal) ElementContentType: FS.E022

(Formal) FunctionKey: FS.E006

(Formal) FunctionSig: FS.E009

(Formal) TypeList: FS.E009