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

Re: narrow down a selecting

Subject: Re: narrow down a selecting
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 28 Mar 2002 14:32:25 +0100
Re:  narrow down a selecting
1. <xsl:when test="following-sibling::*[1][name() = 'namedcell' and @name='linenr']">

or

2. <xsl:when test="following-sibling::*[1][name() = 'namedcell']/@name = 'linenr'">

or

3. <xsl:when test="following-sibling::namedcell[1][@name='linenr']">

or

4. <xsl:when test="following-sibling::manedcell[1]/@name = 'linenr'">


Choose which one is better for you. 1 and 2 are the same and 3 and 4 are the same too.


Joerg

Joeri Belis wrote:
XML

<root>
 <record>
  <data>1</data>
  <namedcell name="linenr"/>
  <data>500</data>
  <namedcell name="articlenr"/>
 </record>
 <record>
  <data>2</data>
  <namedcell name="linenr"/>
  <data>80</data>
  <namedcell name="articlenr"/>
 </record>
</root>

when i try this stylesheet template match on "data" tag

<xsl:template match="data">
    <xsl:choose>
      <xsl:when test="../namedcell/@name='linenr'">
 <data>xxx</data>
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="."/>
      </xsl:otherwise>
    </xsl:choose>
</xsl:template>

it will also replace articlenr ( 500 and 80 ) with xxx because 'linenr' is
found in the record xml part.
How can i only change 'linenr' and not 'articlenr' without changing the
<xsl:template match="data"> test. I don't want to write a template for every
namedcell

Joeri



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




--

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


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.