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
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 >
"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