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: Re: [docbook-apps] XSLT param not passing


Hi Larry,

[...]
 > <xsl:param name="pdffile" select="moo" />
[...]
 > 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.
[...]


The default value for pdffile parameter is the content of the moo 
element as a child of the current node. Assuming there is no moo element 
then the parameter value is the empty string and this seems to be 
exactly the result you obtain.

If you want to pass the string moo as default value then you should 
surround it with apostrophes:
<xsl:param name="pdffile" select="'moo'"/>

The simplest way to see what happens is to run the transformation 
through a debugger. That should allow you to see what templates are 
called and from where and look at the parameters and see their values.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Larry Garfield wrote:
> 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.)
> 


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