URI's for local files

Questions about XML that are not covered by the other forums should go here.
madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

URI's for local files

Post by madde001 » Wed Feb 16, 2005 8:39 pm

George et al,

Can you help me get straight in my confused mind what format(s) I can/should use for uri references to local files inside my xml? I know this is a vexing issue in a lot of contexts, and I'm trying to figure out what oxygen's understanding is driven by (Java, oxygen envrinoment, the parser being used or something else).

The relevant RFC's are evidently debated, as I understand it, but in the (practical) Mozilla world, either of the following are equally valid uri's for a file foo.bar on the local Windows C: drive:
(1) file://localhost/C:/foo.bar
(2) file:///C:/foo.bar

but Mozilla will also accept (after forcing a change to (2)):
(3) file:/C:/foo.bar

In my xml source with oxygen, it seems like (2) and (3) are okay, but (1) gives java.io.FileNotFoundException.

Is that a function of the parser, or the oxygen shell, or Java or something else? What *should* I be using (is there a best practice?)

John

madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

specifically...

Post by madde001 » Wed Feb 16, 2005 8:56 pm

I should have been more specific, when I said "in my xml".

I mean, when the uri is used as the value of the the href attribute of an include element in an RNG file.

Dan
Posts: 433
Joined: Mon Feb 03, 2003 10:56 am

Post by Dan » Thu Feb 17, 2005 5:08 pm

Hello John,

We are using the expressions of type:

file://host/path

in the context of a MS Windows network, by resolving it to \\host\path (Windows shared folders). In this way the editor can access network resources and use only the URL format for keeping track to any loaded file.

We are commonly using the third variant you enumerated for the local files.

Let me know if you need more info.

madde001
Posts: 80
Joined: Fri Apr 23, 2004 5:24 pm
Location: Durham, NC, USA

Post by madde001 » Thu Feb 17, 2005 7:30 pm

Dan,

Thanks, that helps a lot. My confusion was precisely the presumption of a Windows *share*-- which makes perfect sense (though may not always be the case while testing under development).

Just to show how screwed up this whole area is, I found a recent IETF draft proposal that doesn't really propose *anything* yet, but *does* give a nice discussion of all the various bizarre variants that are floating around out there.

http://www.ietf.org/internet-drafts/dra ... uri-03.txt


John

Post Reply