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

RE: Exsl functions in xslt 2

Subject: RE: Exsl functions in xslt 2
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Mon, 19 Jan 2004 15:58:47 -0000
xslt2 format number
> change the top level xsl:stylesheet to say version="2.0"
> and add:
> 
> <xsl:function  name="msxsl:node-set" as="document-node()"> 
> <xsl:param name="x"/> <xsl:sequence select="$x"/> </xsl:function>
> 
> saxon6 and msxml will process in forward-compatible mode and 
> that will be OK, saxon 7 will define this function as an identity.

Done, Saxon 6.5.3 and MSXML 4 still work fine thanks.


> It will process in native xslt2 mode which may or may not be 
> OK, depending on what you are doing, you may need to persuade 
> it back to backward compatibility mode if that can be done 
> without harming compatibility. (One way woul dbe to _only-) 
> have the above definition in the top level xslt2 stylesheet 
> and have taht stylesheet import or include the previous 
> stylesheet that has a top level version=1.0.

I tried this but of course got problems with data typing.  I tried
having a stylesheet with version="2.0" import a stylesheet with
version="1.0" and vice versa, but both produced the same set of errors
(with Saxon 7.8).

There were only 2 types of error, they were:

  Required type of first argument of format-number() is number; supplied
value has type xs:string

  and

  Required type of first argument of concat() is xs:string; supplied
value has type xs:integer

So for example I changed:

<xsl:value-of
select="format-number(substring($figureDigits,1,2),'#0')"/>

To:

<xsl:value-of
select="format-number(xs:integer(substring($figureDigits,1,2)),'#0')"/>

And added these function definitions:

<exsltf:function name="xs:integer">
  <xsl:param name="x"/>
  <exsltf:result select="$x"/>
</exsltf:function>

<exsltf:function name="xs:string">
  <xsl:param name="x"/>
  <exsltf:result select="$x"/>
</exsltf:function>

....but msxml4 complains about the 'xs:' namespace.

Any ideas?

ahanks
andrew

 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.