Commit 3ff8728f authored by Summer Stapleton's avatar Summer Stapleton
Browse files

Revert "Updated XmlToPvlTranslationManager to search for multiple...

Revert "Updated XmlToPvlTranslationManager to search for multiple InputPosition keywords before failing"

This reverts commit 15b4c7c3.
parent 6b6609da
Loading
Loading
Loading
Loading
+4 −50
Original line number Diff line number Diff line
@@ -240,52 +240,7 @@ namespace Isis {
      cout << endl << "Finding input element:" << endl << endl;
      cout << inputParentElement.tagName() << endl;
    }

    Pvl::ConstPvlKeywordIterator it = transGroup.findKeyword("InputPosition",
                                      transGroup.begin(),
                                      transGroup.end());

    QDomElement oldInputParentElement = inputParentElement;
    QString childName;
    while(it != transGroup.end()) {
      const PvlKeyword &inputPosition = *it;
      inputParentElement = oldInputParentElement; 

    for (int i = 0; i < inputPosition.size(); i++) {
          childName = inputPosition[i];
          inputParentElement = inputParentElement.firstChildElement(childName);
          if(inputParentElement.isNull()) {
            break;
          }
          if (isDebug) {
            indent += "  ";
            cout << indent << inputParentElement.tagName() << endl;
          }
        }
        if (!inputParentElement.isNull()) {
          break;
        }
        it = transGroup.findKeyword("InputPosition", it + 1, transGroup.end()); 
    }
     
    if (inputParentElement.isNull()) {
      if (hasInputDefault(outputName)) {
        if (isDebug) {
          cout << endl << "Could not traverse input position, " <<
            "using default value: " <<
            InputDefault(outputName) << endl;
        }
        return PvlTranslationTable::Translate( outputName );
      }
      else {
        QString msg = "Failed traversing input position. [" +
          inputPosition.name() + "] element does not have a child element named [" +
          childName + "].";
        throw IException(IException::Unknown, msg, _FILEINFO_);
      }
    }
  
/*    for (int i = 0; i < inputPosition. csize(); i++) {
      QString childName = inputPosition[i];
      inputParentElement = inputParentElement.firstChildElement(childName);
      if(inputParentElement.isNull()) {
@@ -299,7 +254,8 @@ namespace Isis {
        }
        else {
          QString msg = "Failed traversing input position. [" +
                        inputPosition.name() + "] element does not have a child element named [" +
                        inputParentElement.parentNode().toElement().tagName() +
                        "] element does not have a child element named [" +
                        childName + "].";
          throw IException(IException::Unknown, msg, _FILEINFO_);
        }
@@ -308,9 +264,7 @@ namespace Isis {
        indent += "  ";
        cout << indent << inputParentElement.tagName() << endl;
      }
    }*/


    }
    QDomElement inputKeyElement = inputParentElement.firstChildElement(inputKey);
    if (isDebug) {
      indent += "  ";