This page is no longer maintained — Please continue to the home page at www.scala-lang.org

DTD with relative SYSTEM references

No replies
David Winslow
Joined: 2010-08-26,
User offline. Last seen 42 years 45 weeks ago.
Hi all,
I have found some strange behavior related to DTD handling in the scala.xml package.
Context:
I'm dealing with stylesheets for map rendering.  Specifically, I want to create a conversion tool for importing stylesheets from Mapnik to GeoServer.  I am using the recently released stylesheets from http://open.mapquest.co.uk/ as a sample input to start.  These stylesheets are available on github at http://github.com/MapQuest/MapQuest-Mapnik-Style .
Problem:The Mapquest styles are distributed across several files, using DTD declarations like:
<!ENTITY % entities SYSTEM "mapquest_inc/entities.xml.inc">
 As a sort of #include mechanism.
Symptoms:When I attempt to parse with scala.xml.XML.loadFile("mapquest-uk.xml") I get an exception: 
java.io.FileNotFoundException: /home/dwins/MapQuest-Mapnik-Style/mapquest_inc/mapquest_inc/layers-uk.xml.inc
 The mapquest_inc segment of the path is duplicated.  Interestingly,  this is the second reference to a DTD file in the mapquest_inc/ directory; the first apparently succeeds.  If I modify the file to use absolute paths to reference the DTDs, then it succeeds.
When I attempt to parse with scala.xml.parsing.ConstructingParser.fromFile("mapquest-uk.xml", true), I simply get comments for all entity references indicating that the entity was unknown.
Moving ForwardI'd be happy to submit a patch for this if I knew where to look.  I've been poking around the sources a bit already, but I wasn't able to track down the problem further than what I described above.
thanks for any insight
--David Winslow

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland