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

Re: saxon fail to find xslt functions

Subject: Re: saxon fail to find xslt functions
From: tcn@xxxxxxxxxxxxx (Trevor Nash)
Date: Thu, 28 Jun 2001 13:27:36 GMT
saxon substring
>I have this function in an xsl doc - I don't think i can use 
>template match because it needs to run on all dates, to convert
>CCYY-MM-DD dates into YYMMDD, and there are a lot of date nodes
>in the xml document with various names.
>
><saxon:function name="bcp:fixDate">
>    <saxon:return
>select="concat(substring(.,3,2),substring(.,6,2),substring(.,9,2))"/>
></saxon:function>
>
This declares a function which takes no arguments.

>i'm calling it like this:
><xsl:value-of select="bcp:fixDate(bas:InvoiceDate)"/>
>
This calls a function with one argument.  You probably need an
xsl:param in the function definition, such as

<saxon:function name="bcp:fixDate">
    <xsl:param name="date" select="."/>
    <saxon:return
select="concat(substring($date,3,2),substring($date,6,2),substring($date,9,2))"/>
</saxon:function>

(supplying a default lets you call the function as bcp:fixDate() to
use the current node)

>the xsl, bcp, saxon and bas namespaces are defined in the
><xsl:stylesheet>
Show us the whole thing, in case there is a typo.  Double check the
saxon URI.

>[snip]

Hop ethis helps,
Trevor Nash

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.