XML Template

Mike Saunt mikesaunt at GMAIL.COM
Thu Nov 3 19:10:10 EST 2005


Tricia

We have just finished implementing a system like this to get CGI version
talking with .NET - simple but very powerful especially with the template
replacement options introduced in v4 for the CGI URL parameters.

In essence we take the output into a XML template that is built in a fashion
to hold all possible output parameters from each execution of the CGI
(mode=browse) - this is at my office (it is mdnight here in the UK) but I
will try to remember to send to you tomorrow. We simply load this in .NET
and and have an 'state' variable holding this between execution.

With mode=query (or nquery) we build XML templates per layer. These are then
streamed back from an execution and then are loaded into a .NET datatable -
we can then easily manipulate, sort, delete records etc. The format we've
used is as follows:

<row>
<fieldname1>[fieldname1]</fieldname1>
<fieldname2>[fieldname2]</fieldname2>
<fieldname3>[fieldname3]</fieldname3>
</row>

When MapServer parses this file it replaces the [fieldname1] values with the
attribute information.

There may be a few on the list who wonder why we have gone about it this
way. We have an existing .NET web application that runs on large vendor
software and needed to look at addressing some needs for our customers who
need more flexible environment. We didn't opt for MapScript in c# at present
as we investigated and it appeared to have some memory issues. The great
thing with MapServer CGI is that it is totally stateless, executes in
fractions of a second (we access over 1 GB of MapInfo files with no problem)
and in some cases is actually faster than the vendor software.

If anyone wants any further information or ode then just let us know

Cheers
mike

On 03/11/05, Tricia Williams <pgwillia at student.cs.uwaterloo.ca> wrote:
>
> Hi List,
>
> I was wondering if it is possible to use an xml template instead of a
> html template to handle nquery results? I have tried experimenting but
> the results are not recognized as xml.
>
> My header contains:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <result>
>
> My template contains:
>
> <place>
> ...
> </place>
>
> My footer contains:
>
> </results>
>
> Any advice or guidance would be much appreciated.
>
> Cheers,
> Tricia
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051104/6a6d5f28/attachment.html


More information about the mapserver-users mailing list