mike-mcgann commented on code in PR #985:
URL: https://github.com/apache/daffodil/pull/985#discussion_r1132533243
##########
daffodil-test/src/test/scala/org/apache/daffodil/section00/general/TestDisallowDocType.scala:
##########
@@ -87,7 +86,7 @@ class TestDisallowDocType {
}
@Test def test_infosetFileMustNotHaveDocType(): Unit = {
- val e = intercept[TDMLException] {
+ val e = intercept[SAXParseException] {
Review Comment:
The code for that is as follows:
```scala
/**
* attribute value, terminated by either `'` or `"`. value may not contain
`<`.
* @param endCh either `'` or `"`
*/
def xAttributeValue(endCh: Char): String = {
val buf = new StringBuilder
while (ch != endCh && !eof) {
// well-formedness constraint
if (ch == '<') reportSyntaxError("'<' not allowed in attrib value")
else if (ch == SU) truncatedError("")
else buf append ch_returning_nextch
}
ch_returning_nextch
// @todo: normalize attribute value
buf.toString
}
```
I think that when a `<` character is seen, the error recovery needs to be a
call to `ch_returning_nextch` without appending it to `buf`. So I think it is
probably straightforward but I'm not sure. The call to `truncatedError` doesn't
seem to handle that either. Maybe there is some other expectation here. It
might be worth time boxing a fix attempt. If a working PR can be prepared in
less than X hours, great, otherwise drop the attempt.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]