This is an automated email from the ASF dual-hosted git repository.
slawrence pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git
The following commit(s) were added to refs/heads/main by this push:
new 4fb1c1a5a Revert "Check for Unused Properties on Annotated Schema
Components"
4fb1c1a5a is described below
commit 4fb1c1a5af4ef083800003db9c0310d5232c84fe
Author: Steve Lawrence <[email protected]>
AuthorDate: Tue Jan 7 07:49:34 2025 -0500
Revert "Check for Unused Properties on Annotated Schema Components"
This reverts commit f9854f4f6dbb2a3f6b1e14035dfe39bede8480da.
This commit caused a regression on some schemas, creating many "unused
property" false positive warnings. The change isn't critical and is
likely a difficult change to complete and verify for the next release.
Revert it for now, in the next dev cycle we can cherry-pick the change
to restore and fix it.
DAFFODIL-2798
---
.../core/dsom/AnnotatedSchemaComponent.scala | 40 ----
.../daffodil/core/dsom/RestrictionUnion.scala | 2 +-
.../scala/org/apache/daffodil/core/dsom/Root.scala | 27 ---
.../org/apache/daffodil/core/dsom/SchemaSet.scala | 136 +----------
.../apache/daffodil/core/dsom/SimpleTypes.scala | 1 -
.../scala/org/apache/daffodil/core/dsom/Term.scala | 38 ++++
.../lib/exceptions/SchemaFileLocatable.scala | 13 +-
.../schema/annotation/props/PropertyScoping.scala | 7 -
.../daffodil/extensions/enum/enumInvalid.tdml | 28 ---
.../section07/property_syntax/PropertySyntax.tdml | 253 +--------------------
.../property_syntax/property_syntax2.dfdl.xsd | 65 ------
.../section12/lengthKind/PrefixedTests.tdml | 3 +-
.../org/apache/daffodil/extensions/TestEnums.scala | 2 -
.../property_syntax/TestPropertySyntax.scala | 14 --
14 files changed, 51 insertions(+), 578 deletions(-)
diff --git
a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/AnnotatedSchemaComponent.scala
b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/AnnotatedSchemaComponent.scala
index ab1aec630..7cf1e57e1 100644
---
a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/AnnotatedSchemaComponent.scala
+++
b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/AnnotatedSchemaComponent.scala
@@ -291,7 +291,6 @@ final class SharedFactory[SharedType] {
trait AnnotatedSchemaComponent
extends SchemaComponent
with AnnotatedMixin
- with ResolvesLocalProperties
with OverlapCheckMixin {
protected override def initialize(): Unit = {
@@ -378,45 +377,6 @@ trait AnnotatedSchemaComponent
val res = schemaDocument.formatAnnotation.formatChain
res
}
-
- /**
- * Used to look for DFDL properties on Annotated Schema Components that
- * have not been accessed and record it as a warning. This function uses the
- * property cache state to determine which properties have been accessed, so
- * this function must only be called after all property accesses are complete
- * (e.g. schema compilation has finished) and after propagateUsedProperties
- * has been called on all AnnotatedSchemaComponents, to ensure there are no
false
- * positives/negatives.
- *
- * Note: This is not a recursive walk. It identifies and issues warnings
about
- * unaccessed properties on just one AnnotatedSchemaComponent
- */
- final lazy val checkUnusedProperties: Unit = {
- // Get the properties defined on this component and what it refers to
- val localProps = formatAnnotation.justThisOneProperties
- val refProps = optReferredToComponent
- .map { _.formatAnnotation.justThisOneProperties }
- .getOrElse(Map.empty)
-
- val usedProperties = propCache
-
- localProps.foreach { case (prop, (value, _)) =>
- if (!usedProperties.contains(prop)) {
- SDW(WarnID.IgnoreDFDLProperty, "DFDL property was ignored: %s=\"%s\"",
prop, value)
- }
- }
-
- refProps.foreach { case (prop, (value, _)) =>
- if (!usedProperties.contains(prop)) {
- optReferredToComponent.get.SDW(
- WarnID.IgnoreDFDLProperty,
- "DFDL property was ignored: %s=\"%s\"",
- prop,
- value
- )
- }
- }
- }
}
/**
diff --git
a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/RestrictionUnion.scala
b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/RestrictionUnion.scala
index f5b732340..75ad73329 100644
---
a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/RestrictionUnion.scala
+++
b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/RestrictionUnion.scala
@@ -278,7 +278,7 @@ final class Union private (val xmlArg: Node, simpleTypeDef:
SimpleTypeDefBase)
private lazy val immediateTypeXMLs = xml \ "simpleType"
private lazy val immediateTypes: Seq[SimpleTypeDefBase] =
immediateTypeXMLs.map { node =>
{
- LocalSimpleTypeDef(node, this)
+ LocalSimpleTypeDef(node, schemaDocument)
}
}
diff --git
a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Root.scala
b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Root.scala
index b2f890a17..4f40af9ee 100644
--- a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Root.scala
+++ b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Root.scala
@@ -82,22 +82,6 @@ final class Root private (
m.toMap
}
- /**
- * For any given global simple type, tells us what other simple types contain
- * references to it
- *
- * This is intended to be used when we're propagating used properties to
ensure
- * properties are properly propagates along the simple type base chain
- */
- lazy val typeBaseChainMap: Map[GlobalComponent, Seq[(String, Seq[RefSpec])]]
= {
- val refEntries: Seq[(GlobalComponent, Seq[RefSpec])] =
- typeBaseChains.groupBy { _.to }.toSeq
- val m: Seq[(GlobalComponent, Seq[(String, Seq[RefSpec])])] =
refEntries.map {
- case (to, seq) => (to, seq.groupBy {
_.from.shortSchemaComponentDesignator }.toSeq)
- }
- m.toMap
- }
-
final def elementRefsTo(decl: GlobalElementDecl): Seq[ElementRef] =
refsTo(decl).asInstanceOf[Seq[ElementRef]]
@@ -157,17 +141,6 @@ final class Root private (
}.flatten
}
- final lazy val typeBaseChains: Seq[RefSpec] = {
- allComponents.collect {
- case std: SimpleTypeDefBase => {
- val optStd = std.optReferredToComponent.collect { case stdb:
SimpleTypeDefBase =>
- stdb
- }
- optStd.map { stdb => RefSpec(std, stdb, 1) }.toSeq
- }
- }.flatten
- }
-
lazy val allERefs = allComponents
.filter {
case er: ElementRef => true
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 30a06ea47..e59c45227 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
@@ -18,7 +18,6 @@
package org.apache.daffodil.core.dsom
import java.io.File
-import scala.collection.mutable
import scala.xml.Node
import org.apache.daffodil.core.compiler.RootSpec
@@ -554,127 +553,8 @@ final class SchemaSet private (
.flatMap(_.defineVariables)
.union(predefinedVars)
- private val doneSimpleTypeDefs: mutable.Set[SimpleTypeDefBase] =
mutable.Set()
-
- /**
- * Used to propagate used properties through all element/group references,
element declarations
- * and simple types. This is necessary because we can have elements being
referenced
- * by multiple element refs, where the first element gets its propCache
populated with
- * the properties it has used, and the second element doesn't because it
shares the parsers
- * of the first element.
- *
- * With this function, we copy used properties from element refs to
elements, group refs to groups,
- * from elements to their simple types, from enclosing elements to their
local simple types,
- * and from simple types to their base types. This function is recursive
when processing
- * simple type definitions that reference simple type defs whose base is a
primitive type.
- *
- * Note: this is clobbering the property caches, making them subsequently
unusable
- * for their initial property lookup uses. Hence, this must be done in a
pass that
- * happens only after all other schema compilation involving properties is
complete.
- */
- def propagateUsedPropertiesForThis(asc: AnnotatedSchemaComponent): Unit = {
- asc match {
- case ggd: GlobalGroupDef => {
- val groupRefs = root.refMap.getOrElse(ggd, Seq.empty)
- groupRefs.foreach { case (_, grs) =>
- grs.foreach { rs =>
- val gr = rs.from.asInstanceOf[AnnotatedSchemaComponent]
- gr.propCache.foreach { kv =>
- if (ggd.formatAnnotation.justThisOneProperties.contains(kv._1)) {
- ggd.propCache.put(kv._1, kv._2)
- }
- }
- }
- }
- }
- case ged: GlobalElementDecl => {
- val elementRefs = root.refMap.getOrElse(ged, Seq.empty)
- elementRefs.foreach { case (_, ers) =>
- ers.foreach { rs =>
- val er = rs.from.asInstanceOf[AnnotatedSchemaComponent]
- er.propCache.foreach { kv =>
- if (ged.formatAnnotation.justThisOneProperties.contains(kv._1)) {
- ged.propCache.put(kv._1, kv._2)
- }
- }
- }
- }
- }
- case gstd: GlobalSimpleTypeDef if gstd.bases.nonEmpty => {
- val elementsOfType = root.refMap.getOrElse(gstd, Seq.empty)
- elementsOfType.foreach { case (_, eles) =>
- eles.foreach { rs =>
- val er = rs.from.asInstanceOf[AnnotatedSchemaComponent]
- er.propCache.foreach { kv =>
- if (gstd.formatAnnotation.justThisOneProperties.contains(kv._1))
{
- gstd.propCache.put(kv._1, kv._2)
- }
- }
- }
- }
- doneSimpleTypeDefs.add(gstd)
- }
- case lstd: LocalSimpleTypeDef => {
- val enclElements = lstd.enclosingElements
- enclElements.foreach { ee =>
- ee.propCache.foreach { kv =>
- if (lstd.formatAnnotation.justThisOneProperties.contains(kv._1)) {
- lstd.propCache.put(kv._1, kv._2)
- }
- }
- }
- doneSimpleTypeDefs.add(lstd)
- }
- case gstd: GlobalSimpleTypeDef if gstd.bases.isEmpty => {
- val othersReferencingThis =
- root.typeBaseChainMap
- .getOrElse(gstd, Seq.empty) ++ root.refMap.getOrElse(gstd,
Seq.empty)
- othersReferencingThis.foreach { case (_, refs) =>
- refs.collect {
- case rs if rs.from.isInstanceOf[SimpleTypeDefBase] =>
- val std = rs.from.asInstanceOf[SimpleTypeDefBase]
- if (!doneSimpleTypeDefs.contains(std)) {
- propagateUsedPropertiesForThis(std)
- }
- std.propCache.foreach(kv => gstd.propCache.put(kv._1, kv._2))
- case rs =>
- val er = rs.from.asInstanceOf[AnnotatedSchemaComponent]
- er.propCache.foreach { kv =>
- if
(gstd.formatAnnotation.justThisOneProperties.contains(kv._1)) {
- gstd.propCache.put(kv._1, kv._2)
- }
- }
- }
- }
- doneSimpleTypeDefs.add(gstd)
- }
- case _ => // do nothing
- }
- }
-
- /**
- * Propagate used properties through AnnotatedSchemaComponent.
- * This must be done after compilation is complete to ensure all properties
- * that are used are accounted for.
- * This is part of the algorithm for identifying properties that are
present, but unused.
- *
- * Note: This algorithm repurposes propCaches which are no longer usable
- * for property lookups after this is done.
- */
- private lazy val propagateUsedProperties = {
- root.allComponents.collect { case asc: AnnotatedSchemaComponent =>
- propagateUsedPropertiesForThis(asc)
- }
- }
-
- /**
- * check unused properties on annotated schema component, must be done
- * after compilation is completed and used properties are propagated
- */
- private lazy val checkUnusedProperties = LV('checkUnusedProperties) {
- root.allComponents.collect { case asc: AnnotatedSchemaComponent =>
- asc.checkUnusedProperties
- }
+ private lazy val checkUnusedProperties = LV('hasUnusedProperties) {
+ root.checkUnusedProperties
}.value
/**
@@ -705,15 +585,6 @@ final class SchemaSet private (
// take into account.
val hasErrors = super.isError
if (!hasErrors) {
- // must be called after compilation is done
- // this is a central part of the algorithm by which we identify
properties that are present,
- // but not used (see checkUnusedProperties).
- // The overall algorithm is expressed in multiple places.
- // This part handles the propagation of properties from referencer to
referenced object
- // when property combining occurs.
- propagateUsedProperties
- // The rest of the algorithm is then just traversing every
AnnotatedSchemaComponent
- // to see what properties are present on them that do not appear in
the propCache.
// must be last, after all compilation is done.
// only check this if there are no errors.
checkUnusedProperties
@@ -830,9 +701,8 @@ class TransitiveClosureSchemaComponents private () extends
TransitiveClosure[Sch
st.bases ++
st.optRestriction ++
st.optUnion
- case r: Restriction => r.optUnion.toSeq ++ r.enumerations
+ case r: Restriction => r.optUnion.toSeq
case u: Union => u.unionMemberTypes
- case e: EnumerationDef => Nil
case c: ComplexTypeBase => Seq(c.modelGroup)
case gd: GlobalGroupDef => gd.groupMembers
case stmt: DFDLStatement => Nil
diff --git
a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SimpleTypes.scala
b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SimpleTypes.scala
index a11cf4213..7462251ec 100644
---
a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SimpleTypes.scala
+++
b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/SimpleTypes.scala
@@ -305,5 +305,4 @@ final class EnumerationDef(xml: Node, parentType:
SimpleTypeDefBase)
protected def isMyFormatAnnotation(a: DFDLAnnotation): Boolean =
Assert.invariantFailed("Should not be called")
- override val diagnosticDebugNameImpl = "enumeration"
}
diff --git
a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Term.scala
b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Term.scala
index bc9bb3f05..95ce0d04a 100644
--- a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Term.scala
+++ b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Term.scala
@@ -22,6 +22,7 @@ import java.util.UUID
import org.apache.daffodil.core.dsom.walker.TermView
import org.apache.daffodil.core.grammar.TermGrammarMixin
+import org.apache.daffodil.lib.api.WarnID
import org.apache.daffodil.lib.exceptions.Assert
import org.apache.daffodil.lib.schema.annotation.props.Found
import org.apache.daffodil.lib.schema.annotation.props.NotFound
@@ -104,6 +105,43 @@ trait Term
*/
final def tci = dpathCompileInfo
+ /**
+ * Used to recursively go through Terms and look for DFDL properties that
+ * have not been accessed and record it as a warning. This function uses the
+ * property cache state to determine which properties have been access, so
+ * this function must only be called after all property accesses are complete
+ * (e.g. schema compilation has finished) to ensure there are no false
+ * positives.
+ */
+ final lazy val checkUnusedProperties: Unit = {
+ // Get the properties defined on this term and what it refers to
+ val localProps = formatAnnotation.justThisOneProperties
+ val refProps = optReferredToComponent
+ .map { _.formatAnnotation.justThisOneProperties }
+ .getOrElse(Map.empty)
+
+ val usedProperties = propCache
+
+ localProps.foreach { case (prop, (value, _)) =>
+ if (!usedProperties.contains(prop)) {
+ SDW(WarnID.IgnoreDFDLProperty, "DFDL property was ignored: %s=\"%s\"",
prop, value)
+ }
+ }
+
+ refProps.foreach { case (prop, (value, _)) =>
+ if (!usedProperties.contains(prop)) {
+ optReferredToComponent.get.SDW(
+ WarnID.IgnoreDFDLProperty,
+ "DFDL property was ignored: %s=\"%s\"",
+ prop,
+ value
+ )
+ }
+ }
+
+ termChildren.foreach { _.checkUnusedProperties }
+ }
+
def position: Int
def optIgnoreCase: Option[YesNo] = {
diff --git
a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/exceptions/SchemaFileLocatable.scala
b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/exceptions/SchemaFileLocatable.scala
index 0a2600961..86b8a2cd9 100644
---
a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/exceptions/SchemaFileLocatable.scala
+++
b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/exceptions/SchemaFileLocatable.scala
@@ -136,14 +136,11 @@ class XercesSchemaFileLocation(
// we have to override equals and hashCode because the OOlag error checks
for duplicates in its error list
override def equals(obj: Any): Boolean = {
- // sometimes what OOlag error/warning is comparing against isn't a
XercesSchemaFileLocation, but
- // is a schemaFileLocation instead, since XercesSchemaFileLocation is a
SchemaFileLocation as well,
- // we just use that for comparison
- val sflObj = obj.asInstanceOf[SchemaFileLocation]
- sflObj.lineNumber.getOrElse("") == this.lineNumber.getOrElse("") &&
- sflObj.columnNumber.getOrElse("") == this.columnNumber.getOrElse("") &&
- sflObj.diagnosticFile == this.diagnosticFile &&
- sflObj.diagnosticDebugName == this.diagnosticDebugName
+ val xsflObj = obj.asInstanceOf[XercesSchemaFileLocation]
+ xsflObj.xercesError.getLineNumber == this.xercesError.getLineNumber &&
+ xsflObj.xercesError.getColumnNumber == this.xercesError.getColumnNumber &&
+ xsflObj.xercesError.getSystemId == this.xercesError.getSystemId &&
+ xsflObj.schemaFileLocation == this.schemaFileLocation
}
override def hashCode: Int = {
diff --git
a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/PropertyScoping.scala
b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/PropertyScoping.scala
index b76fcdaa9..dddab9950 100644
---
a/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/PropertyScoping.scala
+++
b/daffodil-lib/src/main/scala/org/apache/daffodil/lib/schema/annotation/props/PropertyScoping.scala
@@ -152,13 +152,6 @@ trait FindPropertyMixin extends PropTypes {
*/
protected def lookupProperty(pname: String): PropertyLookupResult
- /**
- * the PropCache plays two roles in different phases of the compilation.
- * First for property lookups, second for determining which properties are
present, but unused.
- *
- * These two uses are incompatible as the second does propagation of used
properties using propCache.
- * The first use must therefore be over. Then the caches are repurposed for
the second algorithm.
- */
val propCache = new scala.collection.mutable.LinkedHashMap[String,
PropertyLookupResult]
/**
diff --git
a/daffodil-test/src/test/resources/org/apache/daffodil/extensions/enum/enumInvalid.tdml
b/daffodil-test/src/test/resources/org/apache/daffodil/extensions/enum/enumInvalid.tdml
index 8d5501d75..9d7d5d100 100644
---
a/daffodil-test/src/test/resources/org/apache/daffodil/extensions/enum/enumInvalid.tdml
+++
b/daffodil-test/src/test/resources/org/apache/daffodil/extensions/enum/enumInvalid.tdml
@@ -95,20 +95,6 @@
</restriction>
</simpleType>
- <xs:simpleType name="rep" dfdl:lengthKind="explicit" dfdl:length="1">
- <xs:restriction base="xs:unsignedInt" />
- </xs:simpleType>
-
- <xs:simpleType name="value" dfdlx:repType="ex:rep">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ZERO" dfdlx:repValue="0" />
- <xs:enumeration value="ONE" dfdlx:repValue="1" />
- <xs:enumeration value="TWO" dfdlx:repValue="2" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:element name="r2" type="ex:value" />
-
</tdml:defineSchema>
<parserTestCase name="noRepValues" model="s1" root="r1">
@@ -125,20 +111,6 @@
</errors>
</parserTestCase>
- <parserTestCase name="noRepValues2" model="s1" root="r2">
- <document>
- <documentPart type="byte">01</documentPart>
- </document>
- <errors>
- <error>Schema Definition Error</error>
- <error>enumerations must define</error>
- <error>dfdlx:repValues</error>
- <error>dfdlx:repValueRanges</error>
- <error>dfdlx:repType</error>
- <error>ex:rep</error>
- </errors>
- </parserTestCase>
-
<tdml:defineSchema
name="s2"
useDefaultNamespace="false"
diff --git
a/daffodil-test/src/test/resources/org/apache/daffodil/section07/property_syntax/PropertySyntax.tdml
b/daffodil-test/src/test/resources/org/apache/daffodil/section07/property_syntax/PropertySyntax.tdml
index f400a5654..49005e121 100644
---
a/daffodil-test/src/test/resources/org/apache/daffodil/section07/property_syntax/PropertySyntax.tdml
+++
b/daffodil-test/src/test/resources/org/apache/daffodil/section07/property_syntax/PropertySyntax.tdml
@@ -146,19 +146,8 @@
</xs:appinfo>
</xs:annotation>
</xs:element>
-
-
- <xs:simpleType name="value">
- <xs:restriction base="xs:string">
- <xs:enumeration value="ZERO" dfdlx:repValue="0" />
- <xs:enumeration value="ONE" dfdlx:repValue="1" />
- <xs:enumeration value="TWO" dfdlx:repValue="2" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:element name="root8" type="ex:value" />
-
- </tdml:defineSchema>
+
+</tdml:defineSchema>
<tdml:parserTestCase name="ShortAndLongForm" root="root"
model="PropertySyntax" description="Negative test for both short and long
form on an element- DFDL-7-020R">
@@ -412,242 +401,4 @@
</tdml:errors>
</tdml:parserTestCase>
-
- <tdml:parserTestCase name="ignoredPropertiesWarning2" root="root8"
- model="PropertySyntax" description="warning due to ignored properties"
- roundTrip="true">
- <tdml:document><![CDATA[1]]></tdml:document>
- <tdml:warnings>
- <tdml:warning>DFDL property was ignored</tdml:warning>
- <tdml:warning>repValue</tdml:warning>
- </tdml:warnings>
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <root8>1</root8>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:defineSchema name="PropertiesOnTypesOfElements"
xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ex="http://example.com">
- <xs:include
schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
-
- <dfdl:format ref="GeneralFormat" lengthKind="delimited" />
-
- <xs:element name="DinnerTime">
- <xs:complexType>
- <xs:choice>
- <xs:element ref="ex:MonthDayTime" />
- <xs:element ref="ex:DayTime" />
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="MonthDayTime">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="ex:Month"/>
- <xs:element ref="ex:Day"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="DayTime">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="ex:Day"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="Month"
- type="ex:MonthDayType"
- dfdl:lengthKind="explicit"
- dfdl:length="2">
- </xs:element>
-
- <xs:element name="Day"
- type="ex:MonthDayType"
- dfdl:lengthKind="explicit"
- dfdl:length="2">
- </xs:element>
-
- <xs:simpleType name="MonthDayType">
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:simpleType textNumberRep="standard"
- textNumberCheckPolicy="strict"
- textNumberPattern="00"
- textStandardGroupingSeparator=","
- textStandardDecimalSeparator="."
- textStandardBase="10"
- textNumberRounding="pattern"/>
- </xs:appinfo>
- </xs:annotation>
- <xs:restriction base="xs:unsignedInt"/>
- </xs:simpleType>
- </tdml:defineSchema>
-
- <tdml:parserTestCase name="propertiesOnTypeOfElement1" root="DinnerTime"
- model="PropertiesOnTypesOfElements"
- roundTrip="true">
- <tdml:document><![CDATA[09]]></tdml:document>
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <DinnerTime>
- <DayTime>
- <Day>9</Day>
- </DayTime>
- </DinnerTime>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:defineSchema name="PropertiesOnSimpleTypeChains"
xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ex="http://example.com" xmlns:ps="urn:property-syntax">
- <xs:include
schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
- <xs:import namespace="urn:property-syntax"
schemaLocation="/org/apache/daffodil/section07/property_syntax/property_syntax2.dfdl.xsd"
/>
-
- <dfdl:format ref="ex:GeneralFormat" lengthKind="delimited" />
-
- <xs:element name="DinnerTime">
- <xs:complexType>
- <xs:choice>
- <xs:element ref="ex:MonthDayTime" />
- <xs:element ref="ex:DayTime" />
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="MonthDayTime">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="ex:Month"/>
- <xs:element ref="ex:Day"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="DayTime">
- <xs:complexType>
- <xs:sequence>
- <xs:element ref="ex:Day"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="Month"
- type="ex:MonthDayType"
- dfdl:lengthKind="explicit"
- dfdl:length="2">
- </xs:element>
-
- <xs:element name="Day"
- type="ps:MonthDayTypeBase"
- dfdl:lengthKind="explicit"
- dfdl:length="2">
- </xs:element>
-
- <xs:simpleType name="MonthDayType">
- <xs:restriction base="ps:MonthDayTypeBase"/>
- </xs:simpleType>
- </tdml:defineSchema>
-
- <tdml:parserTestCase name="propertiesOnTypeOfElement2" root="DinnerTime"
- model="PropertiesOnSimpleTypeChains"
- roundTrip="true">
- <tdml:document><![CDATA[09]]></tdml:document>
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <DinnerTime>
- <DayTime>
- <Day>9</Day>
- </DayTime>
- </DinnerTime>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
-
- <tdml:defineSchema name="PropertiesOnGroups"
xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ex="http://example.com" xmlns:ps="urn:property-syntax">
- <xs:include
schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
- <xs:import namespace="urn:property-syntax"
schemaLocation="/org/apache/daffodil/section07/property_syntax/property_syntax2.dfdl.xsd"
/>
-
- <dfdl:format ref="ex:GeneralFormat" lengthKind="delimited" />
-
- <xs:element name="DinnerTime">
- <xs:complexType>
- <xs:group ref="ex:g1"/>
- </xs:complexType>
- </xs:element>
-
- <xs:group name="g1">
- <xs:choice dfdl:initiator="[" dfdl:terminator="]">
- <xs:element ref="ex:MonthDayTime" />
- <xs:element ref="ex:DayTime" />
- </xs:choice>
- </xs:group>
-
- <xs:element name="MonthDayTime">
- <xs:complexType>
- <xs:group ref="ex:g2"/>
- </xs:complexType>
- </xs:element>
-
- <xs:group name="g2">
- <xs:sequence dfdl:separator="/">
- <xs:element ref="ex:Month"/>
- <xs:element ref="ex:Day"/>
- </xs:sequence>
- </xs:group>
-
- <xs:element name="DayTime">
- <xs:complexType>
- <xs:group ref="ex:g3"/>
- </xs:complexType>
- </xs:element>
-
- <xs:group name="g3">
- <xs:sequence>
- <xs:element ref="ex:Day"/>
- </xs:sequence>
- </xs:group>
-
- <xs:element name="Month"
- type="ex:MonthDayType"
- dfdl:lengthKind="explicit"
- dfdl:length="2">
- </xs:element>
-
- <xs:element name="Day">
- <xs:simpleType>
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:simpleType lengthKind="explicit" length="2"/>
- </xs:appinfo>
- </xs:annotation>
- <xs:restriction base="ps:MonthDayTypeBase"/>
- </xs:simpleType>
- </xs:element>
-
- <xs:simpleType name="MonthDayType">
- <xs:restriction base="ps:MonthDayTypeBase"/>
- </xs:simpleType>
- </tdml:defineSchema>
-
- <tdml:parserTestCase name="propertiesOnGroups1" root="DinnerTime"
- model="PropertiesOnGroups"
- roundTrip="true">
- <tdml:document><![CDATA[[09/05]]]></tdml:document>
- <tdml:infoset>
- <tdml:dfdlInfoset>
- <DinnerTime>
- <MonthDayTime>
- <Month>9</Month>
- <Day>5</Day>
- </MonthDayTime>
- </DinnerTime>
- </tdml:dfdlInfoset>
- </tdml:infoset>
- </tdml:parserTestCase>
</tdml:testSuite>
diff --git
a/daffodil-test/src/test/resources/org/apache/daffodil/section07/property_syntax/property_syntax2.dfdl.xsd
b/daffodil-test/src/test/resources/org/apache/daffodil/section07/property_syntax/property_syntax2.dfdl.xsd
deleted file mode 100644
index 035285a8f..000000000
---
a/daffodil-test/src/test/resources/org/apache/daffodil/section07/property_syntax/property_syntax2.dfdl.xsd
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
-targetNamespace="urn:property-syntax" xmlns:ps="urn:property-syntax">
-
- <xs:include
schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
-
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:format ref="ps:GeneralFormat" separator="" initiator=""
terminator="" leadingSkip='0' textTrimKind="none" initiatedContent="no"
- ignoreCase="no" alignment='implicit' alignmentUnits='bytes'
trailingSkip='0'
- lengthKind="delimited"/>
- </xs:appinfo>
- </xs:annotation>
-
- <xs:simpleType name="MonthDayTypeBase">
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:simpleType textNumberRep="standard"
- textNumberCheckPolicy="strict"
- textNumberPattern="00"
- textStandardGroupingSeparator=","
- textStandardDecimalSeparator="."
- textStandardBase="10"
- textNumberRounding="pattern"/>
- </xs:appinfo>
- </xs:annotation>
- <xs:restriction base="ps:uIntBase"/>
- </xs:simpleType>
-
- <xs:simpleType name="MonthDayTypeBase2">
- <xs:annotation>
- <xs:appinfo source="http://www.ogf.org/dfdl/">
- <dfdl:simpleType textNumberRep="standard"
- textNumberCheckPolicy="strict"
- textNumberPattern="00"
- textStandardGroupingSeparator=","
- textStandardDecimalSeparator="."
- textStandardBase="10"
- textNumberRounding="pattern"/>
- </xs:appinfo>
- </xs:annotation>
- <xs:restriction base="ps:uIntBase"/>
- </xs:simpleType>
-
- <xs:simpleType name="uIntBase">
- <xs:restriction base="xs:unsignedInt"/>
- </xs:simpleType>
-</xs:schema>
diff --git
a/daffodil-test/src/test/resources/org/apache/daffodil/section12/lengthKind/PrefixedTests.tdml
b/daffodil-test/src/test/resources/org/apache/daffodil/section12/lengthKind/PrefixedTests.tdml
index a9c43403f..6882e2057 100644
---
a/daffodil-test/src/test/resources/org/apache/daffodil/section12/lengthKind/PrefixedTests.tdml
+++
b/daffodil-test/src/test/resources/org/apache/daffodil/section12/lengthKind/PrefixedTests.tdml
@@ -2575,7 +2575,8 @@
dfdl:lengthKind="prefixed"
dfdl:prefixLengthType="ex:prefixType"
dfdl:prefixIncludesPrefixLength="no"
- type="xs:nonNegativeInteger" dfdl:lengthUnits="bits"/>
+ type="xs:nonNegativeInteger"
+ dfdl:lengthUnits="bits"/>
</tdml:defineSchema>
<tdml:parserTestCase name="lengthUnitsBitsForNonNegativeInteger_prefixed"
root="r1" model="lengthUnitsBitsForNonNegativeInteger_prefixed"
diff --git
a/daffodil-test/src/test/scala/org/apache/daffodil/extensions/TestEnums.scala
b/daffodil-test/src/test/scala/org/apache/daffodil/extensions/TestEnums.scala
index ee214cd34..91fcb59ae 100644
---
a/daffodil-test/src/test/scala/org/apache/daffodil/extensions/TestEnums.scala
+++
b/daffodil-test/src/test/scala/org/apache/daffodil/extensions/TestEnums.scala
@@ -43,8 +43,6 @@ class TestEnums {
@Test def test_emptyRepValues(): Unit = {
runner2.runOneTest("emptyRepValues") }
@Test def test_noRepValues(): Unit = { runner2.runOneTest("noRepValues") }
- // DFDL-2798
- @Test def test_noRepValues2(): Unit = { runner2.runOneTest("noRepValues2") }
@Test def test_enumRepTypeNonInt(): Unit = {
runner2.runOneTest("enumRepTypeNonInt") }
}
diff --git
a/daffodil-test/src/test/scala/org/apache/daffodil/section07/property_syntax/TestPropertySyntax.scala
b/daffodil-test/src/test/scala/org/apache/daffodil/section07/property_syntax/TestPropertySyntax.scala
index 53712a040..f42bf24ac 100644
---
a/daffodil-test/src/test/scala/org/apache/daffodil/section07/property_syntax/TestPropertySyntax.scala
+++
b/daffodil-test/src/test/scala/org/apache/daffodil/section07/property_syntax/TestPropertySyntax.scala
@@ -66,20 +66,6 @@ class TestPropertySyntax {
@Test def test_ignoredPropertiesWarning(): Unit = {
runner1.runOneTest("ignoredPropertiesWarning")
}
- // DFDL-2798
- @Test def test_ignoredPropertiesWarning2(): Unit = {
- runner1.runOneTest("ignoredPropertiesWarning2")
- }
- @Test def test_propertiesOnTypeOfElement1(): Unit = {
- runner1.runOneTest("propertiesOnTypeOfElement1")
- }
- @Test def test_propertiesOnTypeOfElement2(): Unit = {
- runner1.runOneTest("propertiesOnTypeOfElement2")
- }
- @Test def test_propertiesOnGroups1(): Unit = {
- runner1.runOneTest("propertiesOnGroups1")
- }
-
// DFDL-1842
@Test def test_overlappingProperties1(): Unit = {
runner1.runOneTest("overlappingProperties1")