libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
DapXmlNamespaces.h
Go to the documentation of this file.
1// -*- mode: c++; c-basic-offset:4 -*-
2
3// This file is part of libdap, A C++ implementation of the OPeNDAP Data
4// Access Protocol.
5
6// Copyright (c) 2017 OPeNDAP, Inc.
7// Author: Nathan Potter <ndp@opendap.org>
8//
9// This library is free software; you can redistribute it and/or
10// modify it under the terms of the GNU Lesser General Public
11// License as published by the Free Software Foundation; either
12// version 2.1 of the License, or (at your option) any later version.
13//
14// This library is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// Lesser General Public License for more details.
18//
19// You should have received a copy of the GNU Lesser General Public
20// License along with this library; if not, write to the Free Software
21// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22//
23// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24
25#ifndef DAPXMLNAMSPACES_H_
26#define DAPXMLNAMSPACES_H_
27
28#include <string>
29
30namespace libdap {
31
33
35
36public:
37 virtual ~DapXmlNamspaces() {};
38
42 static std::string getXmlXsiNamespace() { return "http://www.w3.org/2001/XMLSchema-instance"; }
43
47 static std::string getXmlNamespace() { return "http://www.w3.org/XML/1998/namespace"; }
48
53
54 switch (version) {
55 case DAP_2_0:
56 throw InternalErr(
57 __FILE__, __LINE__,
58 "DapXmlNamspaces::getDapXmlNamespaceString() - GRDDL Transformation undefined for DAP 2.0");
59 break;
60
61 case DAP_3_2:
62 return "http://xml.opendap.org/transforms/ddxToRdfTriples.xsl";
63 break;
64
65 case DAP_4_0:
66 throw InternalErr(
67 __FILE__, __LINE__,
68 "DapXmlNamspaces::getDapXmlNamespaceString() - GRDDL Transformation undefined for DAP 4.0");
69 break;
70
71 default:
72 throw InternalErr(__FILE__, __LINE__,
73 "DapXmlNamspaces::getDapXmlNamespaceString() - Unrecognized namespace version.");
74 break;
75 }
76 }
77
82
83 switch (version) {
84 case DAP_2_0:
85 return "http://xml.opendap.org/ns/DAP2";
86 break;
87
88 case DAP_3_2:
89 return "http://xml.opendap.org/ns/DAP/3.2#";
90 break;
91
92 case DAP_4_0:
93 return "http://xml.opendap.org/ns/DAP/4.0#";
94 break;
95
96 default:
97 throw InternalErr(__FILE__, __LINE__,
98 "DapXmlNamspaces::getDapXmlNamespaceString() - Unrecognized namespace version.");
99 break;
100 }
101 }
102
107
108 switch (version) {
109 case DAP_2_0:
110 return "http://xml.opendap.org/dap/dap2.xsd";
111 break;
112
113 case DAP_3_2:
114 return "http://xml.opendap.org/dap/dap3.2.xsd";
115 break;
116
117 case DAP_4_0:
118 return "http://xml.opendap.org/dap/dap4.0.xsd";
119 break;
120
121 default:
122 throw InternalErr(__FILE__, __LINE__,
123 "DapXmlNamspaces::getSchemaLocationString() - Unrecognized namespace version.");
124 break;
125 }
126 }
127
135};
136
137} /* namespace libdap */
138#endif /* DAPXMLNAMSPACES_H_ */
static std::string getGrddlTransformation(DAPVersion version)
static std::string getDapNamespaceString(DAPVersion version)
static std::string getSchemaLocationDeclarationString(DAPVersion version)
static std::string getSchemaLocationString(DAPVersion version)
static std::string getXmlNamespace()
static std::string getXmlXsiNamespace()
A class for software fault reporting.
Definition InternalErr.h:61
const char * version
Definition getdap.cc:65
top level DAP object to house generic methods
Definition AISConnect.cc:30