| 1909 | /************************************************************************/ |
| 1910 | |
| 1911 | static int msWCSWriteDocument20(mapObj* map, xmlDocPtr psDoc) |
| 1912 | { |
| 1913 | xmlChar *buffer = NULL; |
| 1914 | int size = 0; |
| 1915 | msIOContext *context = NULL; |
| 1916 | |
| 1917 | const char *encoding = msOWSLookupMetadata(&(map->web.metadata), "CO", "encoding"); |
| 1918 | |
| 1919 | if( msIO_needBinaryStdout() == MS_FAILURE ) |
| 1920 | { |
| 1921 | return MS_FAILURE; |
| 1922 | } |
| 1923 | |
| 1924 | if (encoding) |
| 1925 | { |
| 1926 | msIO_printf("Content-type: text/xml; charset=%s%c%c", encoding,10,10); |
| 1927 | } |
| 1928 | else |
| 1929 | { |
| 1930 | msIO_printf("Content-type: text/xml%c%c",10,10); |
| 1931 | } |
| 1932 | |
| 1933 | context = msIO_getHandler(stdout); |
| 1934 | |
| 1935 | xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, (encoding ? encoding : "ISO-8859-1"), 1); |
| 1936 | msIO_contextWrite(context, buffer, size); |
| 1937 | xmlFree(buffer); |
| 1938 | |
| 1939 | return MS_SUCCESS; |
| 1940 | } |
| 1941 | |
| 1942 | /************************************************************************/ |
| 1943 | /* msWCSWriteFile20() */ |
no test coverage detected