Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2036

poor diagnostic - choice with sequences as branches with all optional content.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.3.0
    • Middle "End"
    • None

    Description

      Suppose you have this choice:

      <choice>
      <sequence>
      <element name="x" ... minOccurs="0"/>
      </sequence>
      <sequence>
      <element name="y" ... minOccurs="0"/>
      </sequence>
      </choice>
      <element name="foo" .../>

      You get an SDE with this message:

      Schema Definition Error: UPA violation. Multiple choice branches begin with

      {http://example.com}

      foo
      Note that elements with dfdl:outputValueCalc cannot be used to distinguish choice branches.
      The offending choice branches are:
      sequence[1] at Location in file:/tmp/s1_5963264522094411444.dfdl.xsd
      sequence[2] at Location in file:/tmp/s1_5963264522094411444.dfdl.xsd

      This occurs because the two branches of the choice meet the letter of the law by bing sequences which are considered "required", but as their content is all optional and they have no framing, they are conceptually optional.

      So there's really no way to look at the infoset and decide which arm of the choice.

      The error here should be that the content of a choice branch is entirely optional which isn't allowed.

      Attachments

        Activity

          People

            dfthompson Dave Thompson
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: