[xsl] apply-templates with-param failed

Subject: [xsl] apply-templates with-param failed
From: Xiaocun Xu <xiaocunxu@xxxxxxxxx>
Date: Mon, 26 Sep 2005 18:08:06 -0700 (PDT)
Hi,

I am working on splitting a FindBugs result XML into
multiple XMLs by finding keywords in Class/@classname.
 Keywords for all functional areas are defined in
FunctionalAreaDef.xml:
<Application>
	<FunctionalArea name="message">
		<Keywords>
			<Keyword>notification</Keyword>
			<Keyword>message</Keyword>
		</Keywords>
	</FunctionalArea> ...
</Application>

I use the following XSL to read FunctionalAreaDef.xml,
loop through each FunctionalArea element, create an
output file using the FunctioalArea/@name and pass
Keywords to BugCollection element(in the source
FindBugs XML):
<xsl:variable name="vFunctionalArea"
select="document('FunctionalAreaDef.xml')"/>
<xsl:template match="/">
	<xsl:for-each
select="$vFunctionalArea/Application/FunctionalArea">
		<xsl:call-template name="splitByFunctionalAreas">
			<xsl:with-param name="pFunctionalAreaDef"
select="."/>
		</xsl:call-template>
	</xsl:for-each>
</xsl:template>
<xsl:template name="splitByFunctionalAreas">
	<xsl:param name="pFunctionalAreaDef" select="."/>
	<xsl:variable name="vFileName"
select="$pFunctionalAreaDef/@name"/>
	<xsl:result-document href="{$vFileName}_bugs.xml">
		<xsl:apply-templates select="BugCollection">
			<xsl:with-param name="pKeywords"
select="$pFunctionalAreaDef/Keywords"/>
		</xsl:apply-templates>			
	</xsl:result-document>
</xsl:template>
<xsl:template match="BugCollection">
	<xsl:param name="pKeywords" select="."/>
	<xsl:value-of select="$pKeywords"/>
	...
	
Somehow the BugCollection template did not get evoked
as <xsl:value-of select="$pKeywords"/> seems not
evaluated (the output file is empty with just a XML
header).  I used matching mode as well, still no luck.
 Any suggestion on what have I done wrong would be
much appreciated.

thanks,
Xiaocun


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Current Thread