-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable libxml2 XInclude functionality for style sheets #567
Comments
[springmeyer] This patch looks great, thanks for the contribution. I've tested, and touched up the tests to be able to go into the main tests directory. One question, would you be able to write a bit of documentation on the xinclude support here: http://trac.mapnik.org/wiki/ManagingLargeXmlFiles You could create a new page or find a place within that one. Let me know what you think. |
[springmeyer] Also I'm thinking its minor, but I like the simple naming of "Include" more than "MapFrag". Would you be open to using "Include" instead? |
[springmeyer] one last thing... any idea why this script does not work with xincludes? http://trac.mapnik.org/browser/trunk/utils/upgrade_map_xml/upgrade_map_xml.py I did add: {{{ Index: utils/upgrade_map_xml/upgrade_map_xml.py--- utils/upgrade_map_xml/upgrade_map_xml.py (revision 2031)
But still get e.g.:
|
[springmeyer] trying again: {{{
|
[oldtopos] Replying to [comment:2 springmeyer]:
http://trac.mapnik.org/wiki/ManagingLargeXmlFiles and modified to reflect addition of Include functionality. Using Include as tag name rather than MapFrag is perfectly acceptable. |
[springmeyer] okay, great to see the docs - excellent, and that you are okay with the "Include" name. I've turned a few more of the docs examples you wrote into tests, and have hit a problem with using both includes and entities together. I'll attach a patch with the tests next, but basically libxml2 appears to be having trouble getting access to the entities when used in an include. Maybe I am using wrong, but at least we should give thought to having a less mysterious error. {{{ this one works:$ nik2img.py tests/data/good_maps/xinclude/map.xml test.png this one does not:$ nik2img.py tests/data/good_maps/xinclude/map_with_entities_and_includes.xml test.png |
[springmeyer] please apply and test with that last attachment. I note that if I take away {{{ the xml can be read I'm running on osx with the stock version of libxml2: {{{ |
[springmeyer] Thanks oldtopos! |
[springmeyer] and tests added in r2113 |
Leverage the XInclude functionality provided by libxml2 to enable style sheets to exist as multiple files, enhancing maintainability.
This changeset adds a new xml tag,
Include
, which serves as a document wrapper of included files. All tags within theInclude
tag are merged into the Map container in the enclosing style sheet.Style sheets wishing to use XInclude must add
xmlns:xi ="http://www.w3.org/2001/XInclude
to the Map tag
Files can then be included using
<xi:include href="style_include.xml">
Simple examples are attached for use as test cases
The text was updated successfully, but these errors were encountered: