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

Incorrect Schema Context for root path expressions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Diagnostics, Front End
    • None

    Description

      When a DFDL expression uses attempts to resolve a path relative to the document root, subsequent errors are reported as occurring at the document root, with no indication of where the faulty expression is.

      Consider the following schema (attached):

      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
          xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
          xmlns:tns="urn:a"
          xmlns:ex="http://example.com"
          xmlns:fn="http://www.w3.org/2005/xpath-functions"
          targetNamespace="urn:a" >
      <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />

       <xs:annotation>
         <xs:appinfo source="http://www.ogf.org/dfdl/">
           <dfdl:format ref="tns:GeneralFormat"/>
         </xs:appinfo>
      </xs:annotation>

      <xs:element name="a1">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="b1" type="tns:b2"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>

      <xs:complexType name="b2">
        <xs:sequence>
          <xs:element name="b3" type="xs:int" dfdl:inputValueCalc="{ /c }" />
        </xs:sequence>
      </xs:complexType>

      </xs:schema>

      Note that the IVC on element b3 makes reference to "/c", which does not exist. The error reported by Daffodil is:

       

      [error] Schema Definition Error: No element corresponding to step {}c found. Possibilities for this step include: tns:a1.
      Schema context: element reference tns:a1 Location line 1 in file:/home/bsloane/Documents/incubator-daffodil/test/test/a.dfdl.xsd

      Which gives no indication that the problem is with b3. Further, where b3 to be in a different file than the schema root, the file displayed is still the file containing the schema root, not b3.

      Attachments

        1. a.dfdl.xsd
          0.8 kB
          Brandon Sloane
        2. a2.dfdl.xsd
          0.9 kB
          Brandon Sloane

        Activity

          People

            Unassigned Unassigned
            brandon.sloane Brandon Sloane
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: