//----------------------------------------------------------------------- bool ConverterPass1::XmlFictionBook(XMLHandle hDoc) { XMLHandle fb = hDoc.FirstChildElement("FictionBook"); XMLElement* fbEl; if (!(fbEl = fb.ToElement())) { errMsg = "FictionBook element not found."; return false; } if (!fbEl->Attribute("xmlns", "http://www.gribuser.ru/xml/fictionbook/2.0")) { errMsg = "Missing FictionBook namespace definition."; return false; } if (!fbEl->Attribute("xmlns:l", "http://www.w3.org/1999/xlink") && !fbEl->Attribute("xmlns:xlink", "http://www.w3.org/1999/xlink")) { errMsg = "Bad FictionBook namespace definition or bad xlink namespace definition."; return false; } //<description> XMLElement *desc = fbEl->FirstChildElement("description"); if (!desc) { errMsg = "description element not found."; return false; } XMLElement *titleInfo = desc->FirstChildElement("title-info"); if (!titleInfo) { errMsg = "title-info element not found."; return false; } // needs to process "annotation" and "coverpage" elements here XmlAnnotation(titleInfo->FirstChildElement("annotation"), true); //</description> //<body> body(Unit::MAIN); if (s_->IsNextElement("body")) body(Unit::NOTES); if (s_->IsNextElement("body")) body(Unit::COMMENTS); //</body> }