Hi Sam,
As you found out, the body of a xsl:call-template can only take
xsl:with-param children, not any other content such as that generated by
xsl:apply-imports.
The basic problem is that this template:
<xsl:template match="link" name="link">
was not written to accept the hot text as a parameter. Instead, you should
look at the template named "simple.xlink" which is used by the "link"
template. The "simple.xlink" templates takes both linkend and content
parameters. Put the apply-imports into the content parameter.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
[EMAIL PROTECTED]
----- Original Message -----
From: "Sam Steingold" <[EMAIL PROTECTED]>
To: "DocBook Apps" <[email protected]>
Cc: "Bob Stayton" <[EMAIL PROTECTED]>
Sent: Monday, October 15, 2007 11:31 AM
Subject: xsl:call-template: misplaced xsl:apply-imports
I want
<filename role="module">queens</filename>
to be converted to
<span class="module"><a href="clisp-cvs/queens/">
[whatever docbook wants to format filenames with]queens[/]
</a></span>
while
<filename role="module" path="rasock-mod">rawsock</filename>
to be converted to
<span class="module">
[whatever docbook converts the following]
<link linkend="rasock-mod"><filename>rawsock</filename></link>
or (whatever is easier)
<filename><link linkend="rasock-mod">rawsock</link></filename>
[/]
</span>
I.e., then path= is supplied, it is used as a link into the current
document, otherwise an external link into the CVS should be generated.
so far I came up with
<xsl:param name="clisp.cvs.top"
select="'http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/'"/>
<xsl:template match="[EMAIL PROTECTED]'module']">
<xsl:message>Module [<xsl:value-of select="."/>] path=[<xsl:value-of
select="@path"/>]:</xsl:message>
<span class="[EMAIL PROTECTED]">
<xsl:choose><xsl:when test="@path"><xsl:call-template name="link">
<xsl:with-param name="linkend" select="@path"/><xsl:apply-imports/>
</xsl:call-template></xsl:when>
<xsl:otherwise><a href="{$clisp.cvs.top}modules/{.}/">
<xsl:apply-imports/></a></xsl:otherwise></xsl:choose></span>
</xsl:template>
so far the "cvs" ("otherwise") part appears to work, but the "link" part
("when") is broken: I get these messages:
Module [rawsock] path=[rawsock]:
xsl:call-template: misplaced xsl:apply-imports
Module [fastcgi] path=[fastcgi]:
xsl:call-template: misplaced xsl:apply-imports
if I follow
http://www.sagehill.net/docbookxsl/AddNewTemplate.html#AddProcessingSteps
and take <xsl:apply-imports/> _outside_ of <xsl:call-template
name="link">, I get the text ("gdbm") appear twice in the output: first
time formatted as a link and the second time formatted as a pathname,
instead of _once_ formatted both as a filename (<code class="filename">)
_and_ a link in the document.
please help!
thanks!
Sam.
PS. Bob, this is my 3rd attempt to send the message to the mailing list
in the last day, I do not see the first 2 messages on the list, and no
rejection or error messages, so I am lost. If you could be so kind to
reply to this message on the list, it would be very nice of you! Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]