Build: #172 was successful Changes by Steve Lawrence
Code commits
daffodil
-
Steve Lawrence c845e4cf62a5161fbae7a2d7ec34bd36b506537f
Write infosets with namespaces that the unparser expects
Before this change, some tests with complex namespaces would result in
an infoset that did not match what the unparse expected. These changes
fix that issue:
- Modify how minimized scope is calculated. The existing code was mostly
correct, but missed some edge cases where the same namespace prefix
was changed to a different namespaces by a child element. This
happened most often with the default namespace (i.e. xmlns="foo").
This patch adds support for detecting when these namesspace prefix
changes happen (including default namespace changes) resulting in a
correct minimized scope.
- Modify the toWriter methods of the InfosetImpl to perform pretty
printing. This does not add whitespace inside of simple elements.
It only adds indentation and newlines where it does not affect the
data. Also replace uses of the PrettyPrinter in the debugger and
runtime with the toWriter method. The PrettyPrinter tried to do some
complex work to hide namespaces that were not necessary to show, but
it didn't have all the necessary information (like parent namespace)
and would sometimes create invalid namespaces. The InfosetImpl has
all the necessary information, so it is much easier for it to just
pretty print the infoset. Additionally, if someone wants a pretty
string, this avoids create a Scala NodeSeq and then using a pretty
printer to convert to a string.
- Remove the uniqueScope namespace binding variable. This didn't
actually result in the correct namespace for the examples mentioned.
Instead, a new method is added to create a string for the unique
scope, based on the current scope and the parent scope. Unique scopes
are just those that are in the current scope but not in the parent
DFDL-1555- daffodil-cli/src/test/resources/edu/illinois/ncsa/daffodil/CLI/input/input15.txt (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-cli/src/test/resources/edu/illinois/ncsa/daffodil/CLI/input/input16.txt (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-cli/src/test/resources/edu/illinois/ncsa/daffodil/CLI/output/output11.txt (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-cli/src/test/scala-cli/edu/illinois/ncsa/daffodil/debugger/TestCLIDebugger.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-cli/src/test/scala-cli/edu/illinois/ncsa/daffodil/parsing/TestCLIParsing.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/compiler/Compiler.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/ElementBase.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-lib/src/main/resources/xsd/dafext.xsd (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/xml/Namespaces.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/xml/XMLEventCursor.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/xml/XMLUtils.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/compiler/DaffodilTunableParameters.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/debugger/InteractiveDebugger.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/Infoset.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/InfosetImpl.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/Runtime.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/RuntimeData.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/unparsers/InfosetCursorFromXMLEventCursor.scala (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)
- daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section06/namespaces/namespaces.tdml (version c845e4cf62a5161fbae7a2d7ec34bd36b506537f) (diffs)