Skip to content

Conversation

Copy link

Copilot AI commented Nov 21, 2025

Mapnik does not support DTD/ENTITY declarations. The main stylesheet referenced 73+ external files via XML entities, causing parsing failures.

Changes

  • Removed DTD/ENTITY system: Eliminated DOCTYPE declaration and all entity definitions
  • Inlined external content: Merged 73 style files from styles-otm/*.xml, include files (fontset-settings.xml.inc, postgis-settings.xml.inc), and entity definitions from inc/entities.xml.inc
  • Preserved standard XML entities: Kept < and > for literal characters
  • Updated .gitignore: Added *.bak pattern

Result

File expanded from 712 to 9,127 lines. All 80 styles, 62 layers, and 1,121 rules now inline. Validated with Python XML parser - all element counts match original.

Before:

<!DOCTYPE Map [
  <!ENTITY landuse SYSTEM "styles-otm/landuse.xml">
  <!ENTITY maxscale_zoom16 "<MaxScaleDenominator>12500</MaxScaleDenominator>">
  ...
]>
<Map>
  &landuse;
  <Rule>
    &maxscale_zoom16;
  </Rule>
</Map>

After:

<Map>
  <Style name="landuse">
    <!-- Direct content from styles-otm/landuse.xml -->
  </Style>
  <Rule>
    <MaxScaleDenominator>12500</MaxScaleDenominator>
  </Rule>
</Map>
Original prompt

Remove xml entities system from xml files. Flatten all of them on opentopomap.xml file. Mapnikt does not support DTD / ENTITY system.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Nobatgeldi <11710280+Nobatgeldi@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove XML entities system and flatten XML files Flatten XML entities in opentopomap.xml for Mapnik compatibility Nov 21, 2025
Copilot AI requested a review from Nobatgeldi November 21, 2025 16:39
Copilot finished work on behalf of Nobatgeldi November 21, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants