| 785 | */ |
| 786 | |
| 787 | int msOWSPrintMetadata(FILE *stream, hashTableObj *metadata, |
| 788 | const char *namespaces, const char *name, |
| 789 | int action_if_not_found, const char *format, |
| 790 | const char *default_value) |
| 791 | { |
| 792 | const char *value = NULL; |
| 793 | int status = MS_NOERR; |
| 794 | |
| 795 | if((value = msOWSLookupMetadata(metadata, namespaces, name)) != NULL) |
| 796 | { |
| 797 | msIO_fprintf(stream, format, value); |
| 798 | } |
| 799 | else |
| 800 | { |
| 801 | if (action_if_not_found == OWS_WARN) |
| 802 | { |
| 803 | msIO_fprintf(stream, "<!-- WARNING: Mandatory metadata '%s%s' was missing in this context. -->\n", (namespaces?"..._":""), name); |
| 804 | status = action_if_not_found; |
| 805 | } |
| 806 | |
| 807 | if (default_value) |
| 808 | msIO_fprintf(stream, format, default_value); |
| 809 | } |
| 810 | |
| 811 | return status; |
| 812 | } |
| 813 | |
| 814 | |
| 815 | /* |
no test coverage detected