Andreas Delmelle wrote:
On Jul 12, 2008, at 14:57, Jeremias Maerki wrote:
On 12.07.2008 14:49:03 Andreas Delmelle wrote:
Going through the occurrences, I'm getting the impression that in
some cases, we don't even really need the URL. The URI would do just
fine if we don't need the functionality for opening a stream... Maybe
in this particular case, passing through a URL could also be avoided
(?) If the error is generated by the used StreamResult implementation
calling File.toURL(), then something like:
Result res = new StreamResult(outputFile.toURI().toASCIIString());
would already be enough (?)
In most cases, yes. But there's really a difference between a URI and a
URL. But what's confusing is the following (the Javadocs for
StreamSource):
<quote>
public StreamSource(String systemId)
Construct a StreamSource from a URL.
Parameters:
systemId - Must be a String that conforms to the URI syntax.
</quote>
URL and URI are both used here. But I think "URL" is the mandatory term
here. The other thing is "URI Syntax" which does not refer to "URI"
itself. Since a URL is a URI, but not all URIs are URLs, I believe your
example above is slightly incorrect.
Nice catch. For the moment, better to be safe than sorry. Indeed, a URI
could also be something not referring to a file (or, better put: a valid
input source for a transformation)
Strictly speaking, according to the above definition, the systemId is
allowed to be a 'mailto:' (?) :-/
Sloppy editors... ;-)
I don't think so. The docs for java.net.URL include
"The syntax of URL is defined by RFC 2396: Uniform Resource Identifiers
(URI): Generic Syntax, amended by RFC 2732: Format for Literal IPv6
Addresses in URLs."
That is, the syntax for URLs is defined as part of the URI syntax.
--
Peter B. West <http://cv.pbw.id.au/>
Folio <http://defoe.sourceforge.net/folio/>