New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unparsed-text-available() in an XSLT step throws an error #92

Closed
gimsieke opened this Issue Mar 20, 2013 · 0 comments

Comments

Projects
None yet
2 participants
@gimsieke
Contributor

gimsieke commented Mar 20, 2013

When I run

<p:declare-step 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns:p="http://www.w3.org/ns/xproc" 
  version="1.0" name="bug">
  <p:output port="result" primary="true"/>
  <p:xslt name="xslt" template-name="main">
    <p:input port="source"><p:empty/></p:input>
    <p:input port="stylesheet">
      <p:inline>
        <xsl:stylesheet version="2.0">
          <xsl:template name="main">
            <result>
              <doc-available>
                <xsl:sequence select="doc-available('non-existing.xml')"/>
              </doc-available>
              <unparsed-text-available>
                <xsl:sequence 
                  select="unparsed-text-available('non-existing.txt')"/>  
              </unparsed-text-available>
            </result>
          </xsl:template>
        </xsl:stylesheet>
      </p:inline>
    </p:input>
    <p:input port="parameters"><p:empty/></p:input>
  </p:xslt>
</p:declare-step>

Calabash 1.0.9 terminates with a java.io.FileNotFoundException, complaining about 'non-existing.txt' not being there.

This example works as expected in 1.0.3:

<result>
  <doc-available>false</doc-available>
  <unparsed-text-available>false</unparsed-text-available>
</result>

Please note that doc-available() still works.

I didn’t check with which Calabash version it ceased to work. I did check that it happens on Linux and Windows with Saxon HE 9.4.0.4, 9.4.0.6, and EE 9.4.0.7.

ndw added a commit that referenced this issue Mar 20, 2013

Fix issue #92, throw an XPathException not an XProcException because …
…Saxon catches the former and not the latter

@ndw ndw closed this Mar 20, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment