stevedlawrence commented on PR #1067:
URL: https://github.com/apache/daffodil/pull/1067#issuecomment-1681007284

   > I wonder why only the Main class needed to be changed?
   
   The Main class expects `Strings` that are file paths (or also Java resource 
paths), and file paths aren't necessarily URIs on windows, hence this stuff 
that Main has to do to convert these strings to URIs. Note that we could just 
do `Paths.get(s).toUri.toString` and pass that into `resolveSchemaLocation`, 
letting `Paths.get()` handle all the weirdness around resolving relative paths 
on different OSes. But that doesn't work with classpath resources. It also 
means we lose relative path information which I'm hoping to avoid (`toUri()` 
always returns an absolute URI, I think because not all relative Windows paths 
can be converted a relative URI). I *think* it might be useful to keep URIs 
relative as part of depersonalizing schema paths in saved parsers (see my 
comments in PR #1065). This commit doesn't attempt to address that PR, but it 
at least doesn't make things harder.
   
   The `schemaLocation` attribute in a XSD schema *must* be a URI, regardless 
of OS. So we just treat that attribute as if it were a URI. Nothing fancy here.
   
   The Scala/Java API `compile` functions only accept a `File` or a `URI`, so 
we don't have to do anything fancy there either. We assume the user knew how to 
create one of those.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to