NET-Mapnik icon indicating copy to clipboard operation
NET-Mapnik copied to clipboard

Unresolved XML entities

Open fcharp opened this issue 9 years ago • 2 comments

I've had this problem for a few days now. In order to try and avoid bugging you, I rebuilt NETMapnik with the following config:

  • VS 2015 (14.024) Professional
  • .NET 4.5.2
  • x64
  • Mapnik 3.100
  • Boost 1.100

Building NetMapnik put up a fight, but it's all good now, and the various c# tests included in the snapshot are working. What's not working: when using Map.Load("foo.xml"), XML references are unresolved and throw an exception. Just to be clear: I tested the XML file with mapnik.dll and it worked fine. To make absolutely sure that it was not an external file issue, I tested this:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map [
  <!ENTITY srs900913 "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">]>
<Map srs="&srs900913;">
</Map>

Map.Load comes back with "failed to initialize projection with: '&srs900913;' ". If I replace the reference in "srs=" with the definition, it works. That seems to suggest that the parser is working, but not able to resolve references. Of course, I always live with the nagging doubt that I am missing something that's staring right at me :-). I thought that you may have an idea. Short of that, I am faced with rebuilding libxml2 in order to step through the code, which is not something I am really crazy about at this time.

P.S.: if I can get this resolved, I will be happy to send you the build for VS2015. Other than type conversion warnings, it seems to do the job.

fcharp avatar Apr 07 '16 18:04 fcharp

Just to be clear: I tested the XML file with mapnik.dll and it worked fine.

Interesting, since entities are only supported if mapnik is built with libxml2.

Previous issues: https://github.com/mapnik/mapnik/issues/3112 https://github.com/mapnik/mapnik/issues/2570

wilhelmberg avatar Apr 07 '16 20:04 wilhelmberg

Thank you so much for the reply. I feel bad for not digging deep enough in the blogs. Re: mapnik.dll. You are right: I was using the examples from mapnik-fork, which included a different dll. My bad again. I will go on with the pointers you gave me. Thanks for looking so diligently after the project.

fcharp avatar Apr 08 '16 16:04 fcharp