Opened 14 years ago

Closed 13 years ago

Last modified 12 years ago

#2872 closed enhancement (fixed)

RFC 51 implementation: XML Mapfiles Format

Reported by: aboudreault Owned by: aboudreault
Priority: normal Milestone: 5.6 release
Component: Documentation - MapServer Version: svn-trunk (development)
Severity: normal Keywords: xml mapfile
Cc: dmorissette, tomkralidis, sdlime, nsavard

Description (last modified by dmorissette)

Ticket to track changes with regards to RFC 51, XML/BXML Mapfiles:

http://mapserver.org/development/rfc/ms-rfc-51.html

Attachments (11)

mapfile-0.1.xsd (28.7 KB ) - added by aboudreault 14 years ago.
Here's a first prototype of the XML/Mapfile Schema.
mapfile-0-0-2.xsd (29.2 KB ) - added by tomkralidis 14 years ago.
mapfile-0.0.3.xsd (28.7 KB ) - added by aboudreault 14 years ago.
mapfile-0.0.4.xsd (27.7 KB ) - added by tomkralidis 14 years ago.
mapfile-schema-0.0.6.xsd (31.7 KB ) - added by aboudreault 13 years ago.
mapfile-xslt-0.0.4.xsl (56.3 KB ) - added by aboudreault 13 years ago.
mapfile-test.xml (6.7 KB ) - added by aboudreault 13 years ago.
a complete xml mapfile
layerset.xml (5.3 KB ) - added by aboudreault 13 years ago.
a layerset xml file
symbolset.xml (1.3 KB ) - added by aboudreault 13 years ago.
a symbolset xml file
mapfile-0.0.7.zip (8.2 KB ) - added by tomkralidis 13 years ago.
mstrac-2872.tgz (11.6 KB ) - added by tomkralidis 13 years ago.

Download all attachments as: .zip

Change History (46)

by aboudreault, 14 years ago

Attachment: mapfile-0.1.xsd added

Here's a first prototype of the XML/Mapfile Schema.

comment:1 by dmorissette, 14 years ago

Description: modified (diff)
Summary: RFC 51 implementationRFC 51 implementation: XML/BXML Mapfiles

by tomkralidis, 14 years ago

Attachment: mapfile-0-0-2.xsd added

by aboudreault, 14 years ago

Attachment: mapfile-0.0.3.xsd added

comment:2 by aboudreault, 14 years ago

Milestone: 5.4 release6.0 release
Summary: RFC 51 implementation: XML/BXML MapfilesRFC 51 implementation: XML Mapfiles Format

by tomkralidis, 14 years ago

Attachment: mapfile-0.0.4.xsd added

comment:3 by tomkralidis, 14 years ago

version 0.0.4 validates with no issue in XMLSpy 2008.

by aboudreault, 13 years ago

Attachment: mapfile-schema-0.0.6.xsd added

by aboudreault, 13 years ago

Attachment: mapfile-xslt-0.0.4.xsl added

by aboudreault, 13 years ago

Attachment: mapfile-test.xml added

a complete xml mapfile

by aboudreault, 13 years ago

Attachment: layerset.xml added

a layerset xml file

by aboudreault, 13 years ago

Attachment: symbolset.xml added

a symbolset xml file

comment:4 by aboudreault, 13 years ago

Cc: tomkralidis added

The schema and the xslt for XML Mapfile seem to be done. The schema allows us to do 3 things:

  • A complete xml mapfile
  • A xml file for layers (for those who would like to separate their project and use the INCLUDE mapfile keyword)
  • A xml file for symbols

I've joined the up-to-date schema and xlst + an example of each xml files. I've tested my schema and the xslt with libxml2 and XMLPad (Windows). Everything seems to work great and there is no parsing error in MapServer (trunk). Tom, Could you made a quick test with XMLSpy 2008?

comment:5 by tomkralidis, 13 years ago

Good work Alain! See attached .zip with updates:

  • added "version" attribute to Map element
  • tightened up namespaces

I haven't touched the .xsl

by tomkralidis, 13 years ago

Attachment: mapfile-0.0.7.zip added

comment:6 by dmorissette, 13 years ago

Cc: sdlime added

To simplify updates, why don't we put everything in SVN, perhaps in a new "xmlmapfile" sub-directory?

comment:7 by tomkralidis, 13 years ago

+1

comment:8 by aboudreault, 13 years ago

Component: MapServer C LibraryMapServer Documentation

Committed in r9273.

comment:9 by tomkralidis, 13 years ago

What should we do about the version attribute in the Map element? I think this should coincide with the mapserver version, as opposed to having a versioning scheme on its own. Better yet, set an svn keyword in mapfile.xsd which coincides with the given version.

comment:10 by aboudreault, 13 years ago

I agree. The mapfile schema version has been modified in r9274.

comment:11 by aboudreault, 13 years ago

tomkralafis, as you are more experienced with XML than I and that I don't really understand the namespace concept, may you fix that problem plz : the test mapfile can't be validated AND transformed without minor change. In the <Map> root element, If I set xmlns="...", the document validates quite well, but the transformation fails (no output). If I replace the xmlns to xmlns:ms, the mapfile doesn't validate but the transformation works.

comment:12 by nsavard, 13 years ago

Cc: nsavard added

comment:13 by nsavard, 13 years ago

RE comment:11

Tom, did you have a chance to check the validation problem?

in reply to:  13 comment:14 by tomkralidis, 13 years ago

Replying to nsavard:

RE comment:11

Tom, did you have a chance to check the validation problem?

I've made a couple of updates in r9396, so that the XML documents validate, and updated the namespace.

