Skip to content
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

XMLLoader.load(url: URL) does not include the url as a systemId in the InputSource #5101

Closed
scabug opened this issue Oct 20, 2011 · 2 comments

Comments

@scabug
Copy link

scabug commented Oct 20, 2011

Currently, when calling load(url: URL), the original URL is not set as the systemId on the InputSource returned. If your XML documents refers to a DTD using a relative URL, then Scala will try to resolve that relative link based on the current working directory, rather than the location of the file.

So, this at the beginning of an XML file:

<!DOCTYPE countries PUBLIC "foo//bar" "./test.dtd">

will cause the parser to try to locate ./test.dtd in the current working directory. According to the JavaDoc of InputSource:

bq. The system identifier is optional if there is a byte stream or a character stream, but it is still useful to provide one, since the application can use it to resolve relative URIs and can include it in error messages and warnings (the parser will attempt to open a connection to the URI only if there is no byte stream or character stream specified).

I think this is pretty common in Java XML libraries these days. Not having it in Scala is unexpected.

@scabug
Copy link
Author

scabug commented Oct 20, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5101?orig=1
Reporter: Wilfred Springer (wilfredspringer)
Affected Versions: 2.9.2

@scabug
Copy link
Author

scabug commented Jul 17, 2015

@SethTisue said:
The scala-xml library is now community-maintained. Issues with it are now tracked at https://github.com/scala/scala-xml/issues instead of here in the Scala JIRA.

Interested community members: if you consider this issue significant, feel free to open a new issue for it on GitHub, with links in both directions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant