Changes between Version 7 and Version 8 of UsingMapOWSCommon

Show
Ignore:
Timestamp:
06/19/07 09:12:57 (6 years ago)
Author:
tomkralidis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UsingMapOWSCommon

    v7 v8  
    6464}}} 
    6565 
     66See mapogcsos.c:msSOSException for an example in the codebase 
     67 
    6668Example 2: integrate OWS Common info as part of an existing document: 
    6769 
    6870{{{ 
     71#include "libxml/parser.h" 
     72#include "libxml/tree.h" 
    6973 
     74#include "mapowscommon.h" 
    7075 
     76static 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} 
    71108}}} 
     109 
     110See mapogcsos.c:msSOSGetCapabilities for an example in the codebase