[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Using xpath fn: functions in XSL stylesheets

Subject: Using xpath fn: functions in XSL stylesheets
From: "Jefferson Thomas" <foramuyou@xxxxxxxxx>
Date: Mon, 24 Mar 2008 13:04:30 +0900
 Using xpath fn: functions in XSL stylesheets
Hi,
I would like to use the XPath functions in my XSL stylesheet. For
example like those from
http://www.w3schools.com/xpath/xpath_functions.asp#context
But I cant figure out the usage. Im trying since a few days already.
As for now Ive been trying to do it like that :
XML sample file "test.xml":

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xsl" ?>
<sales></sales>

XSL sample file "test.xsl":

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions" version="1.0">
  <xsl:template match="/">
    TEST :
    <xsl:value-of select='string(34)'/>
    <br/>
    TEST :
    <xsl:value-of select='fn:current-dateTime()'/>
    <br/>
  </xsl:template>
</xsl:stylesheet>

Ive been trying to use that with Firefox 2.0, Internet Explorer, and
XML Notepad. No success.
My system is Windows Vista. The "string(34)" works fine but when I use
the "fn:current-dateTime()" function Im getting errors like "the
function current-dateTime() not found". The same thing happens when I
try to use the other fn: functions. I think Im not specifying the
"http://www.w3.org/2005/02/xpath-functions" namespace the right way
but I cant find on the internet any working example of its usage.
Could somebody tell me please what is the right way to use those fn:
functions ? The ones I want the mose are fn:current-dateTime() and
fn:base-uri().

Thank you for any help,
Thomas

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.