Hi Jamie,

Yes, Nik2img should handle loading XML and XML entities no differently  
than mapnik does in general.

All nik2img does is call mapnik.load_map() internally.

On Apr 23, 2009, at 8:10 AM, Jamie Robertson wrote:

> I've recently converted portions of my XML mapfile to use the XML  
> entities syntax.
>
> information on managing large XML files and XML entities here:
> http://trac.mapnik.org/wiki/ManagingLargeXmlFiles#MapnikXMLsupport
>
> My xml mapfile works fine and renders images correctly based on the  
> XML entities i provide when i view it with my tilecache/Openlayers  
> setup, however, when i render the same XML mapfile with Nik2IMG, i  
> get the following error:
>
> // --> Problem loading XML mapfile (hint: xml_entities require  
> libxml2):
>
>  XML document not well formed:
> xmlParseEntityRef: no name in file '/media/data/mapfile/mapfile.xml'  
> at line 397
>

First, that 'hint' I've recently removed from the Nik2img error  
reporting because it is too often a red herring. In this case I think  
it is as well.

I bet that you are running libxml2 and it is simply a parsing error  
that is being thrown not by Mapnik but by libxml2.

Things that might be causing it:

1) some character that is not encoded, such as a '>' that should be  
'>'

2) The user running nik2img does not have proper permissions to access  
one of your entity files.

3) The paths to one of the entities is relative or otherwise not  
available for the nik2img process.

If these ideas don't help can you:

1) Simply try loading the xml in an interpreter session from the same  
directory you are running nik2img:

$ cd <dir you ran nik2img>
$ python
 >>> import mapnik
 >>> m = mapnik.Map(1,1)
 >>> mapnik.load_map(m,'/media/data/mapfile/mapfile.xml')

And then see what happens...


Dane


_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to