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

Error when validating sum duration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11.0
    • 2.12.0
    • None

    Description

      Tried the following in latest XSD 1.1 branch:

      Schema:

      <schema
      elementFormDefault="qualified"
      attributeFormDefault="unqualified"
      xmlns="http://www.w3.org/2001/XMLSchema"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:tst="http://www.rackspace.com/test/duration"
      targetNamespace="http://www.rackspace.com/test/duration">
      <element name="test" type="tst:SumDuration24H"/>
      <complexType name="SumDuration24H">
      <sequence>
      <element name="d" type="xsd:dayTimeDuration" maxOccurs="unbounded"/>
      </sequence>
      <assert test="xsd:dayTimeDuration('PT24H') = sum(for $d in element(tst:d) return xsd:dayTimeDuration($d))"/>
      </complexType>
      </schema>

      good.xml
      <test xmlns="http://www.rackspace.com/test/duration">
      <d>PT22H</d>
      <d>PT1H</d>
      <d>PT1H</d>
      </test>

      bad.xml
      <test xmlns="http://www.rackspace.com/test/duration">
      <d>PT24H</d>
      <d>PT1H</d>
      <d>PT1H</d>
      </test>

      I expect good.xml to validate correctly and bad.xml to fail validation. However, both of these fail validation with the message:

      cvc-assertion: Assertion evaluation ('xsd:dayTimeDuration('PT24H') = sum(for $d in element(tst:d) return xsd:dayTimeDuration($d))') for element 'test' on schema type 'SumDuration24H' did not succeed.

      Attachments

        Activity

          People

            mukul_gandhi Mukul Gandhi
            jorgew Jorge L. Williams
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: