bool ossimLocalTm::loadXml(ossimRefPtr<ossimXmlNode> dateNode) { bool result = true; ossimRefPtr<ossimXmlNode> month = dateNode->findFirstNode("month"); ossimRefPtr<ossimXmlNode> day = dateNode->findFirstNode("day"); ossimRefPtr<ossimXmlNode> year = dateNode->findFirstNode("year"); ossimRefPtr<ossimXmlNode> hour = dateNode->findFirstNode("hour"); ossimRefPtr<ossimXmlNode> minutes = dateNode->findFirstNode("minutes"); ossimRefPtr<ossimXmlNode> seconds = dateNode->findFirstNode("seconds"); ossimRefPtr<ossimXmlNode> fractionalSecond = dateNode->findFirstNode("fractionalSecond"); ossimRefPtr<ossimXmlNode> julian = dateNode->findFirstNode("julian"); ossimRefPtr<ossimXmlNode> modifiedJulian = dateNode->findFirstNode("modifiedJulian"); if(month.valid()&& day.valid()&& year.valid()&& hour.valid()&& minutes.valid()&& seconds.valid()) { setMonth(month->getText().toInt32()); setDay(day->getText().toInt32()); setYear(year->getText().toInt32()); setHour(hour->getText().toInt32()); setMin(minutes->getText().toInt32()); setSec(seconds->getText().toInt32()); if(fractionalSecond.valid()) { setFractionalSecond(fractionalSecond->getText().toDouble()); } else { setFractionalSecond(0.0); } } else if(modifiedJulian.valid()) { setDateFromModifiedJulian(modifiedJulian->getText().toDouble()); } else if(julian.valid()) { setDateFromJulian(julian->getText().toDouble()); } else { result = false; } return result; }
bool ossim::findFirstNode(const ossimString& path, ossimRefPtr<ossimXmlNode> node, ossimString& s) { bool result = false; if ( node.valid() ) { ossimRefPtr<ossimXmlNode> n = node->findFirstNode(path); if ( n.valid() ) { s = n->getText(); if ( s.size() ) { result = true; } else { if(!traceDebug()) { ossimNotify(ossimNotifyLevel_WARN) << "ossim::findFirstNode ERROR:\n" << "Node empty: " << path << std::endl; } } } else { if(!traceDebug()) { ossimNotify(ossimNotifyLevel_WARN) << "ossim::findFirstNode ERROR:\n" << "Node not found: " << path << std::endl; } } } return result; }