xsl-list
[Top] [All Lists]

RE: apply-templates with-param failed

2005-09-27 01:14:23
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(_at_)yahoo(_dot_)com] 
Sent: 27 September 2005 02:08
To: xsl-list
Subject: [xsl] 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>