abstraction of mapogcsos.c common ogc bits

Daniel Morissette dmorissette at MAPGEARS.COM
Wed Oct 18 13:52:14 EDT 2006


Kralidis,Tom [Burlington] wrote:
> 
> What do people think about a generic mapowscommon.c / mapowscommon.h
> 

I think that grouping all OWS Common stuff in a mapowscommon.c file 
would be a good idea.

> 
> Maybe Assefa/others can provide comments on using libxml2 compared to
> msIO_printf for XML.  If it were up to me, I'd go with doing things the
> libxml2 way, as msIO_printf can be quite error prone for XML output and
> well formedness.  This would of course mean that any future development
> of OGC stuff in MapServer would be best to align with the libxml2 way of
> doing things.
> 

It seems that using libxml2 for future OGC service work is probably a 
good idea, but I think we'd need some comments on whether libxml2 
brought real benefits for the SOS implementation by simplifying the 
code, and also it would be interesting to see a comparison of the 
performance impact of using libxml2 vs msIO_printf.

I guess before deciding to go with libxml2 all the way I'd like to make 
sure that we are not trading an ugly mechanism for another ugly one with 
just poorer performance.

For instance, from a quick browse of the mapogcsos.c code, it seems that 
everytime something is set with libxml2 there is a call to xmlNewNs() 
with hardcoded namespace and uri. There is a total of 110 calls like 
this in mapogcsos.c, most of them with the same hardcoded gml or ows 
namespace info, are these really necessary? Do these repeated 
allocations of objects not add up and eventually impact on performance? 
If they cannot be avoided then at least we should use a #define to avoid 
duplicating the same namespace and uri strings 39 times (for ows) and 25 
times (for gml)... at least to make the code look better than the former 
msIO_printf version.

Please don't get me wrong, I'm not saying that libxml2 is not a good way 
to go, I'm just thinking out loud.

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the mapserver-dev mailing list