mbeckerle commented on a change in pull request #460:
URL: https://github.com/apache/incubator-daffodil/pull/460#discussion_r527998232
##########
File path:
daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/dafext.xsd
##########
@@ -401,6 +471,11 @@
frequency of context switching, but increase the memory
footprint.
</xs:documentation>
</xs:annotation>
+ <xs:simpleType>
Review comment:
A defined simple type daf:OneOrGreater or some such would be more
compact here as these would all remain one-liners with a
type="daf:oneOrGreater" attribute.
##########
File path:
daffodil-propgen/src/main/scala/org/apache/daffodil/propGen/TunableGenerator.scala
##########
@@ -197,16 +224,53 @@ class PrimitiveTunable(name: String, schemaType: String,
schemaDefault: String)
case _ => schemaDefault
}
+ private def restrictionCheck(rCheck: String, rValue: String): Option[String]
= {
+ if (rValue != "") {
+ Some(s""" if (!(v ${rCheck} ${rValue}))
throwInvalidTunableValue(tunable, value)""")
+ } else {
+ None
+ }
+ }
+
+ private val minInclusive = node \\ "minInclusive" \@ "value"
Review comment:
So it appears this is depending on the XML schema of the tunables being
structured not as just an XML schema, but as one that always uses immediate
simple types definitions having exactly these attributes.
If so, you need comments in the tunables.xsd file because looking at it,
first thing I'd do is factor out all the redundant type definitions which would
break this scraper/generator code.
##########
File path:
daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/dafext.xsd
##########
@@ -110,55 +110,39 @@
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element name="blobChunkSizeInBytes" type="xs:int" default="4096"
minOccurs="0">
+ <xs:element name="blobChunkSizeInBytes" default="4096" minOccurs="0">
<xs:annotation>
<xs:documentation>
When reading/writing blob data, the maximum number of bytes to
read/write at a time.
</xs:documentation>
</xs:annotation>
+ <xs:simpleType>
Review comment:
Your scraper generator depends on this being an immediate simpletype
with a restriction with min/max/exclusive/inclusive in it manifestly.
You need to document that here, because changing this to say
type="daf:oneOrGreater" with that defined elsewhere would break this I think.
----------------------------------------------------------------
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]