[
https://issues.apache.org/jira/browse/DAFFODIL-2909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18023841#comment-18023841
]
Steve Lawrence commented on DAFFODIL-2909:
------------------------------------------
{quote}One potential fix is to change the TDML runner so it uses the output of
the ScalaInfosetOutputter to
{quote}
I checked the TDML runner, and by default it now uses the
ScalaXMLInfosetOutputter which does not support stringAsXML. So the TDML runner
essentially ignores the stringAsXml feature. This means TDML tests should work
even if a schema uses stringAsXml, as long as the expected infoset contains a
string and not XML (e.g. XML tags must be escaped).
Note that even if we set the DAFFODIL_TDML_API_INFOSETS environment variable
(which causes the TDML runner to use all available infoset
inputters/outputters) it still doesn't really change anything since we still
always use the results of the ScalaXMLInfosetOutputter to compare against the
expected result.
If we did want to support checking scalaAsXml using the expected infoset of a
TDML test, we would need to add stringAsXML support to the
ScalaXMLInfosetInputter/Outputter. I imagine that's fairly straightforward
since the scala-xml library already has the ability to convert nodes to and
from text. The difficult part would be adding support to the TDML runner to
compare arbitrary XML–right now I believe our XML diff function makes
assumptions about the infosets, such as not containing mixed content,
attributes, etc.
> stringAsXML: TDML XML Comparison fails on mixed content XML or other
> non-DFDL-conforming XML
> --------------------------------------------------------------------------------------------
>
> Key: DAFFODIL-2909
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2909
> Project: Daffodil
> Issue Type: Bug
> Components: Infrastructure, QA, TDML Runner
> Reporter: Mike Beckerle
> Priority: Major
>
> The stringAsXML feature allows embedding arbitrary XML content into the XML
> output from a Daffodil parse.
> When the TDML runner compares output to expected output, this fails because
> the output is not from a DFDL parse, but is an embedded string of XML.
> That embedded string can use many things that DFDL doesn't normally create
> such as XML mixed content, XML attributes, etc.
> The XML diff comparison fails on this.
> Hence, TDML tests cannot be created when stringAsXML is used, unless you are
> lucky and the embedded XML string just happens to not use XML attributes,
> mixed content, or anything else that isn't part of the DFDL subset of XSD.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)