On Sun, Mar 11, 2007 at 05:41:23AM EST, Jirka Kosek wrote:
> cga2000 wrote:
>
> > Would anyone know whether I can use the same
strategy to specify
> > alternate css stylesheets that I can switch to on
the fly while browsing
> > the html document?
> >
> > Or do I need to specify the alternate CSS style
sheets in the prolog of
> > each DocBook/XML document?
> >
> > At this point I modify the XSL fragment above and
regenerate the html
> > documents every time I want to switch style
sheets, which is slow and
> > error-prone.
>
> You can emit all necessary link elements by overriding
user.head.content
> template:
>
> <xsl:template
name="user.head.content">
> <link .../>
> <link .../>
> </xsl:template>
I replaced my XSL fragment by:
------------------------------------------------------------
--------------
<?xml version='1.0'?>
<xsl:template name="user.head.content">
<link href="walsh.css"
title="walsh" rel="stylesheet"
type="text/css"/>
<link href="sgh.css" title="alt"
rel="alternate stylesheet"
type="text/css"/>
</xsl:template>
------------------------------------------------------------
--------------
ran:
$ xmlto -vv -m ../xsl-dir/alt1.xsl -o ../html-dir/cheat html
cheat.xml
And I get the following error:
------------------------------------------------------------
--------------
Format script: /usr/share/xmlto/format/docbook/html
Convert to HTML (with chunks)
Real stylesheet: http://docbook.sourceforge.net/release/xsl/curr
ent/html/chunk.xsl
xmllint >/dev/null --xinclude --postvalid
/home/gavron/devel/docbook/tests/xml-dir/cheat.xml
Stylesheet: /tmp/xmlto-xsl.ZgvmEr
xsltproc --nonet --xinclude
-o /tmp/xmlto.u4OQ5s/cheat.proc
/tmp/xmlto-xsl.ZgvmEr
/home/gavron/devel/docbook/tests/xml-dir/cheat.xml
/home/gavron/devel/docbook/tests/xml-dir/../xsl-dir/alt1.xsl
:2: namespace error : Namespace prefix xsl on template is
not defined
<xsl:template name="user.head.content">
^
compilation error: file
/home/gavron/devel/docbook/tests/xml-dir/../xsl-dir/alt1.xsl
line 2 element template
xsltParseStylesheetProcess : document is not a stylesheet
cp: cannot stat `*': No such file or directory
------------------------------------------------------------
--------------
Does this mean that he's not finding the
"user.head.content" template
on my system?
Could this be because I do not have this particular template
installed
on my system, possibly because I'm running this on a system
that's
fairly ancient?
The only html template I found on my system is
nwalsh/html/titlepage.templates.xsl.
Naturally, it could be just a syntax error in my coding. I
don't know
XSL so I'm just guessing.
Thanks,
cga
------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-unsubscribe lists.oasis-open.org
For additional commands, e-mail: docbook-help lists.oasis-open.org
|