Absolute links for cross-platform working

Questions about XML that are not covered by the other forums should go here.
ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

Absolute links for cross-platform working

Post by ra0543 » Tue Mar 09, 2010 12:10 am

What I have is not technically an XML problem, but I hope someone on here can suggest some solutions, since it arises in the context of collaborative working on XML data.

We have a mixed PC and Apple environment and keep our data stored on a network drive accessible to all machines. We have on that drive a large number of XML files, XSD schemas, XSL transformations, and CSS stylesheets. These are mainly mainly set up with relative links between them (e.g. within the XML files to their schemas and stylesheets), e.g.

<?xml-stylesheet type="text/css" href="Stylesheets/Basic.css" title="Normal" alternate="no"?>

On Windows machines we in fact map the network drive to Z:

For some files we have to use absolute links (because the relative position of the files to the stylesheets and schema can change):

<?xml-stylesheet type="text/css" href="z:\Data\Stylesheets\Basic.css" title="Normal" alternate="no"?>

What I want to know is what form to use for absolute links to ensure that the references work when editing the files regardless of whether they are being accessed from Apple or PC.

I guess I could maybe use the \\server\sharename\ ... form (how?) but that raises a different problem ...

A subsidiary problem is offline working. On Windows machines (e.g. for laptops to be used away from the office), we can simply make a copy of the relevant part of the z: drive onto the local disk and then temporarily remap the z: to point to that directory using subst; all the absolute links then work fine.

Assuming I can find an easy way even to make a similar copy to the local disk of our Apple laptops, can I make the same references work (i.e. without having to change them)?

Any guidance for dealing with the apparently lunatic Apple file system gratefully received.

adrian
Posts: 2659
Joined: Tue May 17, 2005 4:01 pm

Re: Absolute links for cross-platform working

Post by adrian » Tue Jun 08, 2010 12:51 pm

Hello,

Apologies for the late reply.

The problem here is that you are using a network share from multiple platforms and I really see no way of making this work cross-platform with absolute paths

The simplest way to resolve this would be to have a repository that can be accessed via HTTP. Since a HTTP URL works the same on all platforms it will be a lot simpler to access.
I guess a Version Control System(e.g. Subversion) that can be accessed via HTTP(read-only) would resolve this.
The only problem I see is that if you need to make changes to the common stylesheets and schemas will also need to check out a working copy from the repository, make the required modifications and then commit them back to the repository so that they can be available to everyone else.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

Re: Absolute links for cross-platform working

Post by ra0543 » Wed Jun 09, 2010 12:17 am

Thanks. That was roughly what I thought, but it is helpful to have it confirmed by someone who knows more about these things than I do.

We're just going to abandon the Macs, which - stylish though they may be - are evidently far more use for propping up wobbly tables and wedging doors open than any form of collaborative working in an environment where people need to work on files sometimes on- and sometimes offline.

I had thought about SVN but I can't host that on our Buffalo NAS drive; also I think using a version control system will be technically beyond most of the potential users, who are presently Mac users (i.e. barely computer literate). You highlight the relevant problem of checking things out and in. I could do that easily enough, but I very much doubt they would cope with that.

adrian
Posts: 2659
Joined: Tue May 17, 2005 4:01 pm

Re: Absolute links for cross-platform working

Post by adrian » Wed Jun 09, 2010 10:02 am

Well, to accommodate the less tech-savvy people the trick is to use HTTP URLs directly to the repository, this way they won't need to know anything about that. And since they probably don't need(or know how) to change the stylesheets or the schemas from the repository they won't have to check out and in a working copy.

Regarding the server, I guess you would need a more flexible solution for the repository even though there are some "unofficial" solutions for setting up a SVN server on a smart NAS drive(assuming it runs a flavour of Linux) but they aren't exactly recommended in a business environment.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Post Reply