Thanks for the response, Ian.

Unfortunately, it appears that GeoServer 2.17.1 can return GetCapabilties 
v1.3.0 for http://<<server>>/geoserver/wms? 
SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0

but not for the required 
http://<<server>>/geoserver/gwc/service/wms?TILED=TRUE&SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0
 as this returns v1.1.1.



The xml returned in the GetCapabilities for 
http://<<server>>/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1
 is valid when parsing with OpenLayers’ ol.format.WMTSCapabilities(), or 
Javascript’s DOMParser(), or in a text editor (e.g. Notepad++).

But the xml returned in the GetCapabilities for 
http://<<server>>/geoserver/gwc/service/wms?TILED=TRUE&SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1
 in invalid for all three parsing methods mentioned above.

Simply by manually adding xmlns:xlink=”http://www.w3.org/1999/xlink” to the 
OnlineResource tag enables all three parsers to validate the xml.

Any further ideas will be gratefully received!

Many thanks,

John


From: Ian Turton <[email protected]>
Sent: 20 January 2021 13:49
To: COOK, JOHN <[email protected]>
Cc: [email protected]
Subject: Re: [Geoserver-users] GetCapabilities has missing xmlns:xlink 
attribute in OnlineResource tag

I think that's a bug in the parser - WMS 1.1.1 uses a DTD to define the XML

<!DOCTYPE WMT_MS_Capabilities SYSTEM 
"http://localhost:8080/geoserver-2.18.1/schemas/wms/1.1.1/WMS_MS_Capabilities.dtd";>

and that includes

<!ATTLIST OnlineResource
          xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink";
          xlink:type CDATA #FIXED "simple"
          xlink:href CDATA #REQUIRED >

So there is no need for the xlink namespace to be declared (in fact it would be 
invalid to declare a namespace and a DTD in the same document).

If you are working with a parser that is unable to handle DTDs then it is 
probably worth switching to WMS version 1.3 which is fully schema defined.

<WMS_Capabilities xmlns="http://www.opengis.net/wms"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="1.3.0" 
updateSequence="162" xsi:schemaLocation="http://www.opengis.net/wms 
http://localhost:8080/geoserver-2.18.1/schemas/wms/1.3.0/capabilities_1_3_0.xsd";>

Ian

On Wed, 20 Jan 2021 at 11:16, COOK, JOHN 
<[email protected]<mailto:[email protected]>> wrote:
Dear All,

We have an instance of GeoServer v 2.17.1 installed.

The GetCapabilities xml generated by 
http://<<server>>/geoserver/gwc/service/wms?TILED=TRUE&SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1<http://%3c%3cserver%3e%3e/geoserver/gwc/service/wms?TILED=TRUE&SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1>
 appears to be invalid.

Where a style has been applied to a raster layer, the Style tag contains a 
LegendURL tag that contains an OnlineResource tag. This OnlineResource tag 
appears to be causing the following XML parsing error: “Namespace prefix xlink 
from href on OnlineResource is not defined”.

<TileSet>
        <SRS>EPSG:900913</SRS>
        …
        <Layers>OS:VectorMap</Layers>
        <Styles>
          <Style>
            <Name>VectorMap_GREY</Name>
            <LegendURL width="20" height="20">
              <Format>image/png</Format>
              <OnlineResource xlink:type="simple" xlink:href="http:// 
<<server>>/geoserver/ows?service=WMS&amp;request=GetLegendGraphic&amp;format=image%2Fpng&amp;width=20&amp;height=20&amp;layer=OS%3AVectorMap&amp;style=VectorMap_GREY"/>
            </LegendURL>
          </Style>
        </Styles>
      </TileSet>

Therefore, OpenLayers and other JavaScript xml parsers fail to parse the 
GetCapabilties.

Is there anything I can do that will add the “xmlns:xlink” attribute to these 
OnlineResource tags? Any ideas will be gratefully received!


All the best,

John


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/<https://hes32-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=http%3a%2f%2fwww.ianturton.com%2ftalks%2ffoss4g.html%23%2f&umid=94b86bbe-3b36-40d8-80a5-14ba5435b3f0&auth=eb307c54eb70905f0cc41c69e0499be51aa4b479-49efb75340ad76a7546dc59cc53c726259b70a7d>
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer<https://hes32-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fgithub.com%2fgeoserver%2fgeoserver%2fwiki%2fSuccessfully%2drequesting%2dand%2dintegrating%2dnew%2dfeatures%2dand%2dimprovements%2din%2dGeoServer&umid=94b86bbe-3b36-40d8-80a5-14ba5435b3f0&auth=eb307c54eb70905f0cc41c69e0499be51aa4b479-3dc677b206dd0b3aba8327131b5fd8a83c05066b>


[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/geoserver-users


--
Ian Turton
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to