diff options
Diffstat (limited to 'project2/xmlPresenter.cpp')
-rw-r--r-- | project2/xmlPresenter.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/project2/xmlPresenter.cpp b/project2/xmlPresenter.cpp index d657964..adf7860 100644 --- a/project2/xmlPresenter.cpp +++ b/project2/xmlPresenter.cpp @@ -17,9 +17,8 @@ XmlPresenter::createDoc() const { if (nodeStack.empty()) { nodeStack.push_back(responseDoc->create_root_node(getResponseRootNodeName())); - xmlNewNs(nodeStack.back()->cobj(), - BAD_CAST ApplicationEngine::getCurrent()->env()->getXmlNamespace().c_str(), - BAD_CAST ApplicationEngine::getCurrent()->env()->getXmlPrefix().c_str()); + declareNamespace(ApplicationEngine::getCurrent()->env()->getXmlPrefix(), + ApplicationEngine::getCurrent()->env()->getXmlNamespace()); // XSLT Style char * buf; if (!getResponseStyle().empty() && asprintf(&buf, "type=\"text/xsl\" href=\"%s\"", @@ -67,6 +66,18 @@ XmlPresenter::getDataDocument() const } void +XmlPresenter::declareNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const +{ + xmlNewNs(nodeStack.back()->cobj(), BAD_CAST ns.c_str(), BAD_CAST prefix.c_str()); +} + +void +XmlPresenter::setNamespace(const Glib::ustring & prefix, const Glib::ustring & ns) const +{ + nodeStack.back()->set_namespace_declaration(ns, prefix); +} + +void XmlPresenter::pushSub(const Glib::ustring & name, const Glib::ustring & ns) const { createDoc(); |