<?xml-stylesheet type="text/xsl" href="/style/testcase.xsl"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite"
        xmlns:p="http://www.w3.org/ns/xproc"
        xmlns:c="http://www.w3.org/ns/xproc-step">

<t:title>Test validrng-002</t:title>

<t:input port="source">
<doc>
<p>Some paragraph.</p>
</doc>
</t:input>

<t:input port="schema">
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
  <start>
    <ref name="doc"/>
  </start>
  <define name="doc">
    <element name="doc">
      <ref name="title"/>
      <zeroOrMore>
        <ref name="p"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="title">
    <element name="title">
      <text/>
    </element>
  </define>
  <define name="p">
    <element name="p">
      <text/>
    </element>
  </define>
</grammar>
</t:input>

<t:pipeline>
<p:declare-step version='1.0' name="pipeline">
<p:input port="source"/>
<p:input port="schema"/>
<p:output port="result"/>

<p:validate-with-relax-ng assert-valid="false">
  <p:input port="source">
    <p:pipe step="pipeline" port="source"/>
  </p:input>
  <p:input port="schema">
    <p:pipe step="pipeline" port="schema"/>
  </p:input>
</p:validate-with-relax-ng>

</p:declare-step>
</t:pipeline>

<t:output port="result">
<doc>
<p>Some paragraph.</p>
</doc>
</t:output>

</t:test>

