Hi Matthieu,
If you validate this in oXygen you will get 4 errors [1]. Two of them
complain that the namespace my is not declared and that is the main
cause of the problem. My guess is that the XSLT processor (Saxon 9) uses
some value for the function name and it does this in both cases when the
function name is undefined and then a further check discovers that there
is the same name for two functions and thus the duplicate function error
message.
[1] The 4 errors that you should get when you validate the stylesheet
SystemID:
/Users/george/Documents/workspace/www.oxygenxml.com/xml/Untitled3.xsl
Main validation file:
/Users/george/Documents/workspace/www.oxygenxml.com/xml/Untitled3.xsl
Engine name: Saxon-PE 9.3.0.5
Severity: error
Description: Failed to compile stylesheet. 3 errors detected.
SystemID:
/Users/george/Documents/workspace/www.oxygenxml.com/xml/Untitled3.xsl
Main validation file:
/Users/george/Documents/workspace/www.oxygenxml.com/xml/Untitled3.xsl
Engine name: Saxon-PE 9.3.0.5
Severity: fatal
Description: Duplicate function declaration (see line 10 of
file:/Users/george/Documents/workspace/www.oxygenxml.com/xml/Untitled3.xsl)
Start location: 6:43
URL: http://www.w3.org/TR/xslt20/#err-XTSE0770
SystemID:
/Users/george/Documents/workspace/www.oxygenxml.com/xml/Untitled3.xsl
Main validation file:
/Users/george/Documents/workspace/www.oxygenxml.com/xml/Untitled3.xsl
Engine name: Saxon-PE 9.3.0.5
Severity: fatal
Description: Namespace prefix 'my' has not been declared
Start location: 6:43
URL: http://www.w3.org/TR/xslt20/#err-XTSE0280
SystemID:
/Users/george/Documents/workspace/www.oxygenxml.com/xml/Untitled3.xsl
Main validation file:
/Users/george/Documents/workspace/www.oxygenxml.com/xml/Untitled3.xsl
Engine name: Saxon-PE 9.3.0.5
Severity: fatal
Description: Namespace prefix 'my' has not been declared
Start location: 10:43
URL: http://www.w3.org/TR/xslt20/#err-XTSE0280
Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
On 8/24/11 6:31 AM, Matthieu Ricaud-Dussarget wrote:
Hi all,
Maybe it's more an xslt implementation question, but might not be off
topics here (?)
Here is an dummy XSLT 2 stylesheet with functions and on purposed xmlns
declaration omission (abuse use of copy-namespaces="no"...):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0"
>
<!--xmlns:my="http://www.my.org"-->
<xsl:function name="my:foo" as="item()">
<xsl:value-of select="'foo'"/>
</xsl:function>
<xsl:function name="my:bar" as="item()">
<xsl:value-of select="'bar'"/>
</xsl:function>
</xsl:stylesheet>
I then get this error in both oXygen and Jedit :
Duplicate function declaration (see line 9 of ...)
When adding the commented xmlns declaration to xsl:stylesheet, the error
disapear.
I search a long time among my "many functions xslt" but i couldn't any
duplicated function.
Am I wrong or this error message is not appropriated?
I'm not sure which XSLT parser is used in my IDE (xalan, saxon?), but it
seems there is a bug here, no?
Comments or explanation welcome :-)
Regards,
Matthieu
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--