You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "stevedlawrence (via GitHub)" <gi...@apache.org> on 2026/04/09 19:31:50 UTC
Re: [PR] Add support for `dfdl:lengthKind="endOfParent"` [daffodil]
stevedlawrence commented on code in PR #1652:
URL: https://github.com/apache/daffodil/pull/1652#discussion_r3058988029
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Term.scala:
##########
@@ -269,6 +269,26 @@ trait Term
.getOrElse(false)
}
+ final lazy val immediatelyEnclosingElementParent: Option[ElementBase] = {
+ val p = optLexicalParent.flatMap {
Review Comment:
Note that I think lexical parents does not extend past global decls, so if a global decl has endOfParent then I'm not sure we will correctly check EOP restrictions for anything that references that decl. I'm wondering if the checks need to go down instead up?
For example, maybe an element needs to check if it has properties that would disallow children with lengthKind EOP and if so check if any children have are EOP? Or check if any immediate children have EOP, and if so then check if they are compatible?
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/LocalElementMixin.scala:
##########
@@ -61,10 +61,8 @@ trait LocalElementMixin extends ParticleMixin with LocalElementGrammarMixin {
else if (representation =:= Representation.Binary) true
else false
}
- case LengthKind.EndOfParent if isComplexType =>
- notYetImplemented("lengthKind='endOfParent' for complex type")
- case LengthKind.EndOfParent =>
- notYetImplemented("lengthKind='endOfParent' for simple type")
+ // per DFDL Spec 9.3.2, endOfParent is already positioned at parent's end so length is zero
Review Comment:
This comment is a bit confusing to me. This function is supposed to return whether or not we statically know if this element must have non-zero length. I imagine we can rarely statically know that for endOfParent elements, so I think returning false here is correct. But the comment kindof makes it sound like the length is always zero, which kindof contradicts that.
Reading this portion of the spec (which this comment copies), I think the spec is talking about the runtime evaluation of whether or not a field is zero length. I believe the spec is just saying that that an endOfParent element has zero length representation if it is already at the parents end (i.e. bitLimit == bitPosition). Since this is more about runtime, I'm not sure this comment belongs here and might avoid that confusion.
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -252,6 +257,134 @@ trait ElementBaseGrammarMixin
}
final lazy val prefixedLengthBody = prefixedLengthElementDecl.parsedValue
+ final lazy val parentEffectiveLengthUnits: LengthUnits =
+ immediatelyEnclosingElementParent match {
+ case Some(parent: ElementBase) => {
+ parent.lengthKind match {
+ case LengthKind.Explicit | LengthKind.Prefixed => parent.lengthUnits
+ case LengthKind.Pattern => LengthUnits.Characters
+ case _
+ if parent.isInstanceOf[ChoiceTermBase] && (parent
+ .asInstanceOf[ChoiceTermBase]
+ .choiceLengthKind == ChoiceLengthKind.Explicit) =>
+ LengthUnits.Bytes
+ case LengthKind.EndOfParent => parent.parentEffectiveLengthUnits
+ case _ =>
+ Assert.invariantFailed(
+ s"Could not figure effective length unit of parents of ${context}"
+ )
+ }
+ }
+ case None if this.isInstanceOf[Root] => LengthUnits.Characters
+ case _ =>
+ Assert.invariantFailed(
Review Comment:
I feel like this invariant might break if we have something like a global element decl with a child with EOP. That EOP will want to reach up to find where it's used but wont' be able to find a parent because it only looks lexically.
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -252,6 +257,134 @@ trait ElementBaseGrammarMixin
}
final lazy val prefixedLengthBody = prefixedLengthElementDecl.parsedValue
+ final lazy val parentEffectiveLengthUnits: LengthUnits =
+ immediatelyEnclosingElementParent match {
+ case Some(parent: ElementBase) => {
+ parent.lengthKind match {
+ case LengthKind.Explicit | LengthKind.Prefixed => parent.lengthUnits
+ case LengthKind.Pattern => LengthUnits.Characters
+ case _
+ if parent.isInstanceOf[ChoiceTermBase] && (parent
+ .asInstanceOf[ChoiceTermBase]
+ .choiceLengthKind == ChoiceLengthKind.Explicit) =>
+ LengthUnits.Bytes
+ case LengthKind.EndOfParent => parent.parentEffectiveLengthUnits
+ case _ =>
+ Assert.invariantFailed(
+ s"Could not figure effective length unit of parents of ${context}"
+ )
+ }
+ }
+ case None if this.isInstanceOf[Root] => LengthUnits.Characters
+ case _ =>
+ Assert.invariantFailed(
+ s"Could not figure effective length unit of parents of ${context}"
+ )
+ }
+ final lazy val checkEndOfParentElem: Unit = {
+ if (lengthKind != LengthKind.EndOfParent) ()
+ else {
+ schemaDefinitionWhen(
+ hasTerminator,
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but specifies a dfdl:terminator.",
+ context
Review Comment:
I don't think we need to include context in the error string. I believe the error context is capture and output as part of the SDE.
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/AlignedMixin.scala:
##########
@@ -456,7 +456,11 @@ trait AlignedMixin extends GrammarMixin { self: Term =>
}
case LengthKind.Delimited => encodingLengthApprox
case LengthKind.Pattern => encodingLengthApprox
- case LengthKind.EndOfParent => LengthMultipleOf(1) // NYI
+ case LengthKind.EndOfParent =>
+ eb.immediatelyEnclosingElementParent match {
+ case Some(parent) => parent.elementSpecifiedLengthApprox
Review Comment:
I don't think this is quite right. The length of this element isn't the same as the parent length, it's whatever is left over of the parent after the previous siblings.
So this elements length is kindof `parent.elementSpecifiedLenghtApprox - priorAlignmentApprox` (i.e the length of the parent minus wherever we are starting) but we can't just subtract approx things since they are potentially multiples.
That said, I wonder if we don't really need to get this elements approx length perfect, because no elements come after it, and the endingAlignApprox of the parent won't need this specific is going to be known since it has an explicit length? Maybe this just becomes LengthMultipleOf 1 or 8 depending on length units? This might need some more thought...
##########
daffodil-core/src/main/scala/org/apache/daffodil/unparsers/runtime1/SpecifiedLengthUnparsers.scala:
##########
@@ -72,6 +72,20 @@ final class SpecifiedLengthExplicitImplicitUnparser(
}
}
+final class SpecifiedLengthEndOfParentUnparser(
+ eUnparser: Unparser,
+ erd: ElementRuntimeData
+) extends CombinatorUnparser(erd) {
+
+ override def runtimeDependencies = Vector()
+
+ override def childProcessors = Vector(eUnparser)
+
+ override final def unparse(state: UState): Unit = {
+ eUnparser.unparse1(state)
+ }
+}
Review Comment:
If this unparser doesn't do anything I would suggest we shouldn't even have it and the SpecifiedLengthEndOfParent primitive just wants to return eUnparser. It looks like the pattern parser does something similar, for example.
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Term.scala:
##########
@@ -269,6 +269,26 @@ trait Term
.getOrElse(false)
}
+ final lazy val immediatelyEnclosingElementParent: Option[ElementBase] = {
+ val p = optLexicalParent.flatMap {
+ case e: ElementBase => Some(e)
+ case ge: GlobalElementDecl => Some(ge.asRoot)
+ case s: SequenceTermBase => s.immediatelyEnclosingElementParent
+ case c: ChoiceTermBase => c.immediatelyEnclosingElementParent
Review Comment:
Do we need to return the choice in some cases? It looks like the logic for EOP sometimes cares about the choice so I'm not sure we can bypass this?
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -252,6 +257,134 @@ trait ElementBaseGrammarMixin
}
final lazy val prefixedLengthBody = prefixedLengthElementDecl.parsedValue
+ final lazy val parentEffectiveLengthUnits: LengthUnits =
+ immediatelyEnclosingElementParent match {
+ case Some(parent: ElementBase) => {
+ parent.lengthKind match {
+ case LengthKind.Explicit | LengthKind.Prefixed => parent.lengthUnits
+ case LengthKind.Pattern => LengthUnits.Characters
+ case _
+ if parent.isInstanceOf[ChoiceTermBase] && (parent
+ .asInstanceOf[ChoiceTermBase]
+ .choiceLengthKind == ChoiceLengthKind.Explicit) =>
+ LengthUnits.Bytes
+ case LengthKind.EndOfParent => parent.parentEffectiveLengthUnits
+ case _ =>
+ Assert.invariantFailed(
+ s"Could not figure effective length unit of parents of ${context}"
+ )
+ }
+ }
+ case None if this.isInstanceOf[Root] => LengthUnits.Characters
+ case _ =>
+ Assert.invariantFailed(
+ s"Could not figure effective length unit of parents of ${context}"
+ )
+ }
+ final lazy val checkEndOfParentElem: Unit = {
+ if (lengthKind != LengthKind.EndOfParent) ()
+ else {
+ schemaDefinitionWhen(
+ hasTerminator,
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but specifies a dfdl:terminator.",
+ context
+ )
+ schemaDefinitionWhen(
+ trailingSkip != 0,
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but specifies a non-zero dfdl:trailingSkip.",
+ context
+ )
+ schemaDefinitionWhen(
+ maxOccurs > 1,
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but specifies a maxOccurs greater than 1.",
+ context
+ )
+ schemaDefinitionWhen(
+ nextSibling.isDefined && nextSibling.get.isInstanceOf[ModelGroup],
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but a model group is defined between this element and the end of the enclosing component",
+ context
+ )
+ schemaDefinitionWhen(
+ nextSibling.isDefined && nextSibling.get.isRepresented,
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but a represented element is defined between this element and the end of the enclosing component",
+ context
+ )
+ immediatelyEnclosingElementParent match {
+ case Some(parent: ElementBase) =>
+ parent.lengthKind match {
+ case LengthKind.Implicit | LengthKind.Delimited =>
+ schemaDefinitionError(
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but its parent is an element with dfdl:lengthKind 'implicit' or 'delimited'.",
+ context
+ )
+ case _ => // do nothing
+ }
+ case _ => // do nothing
+ }
+ schemaDefinitionWhen(
+ representation == Representation.Text && knownEncodingWidthInBits != 8 && parentEffectiveLengthUnits != LengthUnits.Characters,
Review Comment:
I did some testing and change the CVS schema to this:
```
<element name="file" dfdl:lengthKind="explicit" dfdl:length="10" dfdl:terminator="%NL;">
<complexType>
<sequence>
<element name="field" type="xs:string" dfdl:lengthKind="endOfParent" />
</sequence>
</complexType>
</element>
```
And a got this stack trace:
```
org.apache.daffodil.lib.exceptions.Abort: Invariant broken: KnownEncodingMixin.this.isKnownEncoding
org.apache.daffodil.lib.exceptions.Assert$.abort(Assert.scala:153)
org.apache.daffodil.runtime1.processors.KnownEncodingMixin.knownEncodingName(EncodingRuntimeData.scala:56)
org.apache.daffodil.runtime1.processors.KnownEncodingMixin.knownEncodingName$(EncodingRuntimeData.scala:46)
org.apache.daffodil.core.dsom.LocalElementDeclBase.knownEncodingName$lzyINIT1(LocalElementDecl.scala:25)
at org.apache.daffodil.lib.exceptions.Assert$.abort(Assert.scala:153)
at org.apache.daffodil.runtime1.processors.KnownEncodingMixin.knownEncodingName(EncodingRuntimeData.scala:56)
at org.apache.daffodil.runtime1.processors.KnownEncodingMixin.knownEncodingName$(EncodingRuntimeData.scala:46)
at org.apache.daffodil.core.dsom.LocalElementDeclBase.knownEncodingName$lzyINIT1(LocalElementDecl.scala:25)
at org.apache.daffodil.core.dsom.LocalElementDeclBase.knownEncodingName(LocalElementDecl.scala:25)
at org.apache.daffodil.runtime1.processors.KnownEncodingMixin.knownEncodingCharset(EncodingRuntimeData.scala:62)
at org.apache.daffodil.runtime1.processors.KnownEncodingMixin.knownEncodingCharset$(EncodingRuntimeData.scala:46)
at org.apache.daffodil.core.dsom.LocalElementDeclBase.knownEncodingCharset$lzyINIT1(LocalElementDecl.scala:25)
at org.apache.daffodil.core.dsom.LocalElementDeclBase.knownEncodingCharset(LocalElementDecl.scala:25)
at org.apache.daffodil.runtime1.processors.KnownEncodingMixin.knownEncodingWidthInBits(EncodingRuntimeData.scala:81)
at org.apache.daffodil.runtime1.processors.KnownEncodingMixin.knownEncodingWidthInBits$(EncodingRuntimeData.scala:46)
at org.apache.daffodil.core.dsom.LocalElementDeclBase.knownEncodingWidthInBits$lzyINIT1(LocalElementDecl.scala:25)
at org.apache.daffodil.core.dsom.LocalElementDeclBase.knownEncodingWidthInBits(LocalElementDecl.scala:25)
at org.apache.daffodil.core.grammar.ElementBaseGrammarMixin.checkEndOfParentElem(ElementBaseGrammarMixin.scala:325)
at org.apache.daffodil.core.grammar.ElementBaseGrammarMixin.checkEndOfParentElem$(ElementBaseGrammarMixin.scala:49)
at org.apache.daffodil.core.dsom.LocalElementDeclBase.checkEndOfParentElem$lzyINIT1(LocalElementDecl.scala:25)
at org.apache.daffodil.core.dsom.LocalElementDeclBase.checkEndOfParentElem(LocalElementDecl.scala:25)
```
I think the issue is that the default encoding used by csv is UTF-8, which seems to cause problems here.
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -252,6 +257,134 @@ trait ElementBaseGrammarMixin
}
final lazy val prefixedLengthBody = prefixedLengthElementDecl.parsedValue
+ final lazy val parentEffectiveLengthUnits: LengthUnits =
+ immediatelyEnclosingElementParent match {
+ case Some(parent: ElementBase) => {
+ parent.lengthKind match {
+ case LengthKind.Explicit | LengthKind.Prefixed => parent.lengthUnits
+ case LengthKind.Pattern => LengthUnits.Characters
+ case _
+ if parent.isInstanceOf[ChoiceTermBase] && (parent
Review Comment:
I think a choice might not necessarily be a direct parent? It's not uncommon for a choice branch to be a sequence (or a nested sequences). I think we need to look up the parent until we find a choice or an element.
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -252,6 +257,134 @@ trait ElementBaseGrammarMixin
}
final lazy val prefixedLengthBody = prefixedLengthElementDecl.parsedValue
+ final lazy val parentEffectiveLengthUnits: LengthUnits =
+ immediatelyEnclosingElementParent match {
+ case Some(parent: ElementBase) => {
+ parent.lengthKind match {
+ case LengthKind.Explicit | LengthKind.Prefixed => parent.lengthUnits
+ case LengthKind.Pattern => LengthUnits.Characters
+ case _
+ if parent.isInstanceOf[ChoiceTermBase] && (parent
+ .asInstanceOf[ChoiceTermBase]
+ .choiceLengthKind == ChoiceLengthKind.Explicit) =>
+ LengthUnits.Bytes
+ case LengthKind.EndOfParent => parent.parentEffectiveLengthUnits
+ case _ =>
+ Assert.invariantFailed(
+ s"Could not figure effective length unit of parents of ${context}"
+ )
+ }
+ }
+ case None if this.isInstanceOf[Root] => LengthUnits.Characters
+ case _ =>
+ Assert.invariantFailed(
+ s"Could not figure effective length unit of parents of ${context}"
+ )
+ }
+ final lazy val checkEndOfParentElem: Unit = {
+ if (lengthKind != LengthKind.EndOfParent) ()
+ else {
+ schemaDefinitionWhen(
+ hasTerminator,
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but specifies a dfdl:terminator.",
+ context
+ )
+ schemaDefinitionWhen(
+ trailingSkip != 0,
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but specifies a non-zero dfdl:trailingSkip.",
+ context
+ )
+ schemaDefinitionWhen(
+ maxOccurs > 1,
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but specifies a maxOccurs greater than 1.",
+ context
+ )
+ schemaDefinitionWhen(
+ nextSibling.isDefined && nextSibling.get.isInstanceOf[ModelGroup],
+ "%s is specified as dfdl:lengthKind=\"endOfParent\", but a model group is defined between this element and the end of the enclosing component",
+ context
+ )
Review Comment:
I think nextSibling is lexical, so I don't think it will detect errors if this is a global element decl that is referenced in a manner where it has siblings? Or maybe the context will be the element reference and the that global decl so it will work? Do we ahve tests forthis?
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -1396,10 +1524,7 @@ trait ElementBaseGrammarMixin
case LengthKind.Implicit
if isSimpleType && impliedRepresentation == Representation.Binary =>
new SpecifiedLengthImplicit(this, body, implicitBinaryLengthInBits)
- case LengthKind.EndOfParent if isComplexType =>
- notYetImplemented("lengthKind='endOfParent' for complex type")
- case LengthKind.EndOfParent =>
- notYetImplemented("lengthKind='endOfParent' for simple type")
+ case LengthKind.EndOfParent => new SpecifiedLengthEndOfParent(this, body)
Review Comment:
I think this is is only needed for complex types? My thinking is that simple types with lengthKind EOP should have parent parser (ether complex or explicity length choice) that already set the bit limit via one of these specified length parsers. So the bit limit has already been set correctly and we don't need another parser to do that.
But this is needed for complex types with EOP since they need to skip any bits up to their parents bit limit that thier children might not have consumed.
So I think this wants to be:
```scala
case LengthKind.EndOfParent if isComplexType => new SpecifiedLengthEndOfParent(this, body)
```
And then `bodyRequiresSpecifiedLength` wants to be modified to make it so it evaluates to false if this is a simple type with lengthKind EOP.
##########
daffodil-test/src/test/resources/org/apache/daffodil/section12/lengthKind/EndOfParentTests.tdml:
##########
@@ -35,64 +35,1965 @@
<!-- END OF PARENT, simplest case -->
<!-- { child,child,child } -->
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:initiator="{{" dfdl:terminator="}">
+ <xs:complexType>
+ <xs:sequence dfdl:separator="," dfdl:separatorPosition="infix">
+ <xs:element name="child" maxOccurs="unbounded"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"
+ dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:initiator="{{" dfdl:terminator="}">
+ <xs:complexType>
+ <xs:sequence dfdl:separator="," dfdl:separatorPosition="infix">
+ <xs:element name="child" type="xs:string" maxOccurs="unbounded"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"
+ dfdl:occursCountKind="parsed" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypesDelimited"
+ root="rootCT" model="parentIsLKDelimited" description="lengthKind is endOfParent">
+ <tdml:document><![CDATA[{{X1.Y1.,X2.Y2.,X3.Y3.}Z]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>Schema Definition Error</tdml:error>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>but its parent</tdml:error>
+ <tdml:error>lengthKind</tdml:error>
+ <tdml:error>delimited</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypesDelimited"
+ root="rootST" model="parentIsLKDelimited" description="lengthKind is endOfParent">
+ <tdml:document><![CDATA[{{X,Y,Z}A]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>Schema Definition Error</tdml:error>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>but its parent</tdml:error>
+ <tdml:error>lengthKind</tdml:error>
+ <tdml:error>delimited</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="parentIsLKImplicit">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="implicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT">
+ <xs:complexType>
+ <xs:sequence dfdl:separator="," dfdl:separatorPosition="infix">
+ <xs:element name="child" maxOccurs="unbounded"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"
+ dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST">
+ <xs:complexType>
+ <xs:sequence dfdl:separator="," dfdl:separatorPosition="infix">
+ <xs:element name="child" type="xs:string" maxOccurs="unbounded"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"
+ dfdl:occursCountKind="parsed" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypesImplicit"
+ root="rootCT" model="parentIsLKImplicit">
+ <tdml:document><![CDATA[X1.Y1.,X2.Y2.,X3.Y3.Z]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>Schema Definition Error</tdml:error>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>but its parent</tdml:error>
+ <tdml:error>lengthKind</tdml:error>
+ <tdml:error>implicit</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypesImplicit"
+ root="rootST" model="parentIsLKImplicit">
+ <tdml:document><![CDATA[X,Y,ZA]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>Schema Definition Error</tdml:error>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>but its parent</tdml:error>
+ <tdml:error>lengthKind</tdml:error>
+ <tdml:error>implicit</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="parentIsLKExplicit">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit" lengthUnits="bytes"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:length="18">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypesExplicit"
+ root="rootCT" model="parentIsLKExplicit">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.A]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootCT>
+ <parentCT>
+ <firstChild>
+ <X>1</X>
+ <Y>1</Y>
+ </firstChild>
+ <rest>
+ <child>
+ <X>2</X>
+ <Y>2</Y>
+ </child>
+ <child>
+ <X>3</X>
+ <Y>3</Y>
+ </child>
+ </rest>
+ </parentCT>
+ <after>A</after>
+ </ex:rootCT>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypesExplicit"
+ root="rootST" model="parentIsLKExplicit">
+ <tdml:document><![CDATA[XYZA]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootST>
+ <parentST>
+ <firstChild>X</firstChild>
+ <rest>YZ</rest>
+ </parentST>
+ <after>A</after>
+ </ex:rootST>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="parentIsLKPrefixed">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
- <xs:element name="parentCT" dfdl:representation="text"
- dfdl:initiator="{{" dfdl:terminator="}">
+ <xs:simpleType name="prefixedType2B" dfdl:length="2">
+ <xs:restriction base="xs:int"/>
+ </xs:simpleType>
+ <xs:simpleType name="prefixedType1B" dfdl:length="1">
+ <xs:restriction base="xs:int"/>
+ </xs:simpleType>
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:lengthKind="prefixed" dfdl:prefixLengthType="prefixedType2B" dfdl:prefixIncludesPrefixLength="no">
<xs:complexType>
- <xs:sequence dfdl:separator="," dfdl:separatorPosition="infix">
- <xs:element name="child" maxOccurs="unbounded"
- dfdl:lengthKind="endOfParent" dfdl:representation="text"
- dfdl:occursCountKind="parsed">
+ <xs:sequence>
+ <xs:element name="firstChild"
+ dfdl:length="6" dfdl:representation="text">
<xs:complexType>
<xs:sequence>
- <xs:element name="X" type="xs:integer"
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
dfdl:initiator="X" dfdl:terminator="." />
- <xs:element name="Y" type="xs:integer"
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
dfdl:initiator="Y" dfdl:terminator="." />
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:lengthKind="prefixed" dfdl:prefixLengthType="prefixedType1B" dfdl:prefixIncludesPrefixLength="no">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypesPrefixed"
+ root="rootCT" model="parentIsLKPrefixed">
+ <tdml:document><![CDATA[18X1.Y1.X2.Y2.X3.Y3.A]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootCT>
+ <parentCT>
+ <firstChild>
+ <X>1</X>
+ <Y>1</Y>
+ </firstChild>
+ <rest>
+ <child>
+ <X>2</X>
+ <Y>2</Y>
+ </child>
+ <child>
+ <X>3</X>
+ <Y>3</Y>
+ </child>
+ </rest>
+ </parentCT>
+ <after>A</after>
+ </ex:rootCT>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypesPrefixed"
+ root="rootST" model="parentIsLKPrefixed">
+ <tdml:document><![CDATA[3XYZA]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootST>
+ <parentST>
+ <firstChild>X</firstChild>
+ <rest>YZ</rest>
+ </parentST>
+ <after>A</after>
+ </ex:rootST>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="parentIsLKPattern">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="pattern"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:lengthPattern="[^\r\n]{18}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:lengthPattern="[^\r\n]{3}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypesPattern"
+ root="rootCT" model="parentIsLKPattern">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.A]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootCT>
+ <parentCT>
+ <firstChild>
+ <X>1</X>
+ <Y>1</Y>
+ </firstChild>
+ <rest>
+ <child>
+ <X>2</X>
+ <Y>2</Y>
+ </child>
+ <child>
+ <X>3</X>
+ <Y>3</Y>
+ </child>
+ </rest>
+ </parentCT>
+ <after>A</after>
+ </ex:rootCT>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypesPattern"
+ root="rootST" model="parentIsLKPattern">
+ <tdml:document><![CDATA[XYZA]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootST>
+ <parentST>
+ <firstChild>X</firstChild>
+ <rest>YZ</rest>
+ </parentST>
+ <after>A</after>
+ </ex:rootST>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="parentIsLKEOP">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="endOfParent"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="explicit" dfdl:length="18">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="explicit" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypesEOP"
+ root="rootCT" model="parentIsLKEOP">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootCT>
+ <parentCT>
+ <firstChild>
+ <X>1</X>
+ <Y>1</Y>
+ </firstChild>
+ <rest>
+ <child>
+ <X>2</X>
+ <Y>2</Y>
+ </child>
+ <child>
+ <X>3</X>
+ <Y>3</Y>
+ </child>
+ </rest>
+ </parentCT>
+ </ex:rootCT>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypesEOP"
+ root="rootST" model="parentIsLKEOP">
+ <tdml:document><![CDATA[XYZ]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootST>
+ <parentST>
+ <firstChild>X</firstChild>
+ <rest>YZ</rest>
+ </parentST>
+ </ex:rootST>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="hasNextSiblingST">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="pattern"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:lengthPattern="[^\r\n]{18}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:lengthPattern="[^\r\n]{3}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ <xs:element name="after" type="xs:string" dfdl:lengthKind="explicit" dfdl:length="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes1"
+ root="rootCT" model="hasNextSiblingST">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.A]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>represented element</tdml:error>
+ <tdml:error>between this element and</tdml:error>
+ <tdml:error>end of the enclosing component</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes1"
+ root="rootST" model="hasNextSiblingST">
+ <tdml:document><![CDATA[XYZA]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>represented element</tdml:error>
+ <tdml:error>between this element and</tdml:error>
+ <tdml:error>end of the enclosing component</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="hasNextSiblingMG">
- <xs:element name="parentST" dfdl:representation="text"
- dfdl:initiator="{{" dfdl:terminator="}">
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="pattern"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
<xs:complexType>
- <xs:sequence dfdl:separator="," dfdl:separatorPosition="infix">
- <xs:element name="child" type="xs:string" maxOccurs="unbounded"
- dfdl:lengthKind="endOfParent" dfdl:representation="text"
- dfdl:occursCountKind="parsed" />
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:lengthPattern="[^\r\n]{18}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:sequence/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:lengthPattern="[^\r\n]{3}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ <xs:sequence/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
</tdml:defineSchema>
- <tdml:parserTestCase name="TestEndOfParentNYIComplexTypes"
- root="parentCT" model="endOfParent-Embedded.dfdl.xsd" description="lengthKind is endOfParent">
- <tdml:document><![CDATA[{X1.Y1.,X2.Y2.,X3.Y3.}]]></tdml:document>
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes2"
+ root="rootCT" model="hasNextSiblingMG">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.A]]></tdml:document>
<tdml:errors>
- <tdml:error>Schema Definition Error</tdml:error>
- <tdml:error>not</tdml:error>
- <tdml:error>implemented</tdml:error>
<tdml:error>endOfParent</tdml:error>
- <tdml:error>complex</tdml:error>
- <tdml:error>type</tdml:error>
+ <tdml:error>model group</tdml:error>
+ <tdml:error>between this element and</tdml:error>
+ <tdml:error>end of the enclosing component</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
- <tdml:parserTestCase name="TestEndOfParentNYISimpleTypes"
- root="parentST" model="endOfParent-Embedded.dfdl.xsd" description="lengthKind is endOfParent">
- <tdml:document><![CDATA[{X,Y,Z}]]></tdml:document>
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes2"
+ root="rootST" model="hasNextSiblingMG">
+ <tdml:document><![CDATA[XYZA]]></tdml:document>
<tdml:errors>
- <tdml:error>Schema Definition Error</tdml:error>
- <tdml:error>not</tdml:error>
- <tdml:error>implemented</tdml:error>
<tdml:error>endOfParent</tdml:error>
- <tdml:error>simple</tdml:error>
- <tdml:error>type</tdml:error>
+ <tdml:error>model group</tdml:error>
+ <tdml:error>between this element and</tdml:error>
+ <tdml:error>end of the enclosing component</tdml:error>
</tdml:errors>
</tdml:parserTestCase>
+ <tdml:defineSchema name="hasNextSiblingIVC">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="pattern"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:lengthPattern="[^\r\n]{18}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="after" type="xs:string" dfdl:inputValueCalc="{'A'}"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:lengthPattern="[^\r\n]{3}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ <xs:element name="after" type="xs:string" dfdl:inputValueCalc="{'A'}"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes3"
+ root="rootCT" model="hasNextSiblingIVC">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootCT>
+ <parentCT>
+ <firstChild>
+ <X>1</X>
+ <Y>1</Y>
+ </firstChild>
+ <rest>
+ <child>
+ <X>2</X>
+ <Y>2</Y>
+ </child>
+ <child>
+ <X>3</X>
+ <Y>3</Y>
+ </child>
+ </rest>
+ <after>A</after>
+ </parentCT>
+ </ex:rootCT>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes3"
+ root="rootST" model="hasNextSiblingIVC">
+ <tdml:document><![CDATA[XYZ]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootST>
+ <parentST>
+ <firstChild>X</firstChild>
+ <rest>YZ</rest>
+ <after>A</after>
+ </parentST>
+ </ex:rootST>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+ <tdml:defineSchema name="hasTerminator">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="pattern"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:lengthPattern="[^\r\n]{18}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text" dfdl:terminator="}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:lengthPattern="[^\r\n]{3}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string" dfdl:terminator="}"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes4"
+ root="rootCT" model="hasTerminator">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>specifies</tdml:error>
+ <tdml:error>terminator</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes4"
+ root="rootST" model="hasTerminator">
+ <tdml:document><![CDATA[XYZ]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>specifies</tdml:error>
+ <tdml:error>terminator</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+<tdml:defineSchema name="hasNonZeroTrailingSkip">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="pattern"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:lengthPattern="[^\r\n]{18}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text" dfdl:trailingSkip="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:lengthPattern="[^\r\n]{3}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string" dfdl:trailingSkip="1"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes5"
+ root="rootCT" model="hasNonZeroTrailingSkip">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>specifies</tdml:error>
+ <tdml:error>non-zero</tdml:error>
+ <tdml:error>trailingSkip</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes5"
+ root="rootST" model="hasNonZeroTrailingSkip">
+ <tdml:document><![CDATA[XYZ]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>specifies</tdml:error>
+ <tdml:error>non-zero</tdml:error>
+ <tdml:error>trailingSkip</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+<tdml:defineSchema name="hasMaxOccursGreaterThanOne">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="pattern"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:lengthPattern="[^\r\n]{18}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text" maxOccurs="2">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:lengthPattern="[^\r\n]{3}">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string" maxOccurs="2"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes6"
+ root="rootCT" model="hasMaxOccursGreaterThanOne">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>specifies</tdml:error>
+ <tdml:error>maxOccurs</tdml:error>
+ <tdml:error>greater than 1</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes6"
+ root="rootST" model="hasMaxOccursGreaterThanOne">
+ <tdml:document><![CDATA[XYZ]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>specifies</tdml:error>
+ <tdml:error>maxOccurs</tdml:error>
+ <tdml:error>greater than 1</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="hasNonSingleByteEncoding">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:length="18">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text" dfdl:encoding="UTF-16">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string" dfdl:encoding="UTF-16"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes7"
+ root="rootCT" model="hasNonSingleByteEncoding">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>does not have</tdml:error>
+ <tdml:error>single-byte character set encoding</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes7"
+ root="rootST" model="hasNonSingleByteEncoding">
+ <tdml:document><![CDATA[XYZ]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>does not have</tdml:error>
+ <tdml:error>single-byte character set encoding</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="inSequenceWithPostfixSeparator">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:length="18">
+ <xs:complexType>
+ <xs:sequence dfdl:separator="," dfdl:separatorPosition="postfix">
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence dfdl:separator="," dfdl:separatorPosition="postfix">
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes8"
+ root="rootCT" model="inSequenceWithPostfixSeparator">
+ <tdml:document><![CDATA[X1.Y1.,X2.Y2.,X3.Y3.,]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a sequence with</tdml:error>
+ <tdml:error>separatorPosition</tdml:error>
+ <tdml:error>postfix</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes8"
+ root="rootST" model="inSequenceWithPostfixSeparator">
+ <tdml:document><![CDATA[X,Y,Z]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a sequence with</tdml:error>
+ <tdml:error>separatorPosition</tdml:error>
+ <tdml:error>postfix</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="inUnorderedSequence">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:length="18">
+ <xs:complexType>
+ <xs:sequence dfdl:sequenceKind="unordered">
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence dfdl:sequenceKind="unordered">
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes9"
+ root="rootCT" model="inUnorderedSequence">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a sequence with</tdml:error>
+ <tdml:error>sequenceKind</tdml:error>
+ <tdml:error>unordered</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes9"
+ root="rootST" model="inUnorderedSequence">
+ <tdml:document><![CDATA[XYZ]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a sequence with</tdml:error>
+ <tdml:error>sequenceKind</tdml:error>
+ <tdml:error>unordered</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="hasFloatingSiblings">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:length="18">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:floating="yes"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:floating="yes"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes10"
+ root="rootCT" model="hasFloatingSiblings">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a sequence with</tdml:error>
+ <tdml:error>elements</tdml:error>
+ <tdml:error>floating='yes</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes10"
+ root="rootST" model="hasFloatingSiblings">
+ <tdml:document><![CDATA[XYZ]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a sequence with</tdml:error>
+ <tdml:error>elements</tdml:error>
+ <tdml:error>floating='yes</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+
+ <tdml:defineSchema name="inSequenceWithNonZeroTrailingSkip">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:length="18">
+ <xs:complexType>
+ <xs:sequence dfdl:trailingSkip="1">
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence dfdl:trailingSkip="1">
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes11"
+ root="rootCT" model="inSequenceWithNonZeroTrailingSkip">
+ <tdml:document><![CDATA[X1.Y1.X2.Y2.X3.Y3.]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a sequence with</tdml:error>
+ <tdml:error>non-zero</tdml:error>
+ <tdml:error>trailingSkip</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes11"
+ root="rootST" model="inSequenceWithNonZeroTrailingSkip">
+ <tdml:document><![CDATA[XYZ]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a sequence with</tdml:error>
+ <tdml:error>non-zero</tdml:error>
+ <tdml:error>trailingSkip</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="inChoiceWithNonZeroTrailingSkip">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:length="6">
+ <xs:complexType>
+ <xs:choice dfdl:trailingSkip="1">
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="1">
+ <xs:complexType>
+ <xs:choice dfdl:trailingSkip="1">
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes12"
+ root="rootCT" model="inChoiceWithNonZeroTrailingSkip">
+ <tdml:document><![CDATA[X1.Y1.]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a choice with</tdml:error>
+ <tdml:error>non-zero</tdml:error>
+ <tdml:error>trailingSkip</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes12"
+ root="rootST" model="inChoiceWithNonZeroTrailingSkip">
+ <tdml:document><![CDATA[X]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a choice with</tdml:error>
+ <tdml:error>non-zero</tdml:error>
+ <tdml:error>trailingSkip</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="inChoiceWithTerminator">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootCT" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentCT" dfdl:length="6">
+ <xs:complexType>
+ <xs:choice dfdl:terminator="}">
+ <xs:element name="firstChild" dfdl:lengthKind="explicit"
+ dfdl:length="6" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="rest"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="child" dfdl:lengthKind="implicit" maxOccurs="unbounded" dfdl:occursCountKind="parsed">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="X" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="X" dfdl:terminator="." />
+ <xs:element name="Y" type="xs:integer" dfdl:lengthKind="delimited"
+ dfdl:initiator="Y" dfdl:terminator="." />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="1">
+ <xs:complexType>
+ <xs:choice dfdl:terminator="}">
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentComplexTypes13"
+ root="rootCT" model="inChoiceWithTerminator">
+ <tdml:document><![CDATA[X1.Y1.]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a choice with</tdml:error>
+ <tdml:error>terminator</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes13"
+ root="rootST" model="inChoiceWithTerminator">
+ <tdml:document><![CDATA[X]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>in a choice with</tdml:error>
+ <tdml:error>terminator</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="STChecks">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootST1" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:int"
+ dfdl:lengthKind="endOfParent" dfdl:representation="binary"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST2" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:int"
+ dfdl:lengthKind="endOfParent" dfdl:representation="binary"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes14"
+ root="rootST1" model="STChecks">
+ <tdml:document><![CDATA[X12]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>simple type</tdml:error>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>isn't a string type</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes15"
+ root="rootST2" model="STChecks">
+ <tdml:document><![CDATA[X12]]></tdml:document>
+ <tdml:errors>
+ <tdml:error>simple type</tdml:error>
+ <tdml:error>endOfParent</tdml:error>
+ <tdml:error>doesn't have binary representation with packed decimal representation</tdml:error>
+ </tdml:errors>
+ </tdml:parserTestCase>
+
+ <tdml:defineSchema name="hexBinary_StringEOP">
+
+ <xs:include schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+ <dfdl:format ref="ex:GeneralFormat" lengthKind="explicit"
+ separator="" leadingSkip='0' encoding="US-ASCII" ignoreCase='no'
+ initiator="" terminator="" initiatedContent="no" textNumberRep="standard"
+ separatorSuppressionPolicy="anyEmpty" separatorPosition="infix"
+ documentFinalTerminatorCanBeMissing='yes' byteOrder="bigEndian"
+ binaryNumberRep='binary' />
+
+ <xs:element name="rootST1" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:hexBinary"
+ dfdl:lengthKind="endOfParent" dfdl:representation="binary"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="rootST2" dfdl:representation="text" dfdl:lengthKind="implicit">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="parentST" dfdl:length="3">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="firstChild" type="xs:string" dfdl:lengthKind="explicit"
+ dfdl:length="1" dfdl:representation="text"/>
+ <xs:element name="rest" type="xs:string"
+ dfdl:lengthKind="endOfParent" dfdl:representation="text"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </tdml:defineSchema>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes16"
+ root="rootST1" model="hexBinary_StringEOP">
+ <tdml:document><![CDATA[X12]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootST1>
+ <parentST>
+ <firstChild>X</firstChild>
+ <rest>3132</rest>
+ </parentST>
+ </ex:rootST1>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
+ <tdml:parserTestCase name="TestEndOfParentSimpleTypes17"
+ root="rootST2" model="hexBinary_StringEOP">
+ <tdml:document><![CDATA[X12]]></tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <ex:rootST2>
+ <parentST>
+ <firstChild>X</firstChild>
+ <rest>12</rest>
+ </parentST>
+ </ex:rootST2>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+ </tdml:parserTestCase>
+
Review Comment:
Some lines from the spec that I'm not sure I saw tests for:
> The dfdl:lengthKind 'endOfParent' can also be used on the document root to allow the last element to consume the data up to the end of the data stream.
I assume this means something like:
```xml
<element name="root" dfdl:lengthKind="endOfParent">
<complexType>
<sequence>
<element name="field1" ... />
<element name="rest" dfdl:lenghtKind="endOfParent" ... />
</sequence>
</complexType>
</element>
```
So rest should contain everything up until the end of the data. That doesn't really work will with the assuming that we'll always have a bit limit, since the root element won't every set bitLimit in this case.
> A simple element must have one of [...] dfdl:representation 'binary' and a packed decimal representation
I don't think there are any tests for packed binary formats, and it looks like there aren't any modifications to the code to support packed types
> A simple element must have one of [...] dfdl:representation 'text'
I think this implies that you can have simple types with bool/numbers/dates/times/etc as long as representation is text. I *think* these should all work because they just add a converter to a specified length string parser, but we should have tests for them.
> The dfdl:lengthKind 'endOfParent' means that the element is terminated [...] or the end of an enclosing choice with dfdl:choiceLengthKind ‘explicit’.
choiceLengthKind="explicit" isn't used very often, but we should probably have a couple tests to make sure this works with EOP children.
--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org