Subject: XML and relative paths in htdocs
To: None <netbsd-docs@NetBSD.org>
From: Klaus Heinz <k.heinz.dez.fuenf@onlinehome.de>
List: netbsd-docs
Date: 12/10/2005 20:53:24
Hi,

I would like to pick up a thread from earlier this year

  "better integration of news pages for NetBSD and pkgsrc"
  http://thread.gmane.org/gmane.os.netbsd.documentation/969

  [ XML-file with news entries, re-usable in different documents ]

In this case (and in several others, probably) we need a list of
objects which can be used in several documents.
Hiroki Sato already provided some patches to implement this for
htdocs/Changes/*.

Looking at this again, I found we still have at least one problem with
this approach: Today we use <ulink> for cross references / links to
other documents which is fine for absolute URLs. This can fail miserably
if we have relative paths for "url" attributes in an <ulink> element 
and then include such an element in more than one document at different
levels in the directory hierarchy.

If nobody has a better idea, we may have to start using (and converting
existing XML files to use) <olink> elements. I had a brief look at how
<olink> works (http://www.sagehill.net/docbookxsl/Olinking.html#LinkBetweenDocs)
and I think it needs a bit of infrastructure to determine the relative
paths during XSLT transformation. It seems to be somewhat similar to
the layout.xml/autolayout.xml scheme.

Instead of using
  <ulink url="../../Bla/foo.html#some.anchor.id" />

we would then have

  <olink targetdoc="doc.foo.id" targetptr="some.anchor.id" />

which should be resolved to different "href" attribute values in the
resulting HTML (or whatever is used in PDF, when we come to that point), 

Comments?

ciao
     Klaus