You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Stephen Suen (JIRA)" <xa...@xml.apache.org> on 2006/03/30 17:12:26 UTC

[jira] Created: (XALANJ-2287) element-available failed for the extension which not actually used

element-available failed for the extension which not actually used
------------------------------------------------------------------

         Key: XALANJ-2287
         URL: http://issues.apache.org/jira/browse/XALANJ-2287
     Project: XalanJ2
        Type: Bug
  Components: XPath-function  
    Versions: 2.7    
    Reporter: Stephen Suen


The function element-available fails for the extension which is not actually used.
Sometimes, it causes exception, and sometimes just returns false.

Here's the stylesheet caused the problem:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:redirect="http://xml.apache.org/xalan/redirect"
 xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect"
 extension-element-prefixes="xalanredirect redirect"
 version="1.0">

<xsl:template match="/">
 <xsl:message>
   <xsl:text>XSL Vendor: </xsl:text>
   <xsl:value-of select="system-property('xsl:vendor')"/>
 </xsl:message>

 <xsl:choose>
   <xsl:when test="element-available('xalanredirect:write')">
     <xsl:message>
       <xsl:text>xalanredirect:write available</xsl:text>
       <xalanredirect:write file="dummy1.xml"/> <!-- **** -->
     </xsl:message>
   </xsl:when>
   <xsl:otherwise>
     <xsl:message>
       <xsl:text>xalanredirect:write NOT available</xsl:text>
     </xsl:message>
   </xsl:otherwise>
 </xsl:choose>

 <xsl:choose>
   <xsl:when test="element-available('redirect:write')">
     <xsl:message>
       <xsl:text>redirect:write available</xsl:text>
     </xsl:message>
     <redirect:write file="dummy2.xml"/> <!-- **** -->
   </xsl:when>
   <xsl:otherwise>
     <xsl:message>
       <xsl:text>redirect:write NOT available</xsl:text>
     </xsl:message>
   </xsl:otherwise>
 </xsl:choose>

</xsl:template>

</xsl:stylesheet>

Removing any one of the two lines indicated by <!-- **** -->, will cause
the corresponding element-available test to return false. Here's the command line
output:

E:\xslt>SET CLASSPATH=E:\apache\xalan-j_2_7_0\serializer.jar;E:\apache\xalan-j_2
_7_0\xalan.jar;E:\apache\xalan-j_2_7_0\xercesImpl.jar;E:\apache\xalan-j_2_7_0\xm
l-apis.jar
E:\xslt>java -Duser.language=en org.apache.xalan.xslt.Process -in index.xml -xsl
 style.xsl
file:///E:/xslt/style.xsl; Line #10; Column #16; XSL Vendor: Apache Software Fou
ndation
file:///E:/xslt/style.xsl; Line #17; Column #20; xalanredirect:write available
file:///E:/xslt/style.xsl; Line #36; Column #20; redirect:write NOT available
<?xml version="1.0" encoding="UTF-8"?>

If both lines are removed, transforming will fail:

E:\xslt>SET CLASSPATH=E:\apache\xalan-j_2_7_0\serializer.jar;E:\apache\xalan-j_2
_7_0\xalan.jar;E:\apache\xalan-j_2_7_0\xercesImpl.jar;E:\apache\xalan-j_2_7_0\xm
l-apis.jar
E:\xslt>java -Duser.language=en org.apache.xalan.xslt.Process -in index.xml -xsl
 style.xsl
file:///E:/xslt/style.xsl; Line #10; Column #16; XSL Vendor: Apache Software Fou
ndation
file:///E:/xslt/style.xsl; Line #16; Column #63; XSLT Error (javax.xml.transform
.TransformerException): Unknown error in XPath.
Exception in thread "main" java.lang.RuntimeException: Unknown error in XPath.
       at org.apache.xalan.xslt.Process.doExit(Process.java:1153)
       at org.apache.xalan.xslt.Process.main(Process.java:1126)


-- 
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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2287) element-available failed for the extension which not actually used

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2287?page=comments#action_12373176 ] 

Brian Minchau commented on XALANJ-2287:
---------------------------------------

