Updated Managing complex map files using XML entities (markdown)

ThomasG77 2011-12-27 11:07:18 -08:00
parent 6b15f5911a
commit 09f40a0ba0

@ -9,14 +9,14 @@
Mapnik XML files can become quite complex. This tutorial introduces some Mapnik XML files can become quite complex. This tutorial introduces some
techniques to keep large map files more maintainable. Specifically it techniques to keep large map files more maintainable. Specifically it
demonstrates how to avoid duplicate data in the XML file, like: demonstrates how to avoid duplicate data in the XML file, like:
- color values
- database connection parameters * color values
- icon directories * database connection parameters
* icon directories
It also shows how to split a single, monolithic map file into reusable It also shows how to split a single, monolithic map file into reusable
components using external entities and XInclude. components using external entities and XInclude.
## Mapnik XML support ## Mapnik XML support
Mapnik currently supports three different XML parsers: Mapnik currently supports three different XML parsers:
@ -30,7 +30,6 @@ features they support. The most comprehensive parser is the libxml2 parser and
it is the only one that supports XML entities. As of Mapnik 0.6.0 libxml2 is the default it is the only one that supports XML entities. As of Mapnik 0.6.0 libxml2 is the default
when building the Mapnik source with SCons, and available in the Windows binaries as of 0.6.1. when building the Mapnik source with SCons, and available in the Windows binaries as of 0.6.1.
## Compiling mapnik with libxml2 support ## Compiling mapnik with libxml2 support
If not default in your Mapnik version (< 0.6.0) the libxml2 parser is enabled by setting the XMLPARSER option at If not default in your Mapnik version (< 0.6.0) the libxml2 parser is enabled by setting the XMLPARSER option at
@ -55,11 +54,11 @@ For example, if you have installed the latest libxml2 on mac os x via Macports,
All XML parsers have some built-in entities to escape otherwise illegal All XML parsers have some built-in entities to escape otherwise illegal
characters: characters:
* &gt; * `&gt;`
* &lt; * `&lt;`
* &amp; * `&amp;`
* &quot; * `&quot;`
* &apos; * `&apos;`
The XML document type definition (DTD) provides a way to declare new, user The XML document type definition (DTD) provides a way to declare new, user
defined entities: defined entities: