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

Re: String ends with ?, ! or not

Subject: Re: String ends with ?, ! or not
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 29 Apr 2008 14:10:48 +0200
Re:  String ends with ?
Pankaj Chaturvedi wrote:
Is there is way, we can test whether a string ENDS-WITH a ?, !.

<articletitle>Dynamics of the trade balance and the terms of trade: The
J&hyphen;curve&quest;</articletitle>

I am trying to test, whether the <articletitle> string ends with &quest; (?)
or not. Below is what I've tried to define in my stylesheet (note that I've
tested Unicode value for &quest; as it gives error to define an external
entity &quest;, which I've done by declaring a ENTITY declaration in XML as
<!ENTITY quest            "[#x0003F]" ><!--=question mark --> ).


<xsl:choose> <xsl:when test="./articletitle/contains(string(), '#x0003F')">

Are you using XSLT 2.0 and XPath 2.0? That has a function ends-with http://www.w3.org/TR/xpath-functions/#func-ends-with
<xsl:when test="ends-with(articletitle, '?')">


--

	Martin Honnen
	http://JavaScript.FAQTs.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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