Hello DFDL community,

My input looks like this:

[cid:[email protected]]

One way to characterize the input is this:


  *   Rows are separated by exactly one newline.
  *   Within a row, there is a label and message, separated by a colon.
  *   The message is a string padded by zero or more whitespace characters 
(newlines, spaces).

I tried this DFDL schema:

<xs:element name="label-message">
    <xs:complexType>
        <xs:sequence dfdl:separator="%NL;" dfdl:separatorPosition="infix">
            <xs:element name="row" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence dfdl:separator=":" 
dfdl:separatorPosition="infix">
                        <xs:element name="label" type="xs:string" />
                        <xs:element name="message" type="xs:string"
                            dfdl:lengthKind="pattern"
                            
dfdl:lengthPattern="[\x20-\x7F]+?(?=(\x0D\x0A|\x0A)([\x20-\x7F]|$))"
                            dfdl:representation="text"
                            dfdl:encoding="ASCII"
                            dfdl:textTrimKind="padChar"
                            dfdl:textStringPadCharacter="%WSP;"
                            dfdl:textStringJustification="left"
                            dfdl:terminator="%NUL;"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:element>

Running that I discovered that %WSP; can't be a padding character because it's 
not a single character.

Is there a way to express this characterization in DFDL?

Note: I know that there are other ways to characterize the input, but I want to 
see if it's possible to express this characterization in DFDL.

/Roger


Reply via email to