p:document 004

Tests p:document set document-property 'base-uri' correct: Relative uri in @href: Base uri of p:document to be used.

Test ab-p-document004.xml is expected to pass.

It requires the following features: webaccess.

The pipeline


<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
   <p:output port="result"/>
   <p:identity>
      <p:with-input>
         <p:document href="test-suite.html" xml:base="https://xproc.org/"/>
      </p:with-input>
   </p:identity>
   <p:cast-content-type content-type="application/xml">
      <p:with-input select="p:document-properties(.)"/>
   </p:cast-content-type>
</p:declare-step>
MorganaXProc passing XML Calabash passing

Schematron validation


<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:ns uri="http://www.w3.org/ns/xproc" prefix="p"/>
   <s:ns prefix="j" uri="http://www.w3.org/2005/xpath-functions"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="j:map">The document root is not map.</s:assert>
         <s:assert test="starts-with(j:map/j:string[@key='content-type']/text(), 'text/html')">Content type is not text/html.</s:assert>
         <s:assert test="j:map/j:string[@key='base-uri']/text() = 'https://xproc.org/test-suite.html'">The base-uri property is not correct.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

14 Oct 2024, Achim Berndzen

Changed test, so an existing resource is resolved.

10 Jun 2021, Achim Berndzen

Added attribute 'queryBinding' to schematron's schema.

18 Nov 2019, Achim Berndzen

Changed test from p:document-properties-document() to p:document-properties()

31 Aug 2019, Achim Berndzen

Change target for http-request to xproc.org.

22 Oct 2018, Norman Walsh

Fixed result document ( c:document-properties, not p:document-properties)

03 Apr 2018 16:57, Achim Berndzen

Some new tests.