Collection 003

Tests that err:XD0001 is raised if a sequence of documents is the context for an XPath expression on a p:with-option.

Test nw-collection-003.xml is expected to fail with error code err:XD0001.

The pipeline


      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
        <p:output port="result"/>

        <p:identity name="id1">
          <p:with-input port="source">
            <p:inline>
              <doc xmlns=""/>
            </p:inline>
          </p:with-input>
        </p:identity>

        <p:identity name="id2">
          <p:with-input port="source">
            <p:inline>
              <doc xmlns=""/>
            </p:inline>
          </p:with-input>
        </p:identity>

        <p:identity name="combine">
          <p:with-input port="source" pipe="@id1 @id2"/>
        </p:identity>

        <p:variable name="a" select="count(collection())" collection="true"/>

        <p:wrap-sequence>
          <p:with-option name="wrapper" select="concat('wrapper', *[1]/name())"/>
          <p:with-input>
            <doc xmlns="">{$a}</doc>
          </p:with-input>
        </p:wrap-sequence>
      </p:declare-step>
   
MorganaXProc passing XML Calabash passing

Revision history

22 Apr 2019, Achim Berndzen

Adapted test to new context item strategy, new error code.

04 Apr 2019, Achim Berndzen

Changed XPath expression on p:wrap-sequence/p:with-option so context item is used and XD0008 has to be raised.

17 Oct 2018, Achim Berndzen

Fixed error in XPath expression for variable 'a': Missing ')'

14 Oct 2018, Norman Walsh

Initial publication