Test nw-cdata-sections-008.xml is expected to pass.
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
<p:option name="code" as="xs:QName" static="true" select="xs:QName('spoon')"/>
<p:output port="result" serialization="map{'method':'xml', 'indent':false(), 'cdata-section-elements': (xs:QName('pre'), $code)}"/>
<p:identity>
<p:with-input href="../documents/serial.xml"/>
</p:identity>
</p:declare-step>
<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:xs="http://www.w3.org/2001/XMLSchema" queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="serialization">The pipeline result is not serialized</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/serialization">
<s:assert test="contains(., 'code><![CDATA[code]]')">The code element was not serialized as a cdata section</s:assert>
<s:assert test="contains(., 'pre><![CDATA[')">The pre element was not serialized as a cdata section</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Test setting the cdata-section-elements property