[
https://issues.apache.org/jira/browse/DAFFODIL-2618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17479500#comment-17479500
]
Mike Beckerle commented on DAFFODIL-2618:
-----------------------------------------
This works if you also specify useDefaultNamespace='false' on the
tdml:defineSchema element.
Without that the TDML tool extracts the defineSchema and creates a temporary
schema file and puts the example namespace as the default.
So this is working as designed.
The file computedLengthFields.tdml uses xmlns="" on the defineSchema element as
an illustration.
> TDML test file cannot specify xmlns="" on the tdml:defineSchema element
> -----------------------------------------------------------------------
>
> Key: DAFFODIL-2618
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2618
> Project: Daffodil
> Issue Type: Bug
> Components: TDML Runner
> Affects Versions: 3.2.1
> Reporter: Mike Beckerle
> Priority: Major
>
> The preferred style for writing a DFDL schema uses the default namespace for
> the XML schema namespace, so as to avoid having to put a prefix like "xs:" on
> every element.
> The prefered style for writing a TDML test file similarly uses a default
> namespace for the TDML namespace so as to avoid having to put a prefix like
> "tdml:" on every element.
> Combining these two ideas, one would like to be able to embed a DFDL schema
> within the TDML file by way of this:
>
> {code:java}
> <tdml:defineSchema name="mySchema"
> xmlns="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="unqualified">
> .... schema here. Note that no "xs:" prefix is needed....
> <element name="foo" ..../>
> </tdml:defineSchema>
> {code}
>
> This doesn't work however. Something about the way the embedded schema is
> removed and placed into a separate schema temp file for compilation makes
> namespace assumptions and doesn't tolerate the xmlns default declaration.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)