⚲
Project
Profile
Help
Tour this page
Frequent Planio Questions
Learning Resources
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Search
:
Projects
All Projects
Help
Tour this page
Frequent Planio Questions
Learning Resources
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Saxon
Overview
Roadmap
Issues
Calendar
Blog
Documents
Forums
Files
Repository
Download (621 Bytes)
Support #4264
» function_warning.xslt
Stefan Pöschel
, 2019-07-31 09:22
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
"2.0"
xmlns:test=
"http://test.test"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
>
<xsl:function
name=
"test:string_to_amount"
as=
"xs:decimal"
>
<!-- returns the amount part of a string, as a number -->
<xsl:param
name=
"s"
as=
"xs:string"
/>
<xsl:value-of
select=
"xs:decimal(replace($s, '^([-+]?\d*\.?\d+).*$', '$1'))"
/>
</xsl:function>
<xsl:template
match=
"/"
>
<xsl:value-of
select=
"test:string_to_amount('1234.56%')"
/>
</xsl:template>
</xsl:stylesheet>
(1-1/1)
Loading...