You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Gert van der Kaaden (JIRA)" <xa...@xml.apache.org> on 2005/03/23 00:16:22 UTC
[jira] Commented: (XALANJ-1522) function-available fails for exsl:node-set or exsl:object-type
[ http://issues.apache.org/jira/browse/XALANJ-1522?page=comments#action_61398 ]
Gert van der Kaaden commented on XALANJ-1522:
---------------------------------------------
For most of the functions with a dash in the name the Xalan javadoc says:
"The Xalan extensions MethodResolver converts 'function-with-dash' to 'functionWithDash'."
So I tried the stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exslt="http://exslt.org/common"
xmlns:set="http://exslt.org/sets"
xmlns:datetime="http://exslt.org/dates-and-times"
exclude-result-prefixes="exslt set datetime"
version="1.0">
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<result>
<xsl:if test="function-available('count')">
<p>count available</p>
</xsl:if>
<xsl:if test="function-available('exslt:node-set')">
<p>exsl:node-set available</p>
</xsl:if>
<xsl:if test="function-available('exslt:nodeSet')">
<p>exsl:nodeSet available</p>
</xsl:if>
<xsl:if test="function-available('exslt:object-type')">
<p>exsl:object-type available</p>
</xsl:if>
<xsl:if test="function-available('exslt:objectType')">
<p>exsl:objectType available</p>
</xsl:if>
<xsl:if test="function-available('set:has-same-node')">
<p>set:has-same-node available</p>
</xsl:if>
<xsl:if test="function-available('set:hasSameNode')">
<p>set:hasSameNode available</p>
</xsl:if>
<xsl:if test="function-available('datetime:date-time')">
<p>datetime:date-time available</p>
</xsl:if>
<xsl:if test="function-available('datetime:dateTime')">
<p>datetime:dateTime available</p>
</xsl:if>
</result>
</xsl:template>
</xsl:stylesheet>
with the following result:
<?xml version="1.0" encoding="UTF-8"?>
<result>
<p>count available</p>
<p>exsl:nodeSet available</p>
<p>exsl:objectType available</p>
<p>set:hasSameNode available</p>
<p>datetime:dateTime available</p>
</result>
I guess that in the implementation of 'function-available' the input parameter should be converted from aaa-bbb to aaaBbb (via the MethodResolver?) before the actual lookup is done. This should also be a solution for bug XALANJ-1972, about dates-and-times.
Probably the implementation of 'element-available' must be updated in the same way.
> function-available fails for exsl:node-set or exsl:object-type
> --------------------------------------------------------------
>
> Key: XALANJ-1522
> URL: http://issues.apache.org/jira/browse/XALANJ-1522
> Project: XalanJ2
> Type: Bug
> Components: Xalan-extensions
> Versions: CurrentCVS
> Environment: Operating System: All
> Platform: All
> Reporter: Pete Edwards
> Assignee: Xalan Developers Mailing List
>
> The function "function-available" fails to identify exslt common functions.
> Stylesheet:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
> xmlns:set="http://exslt.org/sets"
> xmlns:exsl="http://exslt.org/common"
> xmlns:str="http://exslt.org/strings"
> xmlns:xalan="http://xml.apache.org/xslt"
> extension-element-prefixes="set str exsl xalan"
> exclude-result-prefixes="set str exsl xalan"
> >
> <xsl:template match="test">
> <results>
> <xsl:if test="function-available('count')">
> <p>count available</p>
> </xsl:if>
> <xsl:if test="function-available('set:distinct')">
> <p>set:distinct available</p>
> </xsl:if>
> <xsl:if test="function-available('str:tokenize')">
> <p>str:tokenize available</p>
> </xsl:if>
> <xsl:if test="function-available('exsl:node-set')">
> <p>exsl:node-set available</p>
> </xsl:if>
> <xsl:if test="function-available('exsl:object-type')">
> <p>exsl:object-type available</p>
> </xsl:if>
> <xsl:if test="function-available('xalan:nodeset')">
> <p>xalan:nodeset available</p>
> </xsl:if>
> </results>
> </xsl:template>
> </xsl:stylesheet>
> XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <test/>
> Results with Xalan 2.6.0:
> <results>
> <p>count available</p>
> <p>set:distinct available</p>
> <p>str:tokenize available</p>
> <p>xalan:nodeset available</p>
> </results>
> Results with xsltproc:
> <results>
> <p>count available</p>
> <p>set:distinct available</p>
> <p>str:tokenize available</p>
> <p>exsl:node-set available</p>
> <p>exsl:object-type available</p>
> </results>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org