<?xml-stylesheet type="text/xsl" href="/style/testcase.xsl"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite"
        xmlns:p="http://www.w3.org/ns/xproc"
        xmlns:c="http://www.w3.org/ns/xproc-step"
        xmlns:err="http://www.w3.org/ns/xproc-error"
        error="err:XD0026">

  <t:title>Test err:XD0026 #005</t:title>

  <t:description xmlns="http://www.w3.org/1999/xhtml">
    <p>Tests that it is an error to refer to the context node in
    p:when if there's no context.</p>
  </t:description>

  <t:pipeline>
    <p:declare-step version='1.0' name="main">
      <p:output port="result"/>

      <p:choose>
        <p:when test="/foo">
          <p:identity>
            <p:input port="source">
              <p:inline><success/></p:inline>
            </p:input>
          </p:identity>
        </p:when>
        <p:otherwise>
          <p:identity>
            <p:input port="source">
              <p:inline><failure/></p:inline>
            </p:input>
          </p:identity>
        </p:otherwise>
      </p:choose>
    </p:declare-step>

  </t:pipeline>
</t:test>
