You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Currently, when calling
load(url: URL)
, the original URL is not set as the systemId on theInputSource
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:
will cause the parser to try to locate
./test.dtd
in the current working directory. According to the JavaDoc ofInputSource
: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.
The text was updated successfully, but these errors were encountered: