Open GoogleCodeExporter opened 9 years ago
use the attached file as this xml and notice that the
xml returned by get_unknown_elements_array_at()
has elements expanded to:
<urn:oasis:names:tc:emergency:cap:1.1|alert>
std::string errors;
kmldom::AtomFeedPtr feed =
kmldom::AsAtomFeed(kmldom::ParseAtom(xml, &errors));
if (!feed.get()) {
LOG(ERROR) << "atom parse failed: " << url;
LOG(ERROR) << "atom parse failed: " << errors;
return 1;
}
int entry_count = feed->get_entry_array_size();
LOG(INFO) << "entry count: " << entry_count;
for (int i = 0; i < entry_count; ++i) {
const kmldom::AtomEntryPtr entry = feed->get_entry_array_at(i);
LOG(INFO) << "title: " << entry->get_title();
if (entry->has_content() &&
entry->get_content()->get_unknown_elements_array_size() > 0) {
// TODO(bent): parse the CAP <alert>
VLOG(1) << entry->get_content()->get_unknown_elements_array_at(0);
}
}
Original comment by bent.hag...@gmail.com
on 18 Jun 2009 at 2:24
Attachments:
Original issue reported on code.google.com by
bent.hag...@gmail.com
on 18 Jun 2009 at 2:08