[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: apply-templates with-param failed

Subject: RE: apply-templates with-param failed
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 27 Sep 2005 09:14:23 +0100
apply templates with param
You haven't shown us the source document. Perhaps its outermost element
isn't called BugCollection, or perhaps it's in a namespace.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Xiaocun Xu [mailto:xiaocunxu@xxxxxxxxx] 
> Sent: 27 September 2005 02:08
> To: xsl-list
> Subject:  apply-templates with-param failed
> 
> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.