Unverified Commit 545acef5 authored by Kristin's avatar Kristin Committed by GitHub
Browse files

Merge pull request #89 from SgStapleton/kristin

Updated XmlToPvlTranslationManager. Fixes 5332
parents 721a08e6 32405bc8
Loading
Loading
Loading
Loading
+38 −18
Original line number Diff line number Diff line
@@ -240,9 +240,34 @@ 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++) {
      QString childName = inputPosition[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) {
@@ -254,17 +279,12 @@ namespace Isis {
      }
      else {
        QString msg = "Failed traversing input position. [" +
                        inputParentElement.parentNode().toElement().tagName() +
                        "] element does not have a child element named [" +
          inputPosition.name() + "] element does not have a child element named [" +
          childName + "].";
        throw IException(IException::Unknown, msg, _FILEINFO_);
      }
    }
      if (isDebug) {
        indent += "  ";
        cout << indent << inputParentElement.tagName() << endl;
      }
    }

    QDomElement inputKeyElement = inputParentElement.firstChildElement(inputKey);
    if (isDebug) {
      indent += "  ";
+2 −0
Original line number Diff line number Diff line
@@ -123,6 +123,8 @@ namespace Isis {
   *  @history 2017-01-18 Jesse Mapel - Updated documentation and error messages. Fixes #4584.
   *  @history 2017-01-25 Jesse Mapel - Created unit test. Fixes #4584.
   *  @history 2017-05-26 Makayla Shepherd - Renamed XmlToPvlTranslationManager.
   *  @history 2018-02-15 Kristin Berry and Summer Stapleton - Updated translate() method to search
   *                          for multiple values for InputPosition keyword. Fixes #5332
   */
  class XmlToPvlTranslationManager : public LabelTranslationManager {
    public: