W3C home > Mailing lists > Public > www-xsl-fo@w3.org > October 2004

Re: Evalution Problems

From: David Carlisle <davidc@nag.co.uk>
Date: Wed, 13 Oct 2004 17:00:53 +0100
Message-Id: <200410131600.RAA13614@penguin.nag.co.uk>
To: Roman.Huditsch@lexisnexis.at
CC: www-xsl-fo@w3.org

This isn't really an FO question (It's XSLT and you don't appear to be
generating XSL FO) so I think you would have been better on xsl-list.

Also your code seemed to be implementing rather more than your stated requirements

  I need to put every string containing numbers into <number> elements.
  If there is a number and a comma appears, it should be trimmed.

It also trims f's and did something with -

however, this is shorter, not sure if it does quite what you want in

  <xsl:template match="token">
   <xsl:variable name="x" select="translate(.,'f,','')"/>
    <xsl:when test="number($x)=number($x)">
      <number><xsl:value-of select="$x"/></number>
      <term><xsl:value-of select="."/></term>

That would decide 123f4 was <number>1234</number> but it depends on how
much control over your input whether such things can happen in practice
and whether you want to check for them in xslt.


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
Received on Wednesday, 13 October 2004 16:01:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:10:01 UTC