Menu

Problem parsing xml with extends and composite

Help
2015-07-07
2015-07-07
  • Renato Kosaka Araujo

    Hi!

    I am trying to use an xml configuration like this (I left only the relevant fields for the problem):

    <j8583-config>

    <!-- Base ISO Message -->
    <parse type="000">
        <field num="4" type="AMOUNT" />
    </parse>
    
    <parse type="0200" extends="000">
        <field num="62" type="LLLVAR">
            <field num="4" type="ALPHA" length="13" />
        </field>
    </parse>
    

    </j8583-config>

    And when creating the MessageFactory using this config, it is replacing the field 4 from the Base message with the field 4 that is inside the composite field 62 for message type 0200.

    I think the problem is in the method ConfigParser.parseGuides, when calling the method NodeList fields = elem.getElementsByTagName("field"); (in line 308)

    What I understand is that it gets all fields inside parser, even if the field is inside another field.

     

    Last edit: Renato Kosaka Araujo 2015-07-07
  • Enrique Zamudio Lopez

    Please file the issue on github: github.com/chochos/j8583

    I vaguely remember this and I think it's already been fixed but I'll add some tests to make sure.

     
  • Renato Kosaka Araujo

    Ok, thanks!

    I forgot to mention that I am using version 1.11.0

     

Log in to post a comment.