Consider the following schema:

    <dfdl:defineEscapeScheme name="scenario3">
      <dfdl:escapeScheme escapeCharacter='/'
        escapeKind="escapeCharacter" escapeEscapeCharacter="$" 
extraEscapedCharacters="" generateEscapeBlock="whenNeeded" />
    </dfdl:defineEscapeScheme>

    <xs:element name="e_infix">
      <xs:complexType>
        <xs:sequence dfdl:separator="/;" dfdl:separatorPosition="infix">
          <xs:element name="x" type="xs:string" 
dfdl:escapeSchemeRef="tns:scenario3" />
          <xs:element name="y" type="xs:string" minOccurs="0" 
dfdl:escapeSchemeRef="tns:scenario3" />
        </xs:sequence>
      </xs:complexType>
    </xs:element>

We then have the following test case:
  <parserTestCase name="scenario3_3" model="es3"
    description="Section 13 - escapeCharacter - DFDL-13-029R" root="e_infix" 
roundTrip="true">
    <!-- See DFDL-1556 for to make roundTrip="true" -->
    <document>foo$$/;bar</document>
    <infoset>
      <dfdlInfoset>
        <tns:e_infix>
          <x>foo$/;bar</x>
        </tns:e_infix>
      </dfdlInfoset>
    </infoset>
  </parserTestCase>

Shouldn't this parse as:
<tns:e_infix>
  <x>foo$$</x>
  <y>bar</y>
</tns:e_infix>

The spec says the following:
On parsing any in-scope terminating delimiter encountered in the data
is not interpreted as such when it is immediately preceded by the
dfdl:escapeCharacter (when not itself preceded by the
dfdl:escapeEscapeCharacter). Occurrences of the
dfdl:escapeCharacter and dfdl:escapeEscapeCharacter are removed
from the data, unless the dfdl:escapeCharacter is preceded by the
dfdl:escapeEscapeCharacter, or the dfdl:escapeEscapeCharacter
does not precede the dfdl:escapeCharacter.

It seems to me that the '/;' terminator shouldn't be getting escaped in this 
case, but want to double check.

Josh


Reply via email to