DFDL Parsing for x9.2 specification message

143 views Asked by At

Hi I have a requirement which is like: There is x9.2 specification message e.g.

Header format for 97xx message

Data Item     Field Name     Attribute
006           MSG.TYPE       4 N
001           MSG.FROM       6 CHR
015           MSG.REPLY      1 CHR
017          MSG.TRACE       6 N
002           MSG.DATE       8 N
003           MSG.TIME       4 N
004           MSG.SESSION    6 N
009           MSG.MEMBER     11 N
018           MSG.RECORD     7 N

9701 ACCESS AUTHORIZATION REQUEST
STANDARD HEADER
Data Item     Field Name     Attribute
133           MSG.HBAC       8 N
230           MSG.DISCLAIMED 1 CHAR 


I NEED TO CONVERT THIS TO A XML USING DFDL.
Sample XML

    <ROOT>
    <Header>
    <MSG.TYPE></MSG.TYPE>
    .
    .
    .
    .
    <MSG.RECORD></MSG.RECORD>
    </Header>
    <Body>
    <MSG.HBAC></MSG.HBAC>
    <MSG.DISCLAIMED></MSG.DISCLAIMED>
    </Body>
    </ROOT>

The problem now is that x9.2 specification messages can have different fields for different message type like above is example for 9701.

But 9702 will have different set of data item. So how to write a dfdl parser which can parse all the message type whether its 97xx series or 95xx series or any other series of x9.2 specification.

1

There are 1 answers

1
Steve Parsons On

I have never worked with this specific format. But a DFDL model accommodates the possibility of different message types with choices (points of uncertainty) and uses either discriminators or initiators to resolve the choices. Begin by reading this link for background. Then go here and get the PDF for Lab 6.