Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1468

XML Schema 1.1 assertion evaluations on complexType with simpleContent require few improvements

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.0
    • 2.11.0
    • None

    Description

      I'm opening this bug report for Xerces JIRA records and tracking.

      Here's an example which illustrates the problems highlighted in this bug report. With this bug report, we are targeting improvements on current code-base on SVN.

      XML document:
      <List>2 4 6</List>

      XML Schema 1.1 document:
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

      <xs:element name="List">
      <xs:complexType>
      <xs:simpleContent>
      <xs:extension base="INTLIST">
      <xs:assert test="data($value) instance of xs:integer+" />
      <xs:assert test="count(data($value)) = 3" />
      </xs:extension>
      </xs:simpleContent>
      </xs:complexType>
      </xs:element>

      <xs:simpleType name="INTLIST">
      <xs:list itemType="xs:integer" />
      </xs:simpleType>

      </xs:schema>

      The schema above must successfully validate (i.e the schema assertions specified in the above example, must evaluate to true. The XPath 2.0 function "data" gives us the 'typed value – of XDM type xs:anyAtomicType*' of the argument.) the XML document specified above.

      Per the relevant sections of the spec here, http://www.w3.org/TR/xmlschema11-1/#sec-cvc-assertion, the point 2 at this link says:
      <quote>
      For complex types with simple content, the element node may be referred to as ".", while its content may be referred to as "$value". Since the element node, as a consequence of clause 1.2, will normally have the type annotation anyType, its atomized value will be a single atomic value of type untypedAtomic. By contrast, $value will be a sequence of one or more atomic values, whose types are the most specific (narrowest) built-in types available.
      </quote>

      Presently (for the current code-base on Xerces SVN), for complexType with simple contents, $value doesn't have a typed value of kind xs:anyAtomicType*. With the current code-base on Xerces SVN, $value as per examples cited in this bug report, is just a string "2 4 6". I believe, this is a bug as per the XML Schema 1.1 spec.

      I'll try to solve this bug ASAP.

      Attachments

        Activity

          People

            mukul_gandhi Mukul Gandhi
            mukul_gandhi Mukul Gandhi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: