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 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: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>
Result
<map xmlns="http://www.w3.org/2005/xpath-functions"
xmlns:t="http://xproc.org/ns/testsuite/3.0">
<string key="x-fastly-request-id">048d1d4657314224ea1d57fab5e2264bbdf1d957</string>
<string key="x-proxy-cache">MISS</string>
<string key="content-type">text/html</string>
<string key="via">1.1 varnish</string>
<string key="x-github-request-id">9006:2D46C7:F9B2C4:FB6E8A:6891BC2C</string>
<string key="date">Tue, 05 Aug 2025 08:25:42 GMT</string>
<string key="x-cache">HIT</string>
<string key="access-control-allow-origin">*</string>
<string key="server">GitHub.com</string>
<string key="last-modified">Thu, 31 Jul 2025 15:57:37 GMT</string>
<string key="x-cache-hits">0</string>
<string key="x-served-by">cache-fra-eddf8230043-FRA</string>
<string key="accept-ranges">bytes</string>
<string key="connection">keep-alive</string>
<string key="age">0</string>
<string key="vary">Accept-Encoding</string>
<string key="cache-control">max-age=600</string>
<string key="x-origin-cache">HIT</string>
<string key="x-timer">S1754382342.446209,VS0,VE109</string>
<string key="base-uri">https://xproc.org/test-suite.html</string>
<string key="expires">Tue, 05 Aug 2025 08:19:19 GMT</string>
<string key="etag">W/"688b9271-8d2"</string>
</map>
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 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, Achim Berndzen
- Some new tests.