I have filenames for examples as below names
1) "Wireshark-win64-1.12.5.exe" 2) "Service - Document.docx"
Is there anyway I can grep the file extension using some generic regular expression and save it in a xslt variable. I was using some string function as below, but for value such as shown above in 1), it won't work.
<xsl:variable name="fileExtension" select="substring-before(substring-after($filename,'.'),'"')"/>
If you're using XSLT 2.0, then:
tokenize($filename, '\.')[last()]
will extract the file extension from $filename for you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.