ab-p-document 043 (AB)

Testing p:document: Redirects must be followed.

Test ab-p-document-043.xml is expected to pass.

It requires the following features: webaccess.

The pipeline


<p:declare-step xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
   <p:output port="result"/>
   <p:identity>
      <p:with-input>
         <p:document href="http://localhost:8246/service/this-is-a"/>
      </p:with-input>
   </p:identity>
   <p:identity>
      <p:with-input>
         <result>
            <prop>{p:document-property(., 'base-uri')}</prop>
            <base>{fn:base-uri(.)}</base>
         </result>
      </p:with-input>
   </p:identity>
</p:declare-step>

Schematron validation


<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:pattern>
      <s:rule context="/">
         <s:assert test="result">The document root is not 'result'.</s:assert>
         <s:assert test="result/prop">Document does not have a child element named 'prop'</s:assert>
         <s:assert test="result/prop/text()='http://localhost:8246/service/this-is-d'">The text in element 'prop' is not right.</s:assert>
         <s:assert test="result/base">Document does not have a child element named 'base'</s:assert>
         <s:assert test="result/base/text()='http://localhost:8246/service/this-is-d'">The text in element 'base' is not right.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

17 Oct 2024, Norm Tovey-Walsh

Fixed typo.

14 Oct 2024, Achim Berndzen

Initial check in