Test for p:delete 016 (AB)
Tests deleting attribute with a given name in a given namespace
Test is expected to pass.
The pipeline
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:output port="result"/>
<p:delete xmlns:x="http://namespace" match="@x:att">
<p:with-input>
<doc>
<x:element/>
<element x:att="2"/>
</doc>
</p:with-input>
</p:delete>
</p:declare-step>
Result
<doc xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:x="http://namespace">
<x:element/>
<element/>
</doc>
Schematron checks
<s:schema xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
queryBinding="xslt2">
<s:ns prefix="x" uri="http://namespace"/>
<s:pattern>
<s:rule context="/">
<s:assert test="doc">The document root is not 'doc'.</s:assert>
<s:assert test="doc/element">There is no element 'element' as child of doc.</s:assert>
<s:assert test="doc/x:element">There is no element 'x:element' as child of doc.</s:assert>
<s:assert test="count(doc/element/@x:att)=0">There should be not attribute 'x:att' on 'element'.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 10 Jun 2021, Achim Berndzen
- Added attribute 'queryBinding' to schematron's schema.
- 22 Mar 2019, Achim Berndzen
- Created new test