| 76 | static int msPrintBoundingBox(mapObj *map, char *locator, char *exceptionCode) |
| 77 | xmlDocPtr psDoc = NULL; |
| 78 | xmlNodePtr psRootNode = NULL; |
| 79 | xmlNodePtr psNode = NULL; |
| 80 | xmlChar *buffer = NULL; |
| 81 | int size = 0; |
| 82 | |
| 83 | /* create XML document object */ |
| 84 | psDoc = xmlNewDoc(BAD_CAST "1.0"); |
| 85 | |
| 86 | /* generate the root node */ |
| 87 | psRootNode = xmlNewNode(NULL, BAD_CAST "My_Root_Node"); |
| 88 | |
| 89 | /* set the root element of the document */ |
| 90 | xmlDocSetRootElement(psDoc, psRootNode); |
| 91 | |
| 92 | /* set the namespace of the document */ |
| 93 | xmlSetNs(psRootNode, xmlNewNs(psRootNode, BAD_CAST MS_OWSCOMMON_OWS_NAMESPACE_URI, BAD_CAST MS_OWSCOMMON_OWS_NAMESPACE_PREFIX)); |
| 94 | |
| 95 | psNode = msOWSCommonWGS84BoundingBox(2, -180.0, -90.0, 180, 90); |
| 96 | |
| 97 | msIO_printf("Content-type: text/xml%c%c",10,10); |
| 98 | |
| 99 | /* dump the libxml2 object to a string for output */ |
| 100 | xmlDocDumpFormatMemoryEnc(psDoc, &buffer, &size, "ISO-8859-1", 1); |
| 101 | |
| 102 | msIO_printf("%s", buffer); |
| 103 | |
| 104 | /*free buffer and the document */ |
| 105 | xmlFree(buffer); |
| 106 | xmlFreeDoc(psDoc); |
| 107 | } |