From: Adam Dickmeiss Date: Tue, 27 May 2014 13:49:46 +0000 (+0200) Subject: Using query->execute to get result into string X-Git-Tag: v0.1~15 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=cc6783d03572ccc2ebdf5b87dbb82e1cb3af0f11;p=mp-xquery-moved-to-github.git Using query->execute to get result into string --- diff --git a/src/tst.cpp b/src/tst.cpp index f35415d..893be85 100644 --- a/src/tst.cpp +++ b/src/tst.cpp @@ -37,7 +37,7 @@ example_2(Zorba* aZorba) // lQuery->setFileName("http://base/"); lQuery->setFileName("/home/adam/proj/marc2bibframe/xbin/"); - lQuery->compile(*qfile.get(), lHints); + lQuery->compile(*qfile, lHints); zorba::DynamicContext* lDynamicContext = lQuery->getDynamicContext(); @@ -57,7 +57,13 @@ example_2(Zorba* aZorba) "/home/adam/proj/yaz/test/marc7.xml"); lDynamicContext->setVariable("marcxmluri", lItem); - std::cout << lQuery << std::endl; + std::stringstream ss; + + lQuery->execute(ss); + + std::string result = ss.str(); + + std::cout << result << std::endl; return true; }