Brandon Sloane created DAFFODIL-2138:
----------------------------------------
Summary: Incorrect Schema Context for root path expressions
Key: DAFFODIL-2138
URL: https://issues.apache.org/jira/browse/DAFFODIL-2138
Project: Daffodil
Issue Type: Bug
Components: Diagnostics, Front End
Reporter: Brandon Sloane
Attachments: a.dfdl.xsd
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):
{quote}<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>
{quote}
Note that the IVC on element b3 makes reference to "/c", which does not exist.
The error reported by Daffodil is:
{quote}[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
{quote}
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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)