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>one</doc1>
         <doc2>one</doc2>
         <doc3>two</doc3>
         <doc4>two</doc4>
      </p:with-input>
   </p:identity>
   <p:wrap-sequence name="splitseq" wrapper="sequence" group-adjacent="*/text()"/>
   <p:wrap-sequence wrapper="result"/>
</p:declare-step>
MorganaXProc passing XML Calabash passing

Schematron validation


<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <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

10 Jun 2021, Achim Berndzen

Added attribute 'queryBinding' to schematron's schema.

02 Jan 2020, Achim Berndzen

Changed test because p:wrap-sequence now bases on fn:deep-equal().

02 Jun 2019, Achim Berndzen

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