Comments from Xalan-J triage from April 4, 2006:
> Henry Z. says that Erin H. has reproduced this Xalan-J interpretive problem.


> element-available failed for the extension which not actually used
> ------------------------------------------------------------------
>
>          Key: XALANJ-2287
>          URL: http://issues.apache.org/jira/browse/XALANJ-2287
>      Project: XalanJ2
>         Type: Bug

>   Components: XPath-function
>     Versions: 2.7
>     Reporter: Stephen Suen

>
> The function element-available fails for the extension which is not actually used.
> Sometimes, it causes exception, and sometimes just returns false.
> Here's the stylesheet caused the problem:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet
>  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>  xmlns:redirect="http://xml.apache.org/xalan/redirect"
>  xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect"
>  extension-element-prefixes="xalanredirect redirect"
>  version="1.0">
> <xsl:template match="/">
>  <xsl:message>
>    <xsl:text>XSL Vendor: </xsl:text>
>    <xsl:value-of select="system-property('xsl:vendor')"/>
>  </xsl:message>
>  <xsl:choose>
>    <xsl:when test="element-available('xalanredirect:write')">
>      <xsl:message>
>        <xsl:text>xalanredirect:write available</xsl:text>
>        <xalanredirect:write file="dummy1.xml"/> <!-- **** -->
>      </xsl:message>
>    </xsl:when>
>    <xsl:otherwise>
>      <xsl:message>
>        <xsl:text>xalanredirect:write NOT available</xsl:text>
>      </xsl:message>
>    </xsl:otherwise>
>  </xsl:choose>
>  <xsl:choose>
>    <xsl:when test="element-available('redirect:write')">
>      <xsl:message>
>        <xsl:text>redirect:write available</xsl:text>
>      </xsl:message>
>      <redirect:write file="dummy2.xml"/> <!-- **** -->
>    </xsl:when>
>    <xsl:otherwise>
>      <xsl:message>
>        <xsl:text>redirect:write NOT available</xsl:text>
>      </xsl:message>
>    </xsl:otherwise>
>  </xsl:choose>
> </xsl:template>
> </xsl:stylesheet>
> Removing any one of the two lines indicated by <!-- **** -->, will cause
> the corresponding element-available test to return false. Here's the command line
> output:
> E:\xslt>SET CLASSPATH=E:\apache\xalan-j_2_7_0\serializer.jar;E:\apache\xalan-j_2
> _7_0\xalan.jar;E:\apache\xalan-j_2_7_0\xercesImpl.jar;E:\apache\xalan-j_2_7_0\xm
> l-apis.jar
> E:\xslt>java -Duser.language=en org.apache.xalan.xslt.Process -in index.xml -xsl
>  style.xsl
> file:///E:/xslt/style.xsl; Line #10; Column #16; XSL Vendor: Apache Software Fou
> ndation
> file:///E:/xslt/style.xsl; Line #17; Column #20; xalanredirect:write available
> file:///E:/xslt/style.xsl; Line #36; Column #20; redirect:write NOT available
> <?xml version="1.0" encoding="UTF-8"?>
> If both lines are removed, transforming will fail:
> E:\xslt>SET CLASSPATH=E:\apache\xalan-j_2_7_0\serializer.jar;E:\apache\xalan-j_2
> _7_0\xalan.jar;E:\apache\xalan-j_2_7_0\xercesImpl.jar;E:\apache\xalan-j_2_7_0\xm
> l-apis.jar
> E:\xslt>java -Duser.language=en org.apache.xalan.xslt.Process -in index.xml -xsl
>  style.xsl
> file:///E:/xslt/style.xsl; Line #10; Column #16; XSL Vendor: Apache Software Fou
> ndation
> file:///E:/xslt/style.xsl; Line #16; Column #63; XSLT Error (javax.xml.transform
> .TransformerException): Unknown error in XPath.
> Exception in thread "main" java.lang.RuntimeException: Unknown error in XPath.
>        at org.apache.xalan.xslt.Process.doExit(Process.java:1153)
>        at org.apache.xalan.xslt.Process.main(Process.java:1126)

-- 
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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org