MapServer and XML...

John Hockaday johnh at erin.gov.au
Tue May 16 19:19:38 EDT 2000


Hi,

We use XML to store all our layer and server information.  We are
waiting for OGIS to be finalised and to see how many people use it
before we change our own XML structure.  (After all SDTS appears to be
not widely used.)

We convert the XML information into dynamic map files on the fly for
the ForNet mapserver to present gifs and queries.

Your question on whether to use attributes or elements has been argued
amongst the XML and SGML community for a long time.  I like the
approach of using elements when they can mean something to the public
and attributes for the system variables.  For example.

<layer LID="L47" DSID="D1">
 <name>Coasts</name>
 <type>point</type>
  ...
</layer>

Where "LID" equals "Layer IDentification number" and "DSID" equals
"DataServer IDentification number".  These are used by the WWW
presentation software and for layer indexing.

The only restriction to the attributes is that you can't have duplicate
attribute names.  This will be identified if you try to parse your DTD
or an instance of your document against your DTD.  So the lession to
learn there is use them sparingly.

That's my two cents worth.


John Hocakday

> 
> Pretty straight forward I'd say. How does one make the decision between
> making a a parameter a new tag or just having it as an attribute of another
> tag? For example:
> 
>   <layer><name>water</name>  vs   <layer name="water">
> 
> Once a DTD is in place a conversion script should be a piece of cake.
 
> Stephen Lime




More information about the mapserver-users mailing list