Alan: I'm not able to XSLT the examples in tests/. The XSLT has to refer to MapServer elements with "ms:". I can't seem to get this to work.

comment:15 by dmorissette, 13 years ago

You mean all elements must carry the ms: namespace prefix? Can we not set a default namespace in an XML document to avoid having to explicitly use namespace prefixes for everything?

comment:16 by dmorissette, 13 years ago

Milestone: 6.0 release5.6 release

in reply to:  16 comment:17 by tomkralidis, 13 years ago

Replying to dmorissette: Good point. Right, that's what we're doing in the xml examples. We can add xmlns="http://www.mapserver.org/mapserver" to the mapfile.xsl header to default.

Having said this, the XSLT in trunk is using EXSLT. Setting the default namespace in the XSLT renders no output. I think this is because XMLSpy does not support EXSLT.

Alan: how are you processing XML?

comment:18 by aboudreault, 13 years ago

I'm using the xsltproc utility: http://trac.osgeo.org/mapserver/wiki/XMLMapfiles

comment:19 by tomkralidis, 13 years ago

I can't get this going with EXSLT. Do you have a revision that worked with xsltproc?

comment:20 by aboudreault, 13 years ago

Yes, replace the xmlns to xmlns:ms in the xslt, the mapfile doesn't validate but the transformation works.

comment:21 by tomkralidis, 13 years ago

Alan: see attachement http://trac.osgeo.org/mapserver/attachment/ticket/2872/mstrac-2872.tgz. You'll see that the XML uses the default namespace.

by tomkralidis, 13 years ago

Attachment: mstrac-2872.tgz added

comment:22 by aboudreault, 13 years ago

tomkraladis, may you retest the svn xml schema + xslt with your XML IDE ? Norm did the namespace modification and everything should be fine now.

comment:23 by aboudreault, 13 years ago

XSLT has been updated in r9506. The Wiki page has been updated with an example: http://trac.osgeo.org/mapserver/wiki/XMLMapfiles

in reply to:  22 comment:24 by tomkralidis, 13 years ago

Replying to aboudreault:

tomkraladis, may you retest the svn xml schema + xslt with your XML IDE ? Norm did the namespace modification and everything should be fine now.

With XMLSpy, the schema and sample XML documents validate. I get the following error when trying to transform:

Error in XPath expression
Unknown function - Name and number of arguments do not match any function signature in the static context - 'http://exslt.org/dynamic:evaluate'

comment:25 by aboudreault, 13 years ago

Norm reported that, but we don't know XMLSpy and we were using xsltproc. Was it working in XMLSpy before ?

in reply to:  25 comment:26 by tomkralidis, 13 years ago

Replying to aboudreault:

Norm reported that, but we don't know XMLSpy and we were using xsltproc. Was it working in XMLSpy before ?

I don't think it ever worked in XMLSpy (I think the EXSLT is throwing things off).

comment:27 by aboudreault, 13 years ago

Though I don't really understand why XMLSpy still not support it, I guess the only way to get it working in that software is to set an external xlst program: Tools --> Options --> XSL.

comment:28 by tomkralidis, 13 years ago

I think that would work. However I don't have xsltproc on the machine I'm testing with XMLSpy. Perhaps Norm or someone can try?

comment:29 by nsavard, 13 years ago

Tom: I tested with xmlspy through the xsltproc external processor, the translation was sucessfull.

comment:30 by aboudreault, 13 years ago

Resolution: fixed
Status: newclosed

I've added a note about that on the wiki page. thanks

in reply to:  4 comment:31 by jurien, 12 years ago

Replying to aboudreault:

The schema and the xslt for XML Mapfile seem to be done. The schema allows us to do 3 things:

  • A complete xml mapfile
  • A xml file for layers (for those who would like to separate their project and use the INCLUDE mapfile keyword)
  • A xml file for symbols

I've joined the up-to-date schema and xlst + an example of each xml files. I've tested my schema and the xslt with libxml2 and XMLPad (Windows). Everything seems to work great and there is no parsing error in MapServer (trunk). Tom, Could you made a quick test with XMLSpy 2008?

I've been trying to use XML map files and the template and schema, but, I have multiple include lines. If I apply the template to obtain the map-file, I only get the first include on the xml (include nodes as siblings, children of MAP).

Is there a way to have multiple includes or it isn't supported?

TIA. Regards.

comment:32 by aboudreault, 12 years ago

jurien, I suppose this is a bug yes. Will take a look soon.

comment:33 by dmorissette, 12 years ago

Since a first version of the XML mapfile support has been released already in MS 5.6, perhaps we could give this new issue its own ticket to make it easier to track?

comment:34 by aboudreault, 12 years ago

Yes. Ticket created: #3530

comment:35 by jurien, 12 years ago

Hello everyone,

I've found an inconvenience in the XML definition of a mapfile. I'll try to explain in my poor english, please ask for clarifications where they are needed.

I can write a valid mapfile like :

MAP
  ...
  LAYER
    ...
    CLASS
      ...
      STYLE
        ...
        SYMBOL
          NAME "Pretty Symbol"
          POINTS
            0 1
          END
          TYPE ELLIPSE
          ...
        END
      END
    END
  END
END

I would expect to be able to write the same in an XML :

<Map>
  <Layer>
    <Class>
      <Style>
        <symbol name="Pretty Symbol" type="Ellipse">
          <Points>
            <point x="0" y="1"/>
          </Points>
        </symbol>
      </Style>
    </Class>
  </Layer>
</Map>

But the schema and XSL do not allow this. Only named or indexed symbols allowed here. Is this a bug or a known limitation?

Regards.

Note: See TracTickets for help on using tickets.