[
https://issues.apache.org/jira/browse/DAFFODIL-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dave Thompson closed DAFFODIL-2857.
-----------------------------------
Verified the specified commit (commit d4fc818c3b27bf26abfd74663377886a8035f83c)
is included in the latest pull from the daffodil repository.
Verified, via review, changes identified in the commit comment were
implemented.
Verified the affected daffodil subproject sbt test suites executed
successfully, including the added test.
Rolled commit back to pre-fix commit and verified that the specified error
occurred during the added test.
Verified the nightly test suite executes successfully with no unexpected
failures.
> Different prefixes for same namespace fails to compile with dfdlx:repType
> -------------------------------------------------------------------------
>
> Key: DAFFODIL-2857
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2857
> Project: Daffodil
> Issue Type: Bug
> Components: Front End
> Reporter: Steve Lawrence
> Priority: Major
> Fix For: 3.6.0
>
>
> Say we have these two schemas:
> *foo.dfdl.xsd*
> {code:xml}
> <schema
> xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
> xmlns:dfdlx="http://www.ogf.org/dfdl/dfdl-1.0/extensions"
> xmlns:foo="http://example.com/"
> targetNamespace="http://example.com/"
> elementFormDefault="unqualified">
> <include
> schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
> <include schemaLocation="bar.dfdl.xsd" />
> <annotation>
> <appinfo source="http://www.ogf.org/dfdl/">
> <dfdl:format ref="foo:GeneralFormat" representation="binary" />
> </appinfo>
> </annotation>
> <element name="foo" type="foo:NumEnums" />
> </schema>
> {code}
> *bar.dfdl.xsd*
> {code:xml}
> <schema
> xmlns="http://www.w3.org/2001/XMLSchema"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
> xmlns:dfdlx="http://www.ogf.org/dfdl/dfdl-1.0/extensions"
> xmlns:bar="http://example.com/"
> targetNamespace="http://example.com/"
> elementFormDefault="unqualified">
> <include
> schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
> <annotation>
> <appinfo source="http://www.ogf.org/dfdl/">
> <dfdl:format ref="bar:GeneralFormat" representation="binary" />
> </appinfo>
> </annotation>
> <simpleType name="enum" dfdl:lengthKind="explicit" dfdl:length="1">
> <restriction base="xs:int" />
> </simpleType>
> <simpleType name="NumEnums" dfdlx:repType="bar:enum">
> <restriction base="xs:string">
> <enumeration value="zero" dfdlx:repValues="0"/>
> <enumeration value="one" dfdlx:repValues="1"/>
> </restriction>
> </simpleType>
> </schema>
> {code}
> Note that foo.dfdl.xsd and bar.dfdl.xsd use the same targetNamespace, but
> have different namespace prefixes.
> Trying to compile this schema causes the error:
> > [error] Schema Definition Error: Undefined QName prefix 'bar'
> Likely what is happening is we create a quasi element in the scope
> foo.dfdl.xsd that has its type set to that of its dfdlx:repType property,
> which is "bar:enum". But in that scope, "bar:enum" doesn't make sense because
> the "bar" prefix isn't defined, the namespace prefix in this scope is "foo".
--
This message was sent by Atlassian Jira
(v8.20.10#820010)