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

RE: Value at position()

Subject: RE: Value at position()
From: "SHEIKH Sajjad" <Sajjad.SHEIKH@xxxxxxxxxxx>
Date: Tue, 3 Feb 2004 18:47:10 +0100
xsl value of position
Here is the xml example..

<lomp>
  <location path="..\..\..\..\..\">040202</location> 
  <location path="..\..\..\..\">Socio Acto</location> 
  <location path="..\..\..\">Dossoro</location> 
  <location path="..\..\">A</location> 
  <location path="..\">Mentol</location> 
  <location last="true" path="">Lentils</location> 
</lomp>

By the way, I have tried the following but still no success since it
always return the value of first position (040202)!

		<xsl:variable name="doc_cat">
		<xsl:for-each select="cat">
<xsl:choose>
		<xsl:when test="(position()=last()-2='A') or
(position()=last()-2='B')  or (position()=last()-2='C')">

	<xsl:variable name="doc_panel2">
			<xsl:value-of select="position()"/>
	</xsl:variable>

		<xsl:value-of select="//lomp/location['$doc_cat2']"/>

		</xsl:when>
</xsl:choose>
		</xsl:for-each>
		</xsl:variable>


Regards,


-----Original Message-----
From: SHEIKH Sajjad 
Sent: 03 February 2004 18:02
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Value at position()


Hi all,

A little issue, which I am unable to resolve.

I am matching my cat against value A, B and C at position()=last()-2.  
If it finds it, it displays that positioned value.  In the following
example, I expect the value of position()=last()-2 only.

Any suggestions?
Regards,


		<xsl:variable name="doc_cat">
		<xsl:for-each select="cat">
<xsl:choose>
		<xsl:when test="(position()=last()-2='A') or
(position()=last()-2='B')  or (position()=last()-2='C')">
			<xsl:value-of select="."/>
		</xsl:when>
</xsl:choose>
		</xsl:for-each>
		</xsl:variable>


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


______________________________________________________________
This message has been checked for all viruses by BTnet VirusScreen. The
service is delivered in partnership with MessageLabs.

This service does not scan any password protected or encrypted
attachments.  

If you are interested in finding out more about the service, please
visit our website at
http://www.btignite.com/internetservices/btnet/products_virusscreen.htm
==============================================================

______________________________________________________________
This message has been scanned for all viruses by BTnet VirusScreen. The
service is delivered in partnership with MessageLabs.

This service does not scan any password protected or encrypted
attachments.  

If you are interested in finding out more about the service, please
visit our website at
http://www.btignite.com/internetservices/btnet/products_virusscreen.htm
==============================================================

 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.