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

<xsl:with-param> does not work with <xsl:apply-templat

Subject: <xsl:with-param> does not work with <xsl:apply-templates>
From: Katharina Kreis <katharinakreis@xxxxxx>
Date: Tue, 01 Mar 2005 09:21:34 +0100
apply templat
Hi!

I'm trying to use <xsl:with-param> together with <xsl:apply-templates>.

XML-File:
*<?xml version="1.0"?>
<Building>
   <Floor>
       <Room>
           <number>1</number>
           <wall_IDs>
               <wall_ID>123</wall_ID>
               <wall_ID>234</wall_ID>
               <wall_ID>345</wall_ID>
               <wall_ID>456</wall_ID>
           </wall_IDs>
       </Room>
       <Room>
           <number>2</number>
           <wall_IDs>
               <wall_ID>123</wall_ID>
               <wall_ID>678</wall_ID>
               <wall_ID>789</wall_ID>
               <wall_ID>901</wall_ID>
           </wall_IDs>
       </Room>
   </Floor>
   <Wall_List>
       <Wall ID="123">
           <width>2</width>
       </Wall>
       <Wall ID="234">
           <width>3</width>
       </Wall>
       <Wall ID="345">
           <width>2</width>
       </Wall>
       <Wall ID="456">
           <width>1</width>
       </Wall>
   </Wall_List>
</Building>

*XSL-File:
*<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:template name="Room" match="Room">
   <!-- ... -->
   <xsl:for-each select="wall_IDs/wall_ID">
       <xsl:variable name="wall_ID" select="."/>
       <xsl:apply-templates select="/Building/Wall_List/Wall">
           <xsl:with-param name="wallID" select="$wall_ID"/>
       </xsl:apply-templates>
   </xsl:for-each>
</xsl:template>

<xsl:template name="Wall" match="Wall">
   <xsl:param name="wallID"/>
   <!-- ... -->
</xsl:template>

</xsl:stylesheet>

*In the "Room" Template I create a variable with the current wall-ID and I can view it by calling <xsl:value-of>. Then I use <xsl:with-param> to put the variable in the "Wall" template. And this doesn't work. In the "Wall" Template it has no value.
Why? I think <xsl:with-param> must work with <xsl:apply-templates>?!


Thanks for helping
Katharina

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.