81 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"Dataset") < 0)
82 throw InternalErr(__FILE__, __LINE__,
"Could not write Dataset element");
84 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xmlns",
85 (
const xmlChar*) get_namespace().c_str()) < 0)
86 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns");
90 if (xmlTextWriterWriteAttribute(xml.get_writer(),
93 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xmlns:dmrpp");
95 if (!request_xml_base().empty()) {
96 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"xml:base",
97 (
const xmlChar*) request_xml_base().c_str()) < 0)
98 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for xml:base");
101 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"dapVersion",
102 (
const xmlChar*) dap_version().c_str()) < 0)
103 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for dapVersion");
105 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"dmrVersion",
106 (
const xmlChar*) dmr_version().c_str()) < 0)
107 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for dapVersion");
109 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"name", (
const xmlChar*) name().c_str()) < 0)
110 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
114 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
string(
DmrppCommon::d_ns_prefix).append(
":href").c_str(),
115 (
const xmlChar*) href.c_str()) < 0)
116 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for href");
118 if (!get_version().empty())
119 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
string(
DmrppCommon::d_ns_prefix).append(
":version").c_str(),
120 (
const xmlChar*) get_version().c_str()) < 0)
121 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for version");
123 root()->print_dap4(xml, constrained);
125 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
126 throw InternalErr(__FILE__, __LINE__,
"Could not end the top-level Group element");
virtual void print_dmrpp(libdap::XMLWriter &xml, const std::string &href="", bool constrained=false, bool print_chunks=true)
Print the DMR++ response.