#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 )
Ticket to track changes with regards to RFC 51, XML/BXML Mapfiles:
Attachments (11)
Change History (46)
by , 15 years ago
Attachment: | mapfile-0.1.xsd added |
---|
comment:1 by , 15 years ago
Description: | modified (diff) |
---|---|
Summary: | RFC 51 implementation → RFC 51 implementation: XML/BXML Mapfiles |
by , 15 years ago
Attachment: | mapfile-0-0-2.xsd added |
---|
by , 15 years ago
Attachment: | mapfile-0.0.3.xsd added |
---|
comment:2 by , 15 years ago
Milestone: | 5.4 release → 6.0 release |
---|---|
Summary: | RFC 51 implementation: XML/BXML Mapfiles → RFC 51 implementation: XML Mapfiles Format |
by , 15 years ago
Attachment: | mapfile-0.0.4.xsd added |
---|
by , 14 years ago
Attachment: | mapfile-schema-0.0.6.xsd added |
---|
by , 14 years ago
Attachment: | mapfile-xslt-0.0.4.xsl added |
---|
follow-up: 31 comment:4 by , 14 years ago
Cc: | 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 , 14 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 , 14 years ago
Attachment: | mapfile-0.0.7.zip added |
---|
comment:6 by , 14 years ago
Cc: | added |
---|
To simplify updates, why don't we put everything in SVN, perhaps in a new "xmlmapfile" sub-directory?
comment:8 by , 14 years ago
Component: | MapServer C Library → MapServer Documentation |
---|
Committed in r9273.
comment:9 by , 14 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:11 by , 14 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 , 14 years ago
Cc: | added |
---|
follow-up: 14 comment:13 by , 14 years ago
RE comment:11
Tom, did you have a chance to check the validation problem?
comment:14 by , 14 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 , 14 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?
follow-up: 17 comment:16 by , 14 years ago
Milestone: | 6.0 release → 5.6 release |
---|
comment:17 by , 14 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 , 14 years ago
I'm using the xsltproc utility: http://trac.osgeo.org/mapserver/wiki/XMLMapfiles
comment:19 by , 14 years ago
I can't get this going with EXSLT. Do you have a revision that worked with xsltproc?
comment:20 by , 14 years ago
Yes, replace the xmlns to xmlns:ms in the xslt, the mapfile doesn't validate but the transformation works.
comment:21 by , 14 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 , 14 years ago
Attachment: | mstrac-2872.tgz added |
---|
follow-up: 24 comment:22 by , 14 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 , 14 years ago
XSLT has been updated in r9506. The Wiki page has been updated with an example: http://trac.osgeo.org/mapserver/wiki/XMLMapfiles
comment:24 by , 14 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'
follow-up: 26 comment:25 by , 14 years ago
Norm reported that, but we don't know XMLSpy and we were using xsltproc. Was it working in XMLSpy before ?
comment:26 by , 14 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 , 14 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 , 14 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 , 14 years ago
Tom: I tested with xmlspy through the xsltproc external processor, the translation was sucessfull.
comment:30 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've added a note about that on the wiki page. thanks
comment:31 by , 13 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:33 by , 13 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:35 by , 13 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.
Here's a first prototype of the XML/Mapfile Schema.