Hi Jennifer,
This is curious. There are almost no constraints on where the various
stylesheet modules are located. They can be scattered over many
directories, as the DocBook XSL files are. You could even import with an
http URL.
In general, a relative import address is taken as relative to the file that
contains the xsl:import element. That keeps things pretty simple,
fortunately. For each import, you just have to confirm the location relative
to that file. Once you import the DocBook docbook.xsl file, it will handle
its own relative imports.
Arranging your customization files outside the distributed files is good
practice, not foolish, and highly recommended for easy maintenance and
updates. But clearly something is going wrong with your setup. I can't
tell what it is from the information so far. Can you provide more details?
That kind of error means some XSL files are not being read for some reason.
Are there no other error messages?
Bob Stayton
Sagehill Enterprises
[email protected]
----- Original Message -----
From: "Jennifer Moore" <[email protected]>
To: <[email protected]>
Sent: Monday, March 30, 2009 2:12 PM
Subject: [docbook-apps] XSL customisation layer: directory structure
Hello all
(and a belated thanks to Mauritz and Bob for helpful replies to my last
question, which I seem to have neglected to report back on at the time -
have got link title attributes working nicely now via XLink.)
I'd been thinking I'd like to learn how to do a custom layer of XSL, so
as to tweak my HTML output a bit.
I've successfully made an initial file as described in Bob's book
(example 9.1 here:
http://www.sagehill.net/docbookxsl/CustomMethods.html#CustomizationLayer)
and begun to create my own templates, of which I currently have a couple
in separate files, imported e.g. like this to the main one:
<xsl:import href="emphasis_custom.xsl"/>
Well, I was getting on OK until I got the bright idea that perhaps it
would be best to move the various custom files into a separate directory
rather than having them mixed in with the default ones. At that point
things stopped working. So now I am wondering if in fact that was a
foolish idea :-)
Is it _possible_ to use different directories, and if so, what do I need
to do to make the relative addressing work so the templates can "see" each
other?
Or do the custom files have to be in the same directory as the docbook
default ones? and in that case, is there any particular naming
convention, for making the custom files easily identifiable if & when I
upgrade and want to copy them over?
For background, here's what I did:
First I had set up a subdirectory of the html directory, and made my "top
level" custom file call docbook like this:
<xsl:import href="../docbook.xsl"/>
It wasn't happy till I corrected the relative addressing for
<!ENTITY % common.entities SYSTEM "../common/entities.ent">
%common.entities;
]>
by making it
<!DOCTYPE xsl:stylesheet [
<!ENTITY % common.entities SYSTEM "../../common/entities.ent">
%common.entities;
]>
Then I got errors like "No template exists named anchor".
Then as an alternative I tried making a custom directory at the same level
as the html directory, with
<xsl:import href="../html/docbook.xsl"/>
and changing the ENTITY thing above back to what it was before.
But I was still getting error messages of "No template exists named ...".
It seemed like one template could only "see" another if they were in the
same directory.
(though oddly enough it doesn't seem to mind having the "main" custom
layer file in another directory - but then at present that one isn't
calling any templates, only importing others that do.)
Thanks in advance for clues.
Jennifer
--
www.uncharted-worlds.org/blog/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]