mbeckerle commented on a change in pull request #558:
URL: https://github.com/apache/daffodil/pull/558#discussion_r630334843
##########
File path:
daffodil-lib/src/main/scala/org/apache/daffodil/xml/DaffodilConstructingLoader.scala
##########
@@ -86,6 +86,14 @@ class DaffodilConstructingLoader(uri: URI, errorHandler:
org.xml.sax.ErrorHandle
Source.fromInputStream(is, enc)
}, true) {
+ /**
+ * Ensures that DOCTYPES aka DTDs, if encountered, are rejected.
+ */
+ override def parseDTD(): Unit = {
Review comment:
Add COVERAGE OFF/ON
##########
File path:
daffodil-lib/src/main/scala/org/apache/daffodil/xml/DaffodilXMLLoader.scala
##########
@@ -578,7 +567,19 @@ class DaffodilXMLLoader(val errorHandler:
org.xml.sax.ErrorHandler) {
res
}
- def validateSchema(source: DaffodilSchemaSource) =
xercesAdapter.validateSchema(source)
+ // We disallow any of these except ones where we can definitely get an
associated
Review comment:
Revise or remove misleading comment.
##########
File path:
daffodil-test/src/test/resources/org/apache/daffodil/section00/general/disallowDocTypes.tdml
##########
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
Review comment:
This is an important file for review. There are tests here for loading
of the various XML and schemas with Doctypes in them.
##########
File path:
daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/SchemaCache.scala
##########
@@ -45,9 +45,9 @@ object SchemaDataProcessorCache extends
SchemaCache[(Seq[Diagnostic], DFDL.DataP
class SchemaCache[CachedType, DiagnosticType] {
private class Cache
- extends mutable.HashMap[(URISchemaSource, Boolean, Boolean,
Option[String], Option[String]), (URISchemaSource, CachedType)] {
+ extends mutable.HashMap[(URISchemaSource, Boolean, Boolean,
Option[String], Option[String], Map[String, String]), (URISchemaSource,
CachedType)] {
Review comment:
Lines too long. Add comments explaining why the tunables map is now
included. Comments per member of this hashmap key tuple.
##########
File path:
daffodil-tdml-processor/src/main/scala/org/apache/daffodil/tdml/SchemaCache.scala
##########
@@ -91,9 +91,10 @@ class SchemaCache[CachedType, DiagnosticType] {
def compileAndCache(uss: URISchemaSource, useSerializedProcessor: Boolean,
compileAllTopLevels: Boolean,
optRootName: Option[String],
- optRootNamespace: Option[String])(doCompileByName: => CompileResult):
CompileResult = {
+ optRootNamespace: Option[String],
+ tunables: Map[String, String])(doCompileByName: => CompileResult):
CompileResult = {
lazy val doCompile = doCompileByName // exactly once
- val key = (uss, useSerializedProcessor, compileAllTopLevels, optRootName,
optRootNamespace)
+ val key = (uss, useSerializedProcessor, compileAllTopLevels, optRootName,
optRootNamespace, tunables)
Review comment:
Add comments about why tunables.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]