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

Re: How can I get the position of an element that has a desc

Subject: Re: How can I get the position of an element that has a descendant 'y' with value 'z' ?
From: senthil@xxxxxxxxxx
Date: Fri, 4 Feb 2000 12:37:10 -0800
get position of an element
  Please try the following stylesheet.  I think it can be tuned,
  but works..

<?xml version="1.0" standalone="yes"?> 
<xsl:stylesheet
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xsl:version="1.0">
<xsl:output method="text"/>

<xsl:template match="element">
  <xsl:if test=".//y"> 
    <xsl:variable name="yvalue"><xsl:value-of select=".//y"/></xsl:variable>
     <xsl:if test="$yvalue = 'z'">
       <xsl:number count="element" format="1" level="any"/>
     </xsl:if>
  </xsl:if>
</xsl:template>
</xsl:stylesheet>




>>Date: Thu, 3 Feb 2000 17:05:46 -0500
>>From: "mohamed" <mohamed@xxxxxxxxx>
>>Subject: How can I get the position of an element that has a descendant
'y' with >>value 'z' ?

>>This is a multi-part message in MIME format.

>>- ------=_NextPart_000_05E9_01BF6E68.E9789070
>>Content-Type: text/plain;
>>	charset="iso-8859-1"
>>Content-Transfer-Encoding: quoted-printable

>>Hi
>>How can I get the position of an element that has a descendant 'y' with =
>>value 'z' ?

>><?xml version=3D"1.0"?>
>><elementList>
>>    <element>
>>        <x>
>>            <y>a</y>
>>        </x>
>>    </element>
>>    <element>
>>        <x>
>>            <y>z</y>
>>        </x>
>>    </element>
>></elementList>


----------------------------------------------------------------------------
---------
Senthil Vaiyapuri
408-572-3224
Portal Software


 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.