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

Re: is this a limitation / processor bug?

Subject: Re: is this a limitation / processor bug?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 7 Apr 2000 10:02:41 +0100 (BST)
schematics bst


<xsl:template match="schematics">
  <xsl:variable name="model" select="modelnumber"/>
  <xsl:variable name="applicableModel" select="documentation/currentModel"/>

  <xsl:choose>
    <xsl:when test="$model=$applicableModel">
      <xsl:apply-templates select="link"/>
    </xsl:when>
  </xsl:choose>
</xsl:template>

(I removed two / and changed one \ to / from your original)

This may or may not be correct, depending on what your input looks like.
If it is correct, you don't need the variables, it is equivalent to


<xsl:template match="schematics">
  <xsl:choose>
    <xsl:when test="modelnumber="documentation/currentModel">
      <xsl:apply-templates select="link"/>
    </xsl:when>
  </xsl:choose>
</xsl:template>

so your input looks like this?

<schematics>
  <documentation>
    <currentModel>123</currentModel>
  </documentation>
  <modelnumber>123</modelnumber>
  <link>
    stuff that has templates applied
  </link>
<schematics>

If so, your template looks about right except beware you are doing
string comparison in that = so any white space differences would
make it false, you may want number(modelnumber)=number(documentation/currentModel)

David


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


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.