mbeckerle commented on code in PR #1137:
URL: https://github.com/apache/daffodil/pull/1137#discussion_r1462394418


##########
daffodil-test/src/test/resources/org/apache/daffodil/section23/dfdl_functions/Functions.tdml:
##########
@@ -5150,6 +5147,51 @@
       </xs:complexType>
     </xs:element>
 
+    <xs:element name="count07">
+      <xs:complexType>
+        <xs:sequence>
+          <xs:element name="int" type="xs:int" minOccurs="2" maxOccurs="2" 
dfdl:representation="binary" />
+          <xs:element name="count" type="xs:int" dfdl:representation="binary" 
dfdl:inputValueCalc="{ fn:count(../ex:int) }" />
+        </xs:sequence>
+      </xs:complexType>
+    </xs:element>
+
+    <xs:element name="count08">
+      <xs:complexType>
+        <xs:sequence>
+          <xs:element name="int" type="xs:int" dfdl:representation="binary" />
+          <xs:element name="count" type="xs:int" dfdl:representation="binary" 
dfdl:inputValueCalc="{ fn:count(../ex:int) }" />
+        </xs:sequence>
+      </xs:complexType>
+    </xs:element>
+
+    <xs:element name="count09">
+      <xs:complexType>
+        <xs:sequence>
+          <xs:element name="int" type="xs:int" minOccurs="0" maxOccurs="1" 
dfdl:representation="binary" />
+          <xs:element name="count" type="xs:int" dfdl:representation="binary" 
dfdl:inputValueCalc="{ fn:count(../ex:int) }" />
+        </xs:sequence>
+      </xs:complexType>
+    </xs:element>
+
+    <xs:element name="count10">
+      <xs:complexType>
+        <xs:sequence>
+          <xs:element name="int" type="xs:int" dfdl:representation="binary" />
+          <xs:element name="count" type="xs:int" dfdl:representation="binary" 
dfdl:outputValueCalc="{ fn:count(../ex:int) }" />
+        </xs:sequence>
+      </xs:complexType>
+    </xs:element>
+
+    <xs:element name="count11">
+      <xs:complexType>
+        <xs:sequence>
+          <xs:element name="int" type="xs:int" dfdl:representation="binary" />
+          <xs:element name="count" type="xs:int" dfdl:representation="binary" 
dfdl:occursCountKind="expression" dfdl:occursCount="{ fn:count(../ex:int) }" />
+        </xs:sequence>
+      </xs:complexType>
+    </xs:element>

Review Comment:
   Yes, we should have 3 tests that combine each pair from the choices of 
scalar, optional, and array. 
   
   A group with an upward path that escapes the group like 
   ```
   <group name="g">
      <sequence>
         <element name="e" type="xs:int" dfdl:inputValueCalc="{ ../foo }"/>
      </sequence>
   </group>
   ```
   then use that group in situations where foo is scalar in one context, 
optional in the other, optional in one, array in the other, and scalar in one, 
array in the other. Would catch the analogous problem for the ambiguous upward 
path situation. Like
   ```
       ... 
       <element name="scalarOptional">
           <complexType><sequence>
                   <element name="scalar">
                        <complexType><sequence>
                             <element name="foo" type="xs:int"/><!-- scalar -->
                             <group ref="g"/>
                        </sequence></complexType></element>
                   <element name="optional">
                        <complexType><sequence>
                             <element name="foo" type="xs:int" 
minOccurs="0"/><!-- optional -->
                             <group ref="g"/>
                        </sequence></complexType></element>
           </complexType></sequence>
      </element>
   ```
   and similar for scalarArray and optionalArray. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to