Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 28th, 2008, 01:35 PM
Authorized User
 
Join Date: May 2008
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anboss
Default help - EXSLT func cannot set more than one result!

Hi

I tried to execute the following xsl generated by contivo tool and executed in web methods environment.

<?xml version="1.0" encoding="UTF-8"?>



<xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:xalan="http://xml.apache.org/xalan"
     xmlns:func="http://exslt.org/functions"
     xmlns:ctvf="http://www.contivo.com/xslt/extensions"
     extension-element-prefixes="func ctvf"
     exclude-result-prefixes="xalan">

  <xsl:variable name='_root' select='/'/>
  <xsl:template match='/'>
      <Target>
        <numberField>
        <xsl:value-of select="ctvf:testForNullNumber($_root/Source[1]/textfield[1], &quot;&quot;)"/>
        </numberField>
      </Target>
  </xsl:template>

  <func:function name="ctvf:testForNullNumber">
    <xsl:param name="node"/>
    <xsl:param name="defaultValue"/>
    <xsl:choose>
      <xsl:when test="local-name($node) = ''">
        <func:result select="$defaultValue"/>
      </xsl:when>
      <xsl:when test="string-length(normalize-space(string($node))) = 0">
        <func:result select="$defaultValue"/>
      </xsl:when>
      <xsl:otherwise>
        <func:result select="number($node)"/>
      </xsl:otherwise>
    </xsl:choose>
  </func:function>


</xsl:stylesheet>

when i run the xsl in wm i get the following error.

com.wm.app.b2b.server.ServiceException: com.wm.pkg.xslt.util.LocalizedTransformerException : [XSL.0002.9002] JAXP: Error during transformation - javax.xml.transform.TransformerException: An EXSLT function cannot set more than one result!


why is that so?

 
Old October 28th, 2008, 02:17 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I think that question needs to be asked on a forum specific to the XSLT processor you are using. The fine details of how EXSL functions are implemented are likely to vary from one processor to another.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
getting a result set to a vector cakalanka Java Databases 1 March 24th, 2008 07:33 AM
function node-set bound to undefined prefix exslt khwab XSLT 3 August 8th, 2007 12:31 PM
write result set bmains SQL Server 2000 11 March 9th, 2004 09:31 AM
Result set jemacc SQL Server 2000 0 December 19th, 2003 07:26 PM
Using a SP result set in a FROM clause Bernard Omiple SQL Server 2000 1 October 3rd, 2003 05:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.