Nope. You can't have hidden optional elements. It makes no sense. They're hidden, so they do not exist at the time you start unparsing.
Since they are optional there's nothing to make them come into existence when unparsing. On Mon, Oct 9, 2023, 10:50 AM Roger L Costello <coste...@mitre.org> wrote: > <xs:sequence dfdl:hiddenGroupRef="hideH" /> > ... > <xs:group name="hideH"> > <xs:sequence> > <xs:element name="h" > dfdl:length="1" > dfdl:lengthKind="explicit" > type="xs:string" > dfdl:outputValueCalc="{'H'}" > minOccurs="0"/> > </xs:sequence> > </xs:group> > > Results in this error: dfdl:outputValueCalc cannot be defined on optional > elements. > > Is there a way to hide optional elements? >