MCPcopy Create free account
hub / github.com/MapServer/MapServer / msOWSPrintValidateMetadata

Function msOWSPrintValidateMetadata

mapows.c:892–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890*/
891
892int msOWSPrintValidateMetadata(FILE *stream, hashTableObj *metadata,
893 const char *namespaces, const char *name,
894 int action_if_not_found,
895 const char *format, const char *default_value)
896{
897 const char *value;
898 int status = MS_NOERR;
899
900 if((value = msOWSLookupMetadata(metadata, namespaces, name)))
901 {
902 if(msIsXMLTagValid(value) == MS_FALSE)
903 msIO_fprintf(stream, "<!-- WARNING: The value '%s' is not valid in a "
904 "XML tag context. -->\n", value);
905 msIO_fprintf(stream, format, value);
906 }
907 else
908 {
909 if (action_if_not_found == OWS_WARN)
910 {
911 msIO_fprintf(stream, "<!-- WARNING: Mandatory metadata '%s%s' was missing in this context. -->\n", (namespaces?"..._":""), name);
912 status = action_if_not_found;
913 }
914
915 if (default_value)
916 {
917 if(msIsXMLTagValid(default_value) == MS_FALSE)
918 msIO_fprintf(stream, "<!-- WARNING: The value '%s' is not valid "
919 "in a XML tag context. -->\n", default_value);
920 msIO_fprintf(stream, format, default_value);
921 }
922 }
923
924 return status;
925}
926
927/*
928** msOWSPrintGroupMetadata()

Callers 1

msGMLWriteQueryFunction · 0.85

Calls 3

msOWSLookupMetadataFunction · 0.85
msIsXMLTagValidFunction · 0.85
msIO_fprintfFunction · 0.85

Tested by

no test coverage detected