Features: webaccess

ab-p-document 042 (AB)

Testing p:document: Redirects must be followed.

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:option name="WHOST"
             select="'http://localhost:8246'" static="true"/>
   <p:identity>
      <p:with-input>
         <p:document href="{$WHOST}/service/this-is-a"/>
      </p:with-input>
   </p:identity>
</p:declare-step>

Result

<doc xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <location>This is d</location>
   <a-goes-to>b</a-goes-to>
   <b-goes-to>c</b-goes-to>
   <c-goes-to>d</c-goes-to>
</doc>

Schematron checks

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron"
          xmlns:t="http://xproc.org/ns/testsuite/3.0" queryBinding="xslt2">
   <s:pattern>
      <s:rule context="/">
         <s:assert test="doc">The document root is not 'doc'.</s:assert>
         <s:assert test="doc/location">Document does not have a child element named 'location'</s:assert>
         <s:assert test="doc/location/text()='This is d'">The text in element 'location' is not right.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

23 May 2025, Norm Tovey-Walsh
Added static options for web server host and port.
14 Oct 2024, Achim Berndzen
Initial check in