OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: XSLT param not passing


This may be more of a strictly XSLT issue, but I figured I'd ask it here in 
case anyone else has run into it.

My increasingly complex project has a number of <book>s in a set.  Each is 
generated independently by an ant task, and has its own customization XSL 
file.  Each book's XSL file imports a shared common file.  

I want to attach a footer to every page (HTML) of every book that is the same 
save for one link, which will depend on the book in question.  (Specifically, 
link to the PDF version of the book.)  So the following seemed to make the 
most sense to me:

1) In each <book>'s customization layer:
<xsl:template name="user.footer.content">
	<xsl:call-template name="copyright.bar">
		<xsl:with-param name="pdffile" select="handbook.pdf"/>
	</xsl:call-template>
</xsl:template>

And vary the value of the parameter in each book's XSL file.

2) In the common customization file:
<xsl:template name="copyright.bar">
	<xsl:param name="pdffile" select="moo" />
	<div class="user-footer-content">
	<!-- various other stuff -->
		<div class="pdflink">
			<xsl:element name="a">
				<xsl:attribute name="href">../pdf/<xsl:value-of
						select="$pdffile"/></xsl:attribute>
				PDF version available
			</xsl:element>
		</div>
	</div>
</xsl:template>

(Wrapped a bit differently in the file, but structurally the same.)

The resulting output I'd expect in this (again, wrapped differently):

<div class="user-footer-content">
	<div class="pdflink">
		<a href="../pdf/handbook.pdf">PDF version available</a>
	</div>
</div>

However, the value of the parameter is not being used, so I end up with a link 
to just "../pdf".  Even the default value of "moo" is not used.  

I'm pretty sure my syntax is correct, since I've written plenty of XSLT 
templates before and have checked against them, but for some reason I can't 
get it to reference the variable properly.  

Can anyone shed some light on this?  Thanks.  (I will have more silly 
questions soon, worry not.)

-- 
Larry Garfield			AIM: LOLG42
larry@garfieldtech.com	ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]