diff options
Diffstat (limited to 'project2/xslRows.cpp')
-rw-r--r-- | project2/xslRows.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/project2/xslRows.cpp b/project2/xslRows.cpp index 3742e93..537a459 100644 --- a/project2/xslRows.cpp +++ b/project2/xslRows.cpp @@ -131,11 +131,21 @@ XslRows::execute(const RowProcessor * rp) const else if (xpathObjI->stringval) { values[xp.first] = boost::shared_ptr<const Glib::ustring>(new Glib::ustring((const char *)xpathObjI->stringval)); } - else if (xpathObjI->nodesetval && xpathObjI->nodesetval->nodeNr == 1) { - if (xpathObjI->nodesetval->nodeTab[0]->children && xpathObjI->nodesetval->nodeTab[0]->children->content) { - xmlChar * val = xpathObjI->nodesetval->nodeTab[0]->children->content; - values[xp.first] = boost::shared_ptr<const Glib::ustring>(new Glib::ustring((const char *)val)); + else if (xpathObjI->nodesetval) { + boost::shared_ptr<Glib::ustring> str = boost::shared_ptr<Glib::ustring>(new Glib::ustring()); + for (int i = 0; i < xpathObjI->nodesetval->nodeNr; i += 1) { + xmlNodePtr n = xpathObjI->nodesetval->nodeTab[i]; + if (n->content) { + *str += (const char *)n->content; + } + for (n = n->children; n; n = n->next) { + xmlChar * val = n->content; + if (val) { + *str += (const char *)val; + } + } } + values[xp.first] = str; } } rp->rowReady(); |