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

RE: Profiling Number Ranges

Subject: RE: Profiling Number Ranges
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 18 Nov 2004 17:40:33 -0000
xsl translation integer range
You'll have to tokenize the attribute value (using the tokenize() function
in XPath 2.0, or the EXSLT str:tokenize() extension, or your own recursive
template) and then do the comparison on each of the values in turn.

If the values are decimal numbers, as in your example, you can use numeric
comparison, but if they are sequences of integers (so that 6.2.1 < 6.12)
then you'll need to do a further level of tokenization to extract the

Note that these problems become vastly easier in 2.0.

Michael Kay

> -----Original Message-----
> From: Naomi Gronson [mailto:naomi_gronson@xxxxxxxxx] 
> Sent: 18 November 2004 14:59
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Profiling Number Ranges
> I have a profiling filter that removes certain
> elements prior to publish.  I've been enabling the
> content owners to apply multiple attribute values to
> content within Epic Editor.  For most information this
> is relatively straightforward, the problem comes in
> with SystemLevel:
> <para SystemLevel="5.1;5.2;6.0">Now reboot.</para>
> <para SystemLevel="5.0;5.5;9.2">Log out and go eat a
> snack.</para>
> I've allowed users to make selections in the filter
> such as "5.1" (using contains()) but the trouble is
> when I try to implement the range feature to give the
> user a greater than/less than like "5.1+"
> $SystemLevel = "5.1+"
> <!--  This code worked when only one SystemLevel
> attribute value was allowed -->
> <xsl:when test="contains($SystemLevel, '+') and
> @SystemLevel and (not(@SystemLevel &gt;=
> translate($SystemLevel, '+', '')))">
> 	<xsl:message>Process: Suppressing <xsl:value-of
> select="name()"/> with SystemLevel =  <xsl:value-of
> select="@SystemLevel"/> and Profile of <xsl:value-of 
> select="$SystemLevel"/>.</xsl:message> 
>       <xsl:apply-templates mode="suppress"/>
> </xsl:when> 
> You can probably see the the dilemma now.  Does anyone
> know an approach that could be used to somehow take a
> list of a few attribute values ("5.1;5.2;6.0") and use
> the &gt;= greater than symbol to suppress content in
> which none of the values match the greater than
> criteria?  Would the values need to be parsed in order
> to do this, etc.?  Thanks for the help.
> Naomi
> __________________________________ 
> Do you Yahoo!? 
> The all-new My Yahoo! - Get yours free! 
> http://my.yahoo.com 

Current Thread


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.
First Name
Last Name
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.