This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: apply templates with with-param on Xalan


 David,
  thanks for this.  Your change works.  I didnt
put the /list on the document() call because
I didnt want to expose the structure of the list to the calling template.  The calling template xsl:includes an xsl template for processing lists.  The idea I wanted to realise here was that I could get lists from other sources with different structures, and as long as I create and include a template for them, the main transform would still work.

So now Im unsure how to proceede.  I still dont understand why the parameter is not set up, even though (it seems) the list root element has been correctly matched.  But when I add the /list to the document() call, the parameter is correctly set up. 

Sorry if this is obvious stuff...im on day 8 of my xslt learning curve.
--


On Mon, 24 Jul 2000 16:51:07   David Carlisle wrote:
>
>  <xsl:template match="completely-unlet" name="completely-unlet">
>    <xsl:variable name="completely-unlet" 
>       select="document('rbscommon/binary-list.xml')"/>
>    <xsl:apply-templates select="$completely-unlet">
>    <xsl:with-param name="pname" select="'completely-unlet'"/>
>   </xsl:apply-templates>
>  </xsl:template> 
>
>Why do you have the variable here? rather than just putting the
>document() call in the apply-templates select?
>
>But either way you have selected the root node of the document.
>So unless you have defined a template for a root node that accepts
>a parameter pname and passes it down with apply-templates, then
>this parameter will have no effect.
>
>If list is your document element, then as al alternative to specifying a
>new template for / you can instead select list directly:
>
>
><xsl:template match="completely-unlet" name="completely-unlet">
>
>  <xsl:apply-templates select="
>      "document('rbscommon/binary-list.xml')/list">
>                                    <!--   ^^^^^^^  -->
>    <xsl:with-param name="pname" select="'completely-unlet'"/>
>  </xsl:apply-templates>
></xsl:template> 
>
>David
>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]