void WeatherData::processFact() { if (!xmlReader.isStartElement() || xmlReader.name() != "fact") return; while (xmlReader.readNextStartElement()) { if (xmlReader.name() == "pressure") pressure = readNextText(); else if (xmlReader.name() == "wind_speed") { wind_speed = readNextText(); } #ifndef USE_READ_ELEMENT_TEXT xmlReader.skipCurrentElement(); #endif } }
void WeatherData::processHour() { if (!xmlReader.isStartElement() || xmlReader.name() != "hour") return; while (xmlReader.readNextStartElement()) { if(xmlReader.name() == "temperature") temperature = readNextText(); } }
void XmlRateReader::processRate() { if (!xml.isStartElement() || xml.name() != "rate") return; QString from; QString to; QString conversion; while (xml.readNextStartElement()) { if (xml.name() == "from") from = readNextText(); else if (xml.name() == "to") to = readNextText(); else if (xml.name() == "conversion") conversion = readNextText(); #ifndef USE_READ_ELEMENT_TEXT xml.skipCurrentElement(); #endif } if (!(from.isEmpty() || to.isEmpty() || conversion.isEmpty())) Currency::addRate(from, to, conversion); }