<choice>
<!-- length kind pattern is needed to bound length to max of 99 -->
<element name="raw1" type="xs:string"
dfdl:lengthKind='pattern'
dfdl:lengthPattern="[^\x7F]{0,99}"
dfdl:terminator="%DEL;"/>
<element name="raw2" type="xs:string"
dfdl:lengthKind="explicit"
dfdl:length="100"/>
</choice>
<element name='value' type='xs:string'
dfdl:inputValueCalc='{ if (fn:exists( ../raw1 ) then ../raw1 else ../raw2 }'/>
SMH: There is no way to make a choice branch fail when unparsing. (The only 'backtracking' when unparsing a choice is when the infoset contains no branch at all then the spec states that each branch is examined in turn until one is found that successfully applies defaults. But that's not really backtracking, as you can statically deduce the branch from the schema alone, so the 'default' branch to use can be computed up front).