p:document 007

Tests p:document with relative @href and 'base-uri' in document-properties: Makes sure that document-property "base-uri" is set correctly.

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

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="../documents/ab-doc.xml" document-properties="map{xs:QName('base-uri'):'http://www.w3.org'}"/>
                </p:with-input>
            </p:identity>
            
            <p:identity>
                <p:with-input select="p:document-properties-document(.)"/>
            </p:identity>
        </p:declare-step>
   
MorganaXProc passing XML Calabash passing

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:ns uri="http://www.w3.org/ns/xproc" prefix="p"/>
         <s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="c:document-properties">The document root is not c:document-properties.</s:assert>
               <s:assert test="string-length(c:document-properties/base-uri) != 0">Base-uri is not set.</s:assert>
               <s:assert test="starts-with(c:document-properties/base-uri,'http://www.w3.org')">Base-uri is not set correctly</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

22 Oct 2018, Norman Walsh

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

05 Oct 2018 17:08, Achim Berndzen

Fixed wrong condition in schematron test

02 May 2018 18:16, Achim Berndzen

Change test with document-properties to map{xs:QName, item()}

03 Apr 2018 16:57, Achim Berndzen

Some new tests.