[ http://issues.apache.org/jira/browse/XALANJ-1522?page=all ]

Gert van der Kaaden updated XALANJ-1522:
----------------------------------------

    Attachment: MethodResolver.java
                ExtensionHandlerJavaClass.java

The attached files are a possible solution. Before the functions are actual 
looked up, all dashes (if any) are removed.
For this the method replaceDash in MethodResolver has changed access from 
private to default (package). And ExtensionHandlerJavaClass.isFunctionAvailable 
calls this method before the function lookup is done.

The tests given in previous posts do work after these changes

I do not know if other isFunctionAvailable methods also should be updated (in 
ExtensionHandlerExsltFunction, ExtensionHandlerGeneral, 
ExtensionHandlerJavaPackage and maybe others in other packages).
Also the isElementAvailable method could be updated the same way (again, I do 
not know if that is necessary).


> 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
>          Issue Type: Bug
>          Components: Xalan-extensions
>    Affects Versions: 2.7
>         Environment: Operating System: All
> Platform: All
>            Reporter: Pete Edwards
>         Assigned To: Xalan Developers Mailing List
>         Attachments: ExtensionHandlerJavaClass.java, MethodResolver.java
>
>
> 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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to