Mike, isn’t this an example of a hidden optional element:

<xs:sequence dfdl:hiddenGroupRef="hidden-newline" />
…
<xs:group name="hidden-newline">
    <xs:sequence>
        <xs:element name="EOL" type="xs:string" minOccurs="0"
            dfdl:initiator="%NL;"  dfdl:lengthKind="explicit" dfdl:length="0" />
    </xs:sequence>
</xs:group>


From: Mike Beckerle <[email protected]>
Sent: Tuesday, October 10, 2023 2:55 PM
To: [email protected]
Subject: Re: Can optional elements be hidden?

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

Reply via email to