[mapserver-users] XML mapfile?

Frank Warmerdam warmerdam at pobox.com
Thu May 23 20:34:55 PDT 2002


Steve Lime wrote:
> I don't think you can afford validation "all the time", too expensive.
> 
> 
>>>>Roberto Micarelli <mi.ro at iol.it> 05/23/02 03:37PM >>>
>>>
> I'm succesfully using XercesC++ in a my project because it's the only
> open 
> source parser that I know being able to perform XML schema validation.
> What parsers are there for C language not limited to DTD?

Folks,

I have hesitated to get to involved in this but can no longer hold back.

I see two approaches to integrating an XML map file.

1) Loose integration with a MapScript (PHP, Perl or Java?) code chunk used
    to turn the XML map file into appropriate map objects.  The nice aspect
    about this is that anyone promoting XML map files can proceed with this
    immediately without interfering in core MapServer development.  MapScript
    should be able to create all the requisite objects, and if it can't it
    should be fixed.

2) Tightly integrated support.  Essentially all the code in mapfile.c (and
    indirectly in mapparser.c) would need to be duplicated for the XML Map
    file.

Assuming we want to take option 2 at some point, we likely will want to stick
with a C language XML parser which pushes Xerces C (which is actually C++)
out of contention.  Expat would work, but even Expat is not really "light".
The libexpat shared library is 150K on Linux.  And Expat doesn't give you
DOM.

As an alternative, I would be happy to offer my "minixml" library. It is C,
and I wrote it for inclusion in GDAL/OGR for processing "light weight" XML into
a tree datastructure.  It is fast, and light and but doesn't do validation
and doesn't understand esoteric XML features.  It is, however, fine for
reading well formed XML documents.  I use it for GML geometries, and an
increasing variety of configuration files used by GDAL/OGR.

All that said, I think we need to be realistic about what the priority of
XML map files is.  I don't think it is core to any paid projects around
MapServer right now and that means it is unlikely that any of the current
core developers is likely to spend alot of time on it.

 From my point of view, if I wanted to invest time in making MapServer more
user friendly, I would like to concentrate on a better debugging system to
improve the ability to find what is going on inside MapServer.   Many of my
headaches with MapServer have been resolved by literally running shp2img or
mapserv in gdb and stepping through to see why things weren't working.  This
isn't much of an option for non-developers!

Therefore, I would like to encourage those interested in XML Map files to take
a first crack at option 1, a MapScript based solution.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the MapServer-users mailing list