Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Tue, 12 Feb 2008 09:02:39 +0100,    group: microsoft.public.xsl        back       


String Conversion   
Hello all,

I am new to XLS. I would like to get only the decimal value of a string 
ID="abcdef_12345" (i.e. having 12345 to put in a new ID)

Thank you all
date: Tue, 12 Feb 2008 09:02:39 +0100   author:   Jean-s?bastien LEROY

Re: String Conversion   
Something I have forgot :

If someone can give me a solution to have the generate-id() returning a 
decimal value and not an hexadecimal.

"Jean-sébastien LEROY"  a écrit dans 
le message de news: 47b15299$0$21144$7a628cd7@news.club-internet.fr...
> Hello all,
>
> I am new to XLS. I would like to get only the decimal value of a string 
> ID="abcdef_12345" (i.e. having 12345 to put in a new ID)
>
> Thank you all
>
date: Tue, 12 Feb 2008 09:05:54 +0100   author:   Jean-s?bastien LEROY

Re: String Conversion   
"Jean-sébastien LEROY"  wrote in 
message news:47b15361$0$21144$7a628cd7@news.club-internet.fr...
> Something I have forgot :
>
> If someone can give me a solution to have the generate-id() returning a 
> decimal value and not an hexadecimal.
>
> "Jean-sébastien LEROY"  a écrit 
> dans le message de news: 
> 47b15299$0$21144$7a628cd7@news.club-internet.fr...
>> Hello all,
>>
>> I am new to XLS. I would like to get only the decimal value of a string 
>> ID="abcdef_12345" (i.e. having 12345 to put in a new ID)
>>
>> Thank you all
>>
>
>
generate-id can return any value it wants, so long as it's unique within the 
document and consistent if called multiple times on the same node. So it 
could just return node1, node2... etc.

If you want to convert abcdef_122345 to 12345 then you could use translate 
in version 1.0 providing you know all the non-numeric characters. e.g.:
<xsl:variable name="remove" select="'abcde..xyz_'" />
translate("abcde_12345", $remove, "") will give you 12345, you can wrap this 
in the number() function if necessary.

In XSLT 2.0 you can use the regular expression support to create a function 
that removes any non-digit.

-- 

Joe Fawcett (MVP - XML)

http://joe.fawcett.name
date: Tue, 12 Feb 2008 08:44:32 -0000   author:   Joe Fawcett am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us