Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-248

Data dictionary does not parse header repeating groups correctly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.3.1
    • Component/s: Metadata/Specs
    • Labels:
      None
    • Environment:
      winXP SP2, JDK1.5.0.12, Eclipse 3.3

      Description

      In QFJ_1.2.1, I can't use the repeating group "NoHops"and the fiels 628,629,630. I only can use field 627.

      Because repeating group "NoHops" is the only group at messageHeader, so in many places, we may ignore it! For example, at DataDictionary.java,

      private void load(InputStream inputStream) throws ConfigError {
      .......

      // HEADER
      NodeList headerNode = documentElement.getElementsByTagName("header");
      if (headerNode.getLength() == 0)

      { throw new ConfigError("<header> section not found in data dictionary"); }

      NodeList headerFieldNodes = headerNode.item(0).getChildNodes();
      if (headerFieldNodes.getLength() == 0)

      { throw new ConfigError("No header fields defined"); }

      for (int i = 0; i < headerFieldNodes.getLength(); i++) {
      Node headerFieldNode = headerFieldNodes.item;
      String nodeName = headerFieldNode.getNodeName();
      if (nodeName.equals("field") || nodeName.equals("group")) {
      String name = getAttribute(headerFieldNode, "name");
      if (name == null)

      { throw new ConfigError("<" + nodeName + "> does not have a name attribute"); }

      String required = getAttribute(headerFieldNode, "required", NO);
      if (required == null)

      { throw new ConfigError("<" + headerFieldNode.getNodeName() + "> does not have a 'required' attribute"); }

      addHeaderField(lookupXMLFieldNumber(document, name), required.equalsIgnoreCase("Y"));
      }
      ........
      }

      It only load <group name="NoHops" required="N"> from fix44.xml, but can't load <field name="HopCompID" required="N"/>Unable to render embedded object: File ("<field name="HopSendingTime" required="N"/>) not found."<field name="HopRefID" required="N"/> which are in the group.

      So, maybe, we should add:

      if (nodeName.equals("group")) {
      String required = getAttribute(headerFieldNode, "required");
      if (required == null)

      { throw new ConfigError("<group> does not have a 'required' attribute"); }

      addHeaderXMLGroup(document, headerFieldNode, this, required
      .equalsIgnoreCase("Y"));
      }
      }

      there, I used a new function:addHeaderXMLGroup(),coming from addXMLGroup().

      This question may relate to addXMLComponentFields(), addXMLGroup(), addGroup(), isGroup(), getGroup(), checkGroupCount(), iterate() at DataDictionary.java; and parseGroup(), parseHeader() at Message.java; where ignore the only group at messageHeader, "NoHops".

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              caiqi CaiQi
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: