Permalink
Browse files

WFS 2.0: generate correct MetadataURL element, and add optional wfs_m…

…etadataurl_about layer metadata item (#4886)
  • Loading branch information...
rouault committed Mar 20, 2014
1 parent 1938666 commit f4b969d25d263ef88a676441bdc1d938a2b9df94
Showing with 22 additions and 10 deletions.
  1. +21 −9 mapwfs11.c
  2. +1 −1 msautotest
View
@@ -225,21 +225,33 @@ xmlNodePtr msWFSDumpLayer11(mapObj *map, layerObj *lp, xmlNsPtr psNsOws,
value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_href");
if (value) {
- psNode = xmlNewChild(psRootNode, NULL, BAD_CAST "MetadataURL", BAD_CAST value);
+ if( nWFSVersion >= OWS_2_0_0 )
+ {
+ psNode = xmlNewChild(psRootNode, NULL, BAD_CAST "MetadataURL", NULL);
+ xmlNewProp(psNode, BAD_CAST "xlink:href", BAD_CAST value);
+
+ value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_about");
+ if( value != NULL )
+ xmlNewProp(psNode, BAD_CAST "about", BAD_CAST value);
+ }
+ else
+ {
+ psNode = xmlNewChild(psRootNode, NULL, BAD_CAST "MetadataURL", BAD_CAST value);
- value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_format");
+ value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_format");
- if (!value)
- value = msStrdup("text/html"); /* default */
+ if (!value)
+ value = msStrdup("text/html"); /* default */
- xmlNewProp(psNode, BAD_CAST "format", BAD_CAST value);
+ xmlNewProp(psNode, BAD_CAST "format", BAD_CAST value);
- value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_type");
+ value = msOWSLookupMetadata(&(lp->metadata), "FO", "metadataurl_type");
- if (!value)
- value = msStrdup("FGDC"); /* default */
+ if (!value)
+ value = msStrdup("FGDC"); /* default */
- xmlNewProp(psNode, BAD_CAST "type", BAD_CAST value);
+ xmlNewProp(psNode, BAD_CAST "type", BAD_CAST value);
+ }
}
return psRootNode;
Submodule msautotest updated from df76b2 to a65ae1

0 comments on commit f4b969d

Please sign in to comment.