stevedlawrence commented on a change in pull request #143: Support 
dfdl:length="prefixed"
URL: https://github.com/apache/incubator-daffodil/pull/143#discussion_r239908134
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/grammar/AlignedMixin.scala
 ##########
 @@ -125,8 +126,8 @@ trait AlignedMixin extends GrammarMixin { self: Term =>
   }
 
   private lazy val priorAlignmentApprox: AlignmentMultipleOf = {
-    if (this.isInstanceOf[Root]) {
-      AlignmentMultipleOf(0) // root is aligned with anything
+    if (this.isInstanceOf[Root] || this.isInstanceOf[DetachedElementDecl]) {
+      AlignmentMultipleOf(0) // root and detached elements are aligned with 
anything
 
 Review comment:
   I'll add a test to make sure that works (I think it should). The spec does 
say:
   
   > It is a schema definition error if the xs:simpleType [referenced by 
prefixLengthType] specifies any of:
   >
   > ...
   > dfdl:alignment other than '1
   > ...
   
   So I think the alignment/Units properties needs to be put on the element, 
but the skipped bits should occur before the prefix length element is parsed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to