stevedlawrence commented on PR #1085:
URL: https://github.com/apache/daffodil/pull/1085#issuecomment-1721244936
> There's one code-cov failure I saw where it would I think be of value to
add a test to cover.
I think the only way to trigger this code is if an element with
dfdlx:repType is defined is in a hidden group while unparsing. However, this
would mean that element also needs a dfdl:outputValueCalc. For example:
```xml
<xs:simpleType name="rep" dfdl:lengthKind="explicit" dfdl:length="1">
<xs:restriction base="xs:byte"/>
</xs:simpleType>
<xs:group name="hiddenField">
<xs:sequence>
<xs:element name="field" dfdlx:repType="tns:rep"
dfdl:outputValueCalc="{ ../ex:visField }">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="one" dfdlx:repValues="1" />
<xs:enumeration value="two" dfdlx:repValues="2" />
<xs:enumeration value="three" dfdlx:repValues="3" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:element name="root1">
<xs:complexType>
<xs:sequence>
<xs:group ref="ex:hiddenField" />
<xs:element name="visField" type="xs:string"
dfdl:inputValueCalc="{ ../ex:field }" />
</xs:sequence>
</xs:complexType>
</xs:element>
```
But so far I haven't been able to get unparsing to work with this. There
seems to be some weird suspension issue where the outputValueCalc expression
can't find the visField element. I'm guessing it has something to do with the
detached quasi element messing with the infoset, but haven't dug much further
so far.
That said, I wonder if it's even worth trying to support dfdlx:repType +
dfdl:ouputValueCalc? A repType inside hidden groups seems unlikely since the
whole point of repTypes it to convert an int to a more human friendly string.
If it's hidden is it worth doing that conversion at all? And for non-hidden
fields, it feels like it would be unlikely to want to calculate the string
value on unparse via OVC.
Maybe it should be an SDE if the two properties are defined together?
--
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]