Re: [xsl] Testing for presence of alphabetical characters

Subject: Re: [xsl] Testing for presence of alphabetical characters
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 06 Feb 2006 13:17:47 -0500

Your alpha string doesn't contain the substring '1a' -- can you say why you expect to get true? maybe we can help you test what you actually want to test.

Ah -- testing for presence of alphabetical characters -- in XPath 1.0,

not(string-length($cont) = string-length(translate($cont,$alpha,''))

or "matches($cont,'.*[a-zA-Z].*')" in 2.0 (while I learn a new regular expression syntax).


At 12:58 PM 2/6/2006, you wrote:
Using Saxon 851... can someone tell me why the
following expression returns false?

<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
<xsl:template match="/">
<xsl:for-each select="//entry">
<xsl:variable name="cont" select="."/>
<xsl:variable name="alpha"
<xsl:if test="contains($alpha, $cont)">
<!-- do something -->

<?xml version="1.0"?>

__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around

Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

Current Thread