From aa7ba356a2e3343726753349c6e7bff051ca2da3 Mon Sep 17 00:00:00 2001 From: olabusayoT <50379531+olabusayoT@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:46:59 -0500 Subject: [PATCH] fixup! Fix Ignored RootNS - add doc comment - update test names DAFFODIL-2947 --- .../main/scala/org/apache/daffodil/core/dsom/SchemaSet.scala | 5 +++++ .../org/apache/daffodil/processor/tdml/TestTDMLRunner2.scala | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SchemaSet.scala b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SchemaSet.scala index e97612b9d4..bd9d9ae50e 100644 --- a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SchemaSet.scala +++ b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SchemaSet.scala @@ -362,6 +362,11 @@ final class SchemaSet private ( if (possibleRoots.length == 1) { possibleRoots.head } else { + // we're here because it's ambiguous what root element to return, and + // no namespace URI was provided. So we assume not specifying a namespace + // URI may mean the intention was to choose the root that it is in No Namespace. + // If there is no such, then the diagnostic will encourage user to specify + // the namespace explicitly. val qn = RefQName(None, rootElementName, NoNamespace) findRootElement(qn) } diff --git a/daffodil-tdml-processor/src/test/scala/org/apache/daffodil/processor/tdml/TestTDMLRunner2.scala b/daffodil-tdml-processor/src/test/scala/org/apache/daffodil/processor/tdml/TestTDMLRunner2.scala index 8da1e1b927..bbaceeb9f6 100644 --- a/daffodil-tdml-processor/src/test/scala/org/apache/daffodil/processor/tdml/TestTDMLRunner2.scala +++ b/daffodil-tdml-processor/src/test/scala/org/apache/daffodil/processor/tdml/TestTDMLRunner2.scala @@ -609,7 +609,7 @@ abc # a comment @Test def test_apos_test2(): Unit = { runner.runOneTest("apos_test2") } // DFDL-2947 - @Test def test_multipleRootCandidates1(): Unit = { + @Test def test_rootNSSpecifiesNoNamespaceRoot(): Unit = { val tdmlTestSuite =