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

RE: Value of attribute starts-with or contains

Subject: RE: Value of attribute starts-with or contains
From: "Pankaj Chaturvedi" <pankaj.chaturvedi@xxxxxxxxx>
Date: Thu, 5 Jun 2008 12:56:33 +0530
RE:  Value of attribute starts-with or contains
Thanks Michael. That's why I was getting the 1 in my output.

Well I don't wanted to count them that I was trying to debug my code, I am
actually trying to apply-templates with the check.


Something like <xsl:apply-templates
select="contains[.//entry/@aid5:cellstyle='tbody_cell']"/>

As I have another entries whose values differs for @aid5:cellstyle, and
which unfortunately I have not shown in below mark up.

Can this be done.


-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx] 
Sent: Thursday, June 05, 2008 12:42 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Value of attribute starts-with or contains


contains() returns a boolean, and the count() of a boolean is always 1.

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: Pankaj Chaturvedi [mailto:pankaj.chaturvedi@xxxxxxxxx]
> Sent: 05 June 2008 07:59
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Value of attribute starts-with or contains
> 
> Hi,
> 
> Can somebody let me know what's wrong with the below code:
> 
> 
> <xsl:value-of
> select="count(contains[.//entry/@aid5:cellstyle='tbody_cell'])"/>
> 
> 
> I've markup:
> 
> <table>
> <thead>
> <entry aid5:cellstyle=tbody_cell">
> <para>xxx</para>
> </entry>
> <entry aid5:cellstyle=tbody_cell">
> <para>xxx</para>
> </entry><entry aid5:cellstyle=tbody_cell_l"> <para>xxx</para> 
> </entry><entry aid5:cellstyle=tbody_cell_l"> <para>xxx</para> </entry> 
> </thead> </table>
> 
> All I am trying to do is while in <table> trying to count the nos 
> entry whose @aid5:cellstyle contains or starts-with tbody_cell.
> 
> Believe me I've used these functions lots of time mostly with nodes, 
> but nothings seems to be working with attributes. May be I never 
> tested "attribute values" with these functions.
> 
> Any clue will be highly appreciated.
> 
> 
> 
> Best,
> 
> Pankaj Chaturvedi
> 
> ==============================================================
> ==============
> ================
> 
> 
> 
> Confidentiality Notice:" This message and any attachment(s) contained 
> here are information that is confidential, proprietary to IDS Infotech 
> Ltd. and its customers.
> Contents may be privileged or otherwise protected by law. The 
> information is solely intended for the individual or the entity it is 
> addressed to. If you are not the intended recipient of this message, 
> you are not authorized to read, forward, print, retain, copy or 
> disseminate this message or any part of it. If you have received this 
> e-mail in error, please notify the sender immediately by return e-mail 
> and delete it from your computer."

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-2011 All Rights Reserved.