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

Re: Param Element

Subject: Re: Param Element
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 3 Jun 2005 00:34:00 +0100
Re:  Param Element
   It is working...

This seems unlikely.

   I'm still a little confused on the parm(s) but no worries!

   On 6/2/05, Karl Stubsjoen <kstubs@xxxxxxxxx> wrote:
   > Here is what I have, but not confident that it is working... it seems
   > that my check for uniqueness is failing, I get no results.  Isn't it a
   > fair test to ask of a value it it exists in a set of values as I am
   > here:
   >  <xsl:if test="$current_id = $activity_id">
   > Where activity_id is a set of ID values as defined below..
   > 
   > <xsl:param name="xm" select="in_proc" />
   > 
   > <xsl:variable name="activity_id" select="in_proc/row/@id"/>
   > 
   > <xsl:template match="/">
   >  <in_proc>
   >  <xsl:apply-templates select="row"/>
   >  <xsl:apply-templates select="$xm/row" mode="append"/>
   >  </in_proc>
   > </xsl:template>
   > 
   > <xsl:template match="row">
   >  <xsl:copy-of select="."/>
   > </xsl:template>
   > 
   > <xsl:template match="row" mode="append">
   >  <xsl:variable name="current_id" select="@id"/>
   >  <xsl:if test="$current_id = $activity_id">
   >    <xsl:copy-of select="."/>
   >  </xsl:if>
   > </xsl:template>
   > 
   > </xsl:stylesheet>
   > 
   > 


 <xsl:apply-templates select="row"/>
 <xsl:template match="row">
  <xsl:copy-of select="."/>
 </xsl:template>
 
is equivalent (but slower, probably) to
<xsl:copy-of select="row"/>
it just copies all the row elements. In this case however it prduces
nothing as there are no row element children of the current node (the
only child of / is a in_proc element (I guess, you have not shown your
input format)

 <xsl:if test="$current_id = $activity_id">
this test is always true (given the default value of $xm) as $current_id
is an attribute node from the set $activity_id
Even if you supply an xm parameter so that the tests may be false, 

 <xsl:apply-templates select="$xm/row" mode="append"/>
 <xsl:template match="row" mode="append">
  <xsl:variable name="current_id" select="@id"/>
  <xsl:if test="$current_id = $activity_id">
    <xsl:copy-of select="."/>
  </xsl:if>
 </xsl:template>

is equivalent to

<xsl:copy-of select="$xm/row[@id = $activity_id]"/>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.