Previous | Next | Indexes
adultinternetusers > Tutorials > XSLT 2.0 Tutorial > Date and Time (7/7) >

Days, months, and years from durations

XSLT

      <xsl:stylesheet
                  xmlns:sch="http://www.w3.org/2001/XMLSchema"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  version="2.0"
                  exclude-result-prefixes=" sch">
            <xsl:output  method="xml"
                        indent="yes"
                        omit-xml-declaration="yes"/>

            <xsl:template  match="/aaa">
                  <xsl:variable  name="xxx"
                              select="current-date() - '0001-01-01' cast as sch:date"/>
                  <val>
                        <xsl:value-of  select="$xxx"/>
                  </val>
                  <years>
                        <xsl:value-of  select="years-from-duration($xxx cast as sch:dayTimeDuration)"/>
                  </years>
            </xsl:template>

      </xsl:stylesheet>
XML

      <aaa/>
Output

Error:


error - XPST0051
XPath syntax error at char C on line L in {...x cast as sch:dayTimeDurati...}: Unknown atomic type sch:dayTimeDuration


Failed to compile stylesheet. 1 error detected.


Previous chapter: Recursions
Next chapter: Comments and processing instructions
Previous page: Subtracting dates
Next page: - - -

Kevin Carr in Stanton

Natural Skin Care and European Soaps
TickTalk 5
city of stanton
internetusers


You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here:

Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks