Skip to content
Permalink
Browse files

Set xml declaration for QGIS server capabilities

  • Loading branch information
mhugent committed Aug 14, 2012
1 parent f53f468 commit 0c67fddf149de6f11321b48b5d4fa5309c77091d
Showing with 11 additions and 0 deletions.
  1. +8 −0 src/mapserver/qgswmsserver.cpp
  2. +3 −0 src/mapserver/qgswmsserver.h
@@ -90,10 +90,12 @@ QDomDocument QgsWMSServer::getCapabilities( QString version )
if ( version == "1.1.1" )
{
doc = QDomDocument( "WMT_MS_Capabilities SYSTEM 'http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd'" ); //WMS 1.1.1 needs DOCTYPE "SYSTEM http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd"
addXMLDeclaration( doc );
wmsCapabilitiesElement = doc.createElement( "WMT_MS_Capabilities"/*wms:WMS_Capabilities*/ );
}
else // 1.3.0 as default
{
addXMLDeclaration( doc );
wmsCapabilitiesElement = doc.createElement( "WMS_Capabilities"/*wms:WMS_Capabilities*/ );
wmsCapabilitiesElement.setAttribute( "xmlns", "http://www.opengis.net/wms" );
wmsCapabilitiesElement.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
@@ -1998,3 +2000,9 @@ QString QgsWMSServer::serviceUrl() const
}
return mapUrl.toString();
}

void QgsWMSServer::addXMLDeclaration( QDomDocument& doc ) const
{
QDomProcessingInstruction xmlDeclaration = doc.createProcessingInstruction( "xml", "version=\"1.0\"" );
doc.appendChild( xmlDeclaration );
}
@@ -171,6 +171,9 @@ class QgsWMSServer
/**Get service address from REQUEST_URI if not specified in the configuration*/
QString serviceUrl() const;

/**Add '<?xml version="1.0" ?>'. Some clients need an xml declaration (though it is not strictly required)*/
void addXMLDeclaration( QDomDocument& doc ) const;

/**Map containing the WMS parameters*/
QMap<QString, QString> mParameterMap;
QgsConfigParser* mConfigParser;

0 comments on commit 0c67fdd

Please sign in to comment.
You can’t perform that action at this time.