p:wrap-sequence 014 (AB)

Tests group-adjacent is correctly atomized in p:wrap-sequence

Test ab-wrap-sequence-014.xml is expected to pass.

The pipeline


      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
         <p:output port="result"/>
         
         <p:identity name="pr">
            <p:with-input>
               <doc1 xmlns="">one</doc1>
               <doc2 xmlns="">one</doc2>
               <doc3 xmlns="">two</doc3>
               <doc4 xmlns="">two</doc4>
            </p:with-input>
         </p:identity>
        
         <p:wrap-sequence name="splitseq" wrapper="sequence" group-adjacent="."/>
         
         <p:wrap-sequence wrapper="result"/>
      </p:declare-step>
   
MorganaXProc passing XML Calabash failing

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="result">Root element is not 'result'.</s:assert>
               <s:assert test="count(result/child::node())=2">Root element should have two children.</s:assert>
               <s:assert test="count(result/sequence)=2">Root element should have two children elements named 'sequence'.</s:assert>
               
               <s:assert test="count(result/sequence[1]/*)=2">First element 'sequence' should have two children.</s:assert>
               <s:assert test="result/sequence[1]/*[1]/local-name()='doc1'">First element of first sequence should be named 'doc1'.</s:assert>
               <s:assert test="result/sequence[1]/*[2]/local-name()='doc2'">Second element of first sequence should be named 'doc2'.</s:assert>
               
               <s:assert test="count(result/sequence[2]/*)=2">Second element 'sequence' should have two children.</s:assert>
               <s:assert test="result/sequence[2]/*[1]/local-name()='doc3'">First element of second sequence should be named 'doc3'.</s:assert>
               <s:assert test="result/sequence[2]/*[2]/local-name()='doc4'">Second element of second sequence should be named 'doc4'.</s:assert>
               
               <s:assert test="result/sequence/doc1/text()='one'">Text of doc1 should be 'one'.</s:assert>
               <s:assert test="result/sequence/doc2/text()='one'">Text of doc2 should be 'one'.</s:assert>
               <s:assert test="result/sequence/doc3/text()='two'">Text of doc3 should be 'two'.</s:assert>
               <s:assert test="result/sequence/doc4/text()='two'">Text of doc1 should be 'two'.</s:assert>
               
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

02 Jun 2019, Achim Berndzen

Tests for p:wrap-sequence (Partly ported from 1.0)