AB-xslt-052

Tests that stylesheet's uri is used as output base-uri if no other is found. (3.0)

Test ab-xslt-052.xml is expected to pass.

It requires the following features: xslt-3.

The pipeline


      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
         <p:output port="result"/>
         <p:xslt version="3.0" template-name="start">
            <p:with-input port="source">
               <p:empty/>
            </p:with-input>
            <p:with-input port="stylesheet">
               <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" xml:base="http://xproc-test/doc.xml">
                  <xsl:output xmlns:xsl="http://www.w3.org/1999/XSL/Transform" method="xml" indent="true" encoding="UTF-8"/>
                  <xsl:template xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="start">
                     <doc xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns=""/>
                     <xsl:result-document xmlns:xsl="http://www.w3.org/1999/XSL/Transform" href="doc1.xml">
                        <doc1 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns=""/>
                     </xsl:result-document>
                  </xsl:template>
               </xsl:stylesheet>
            </p:with-input>
         </p:xslt>
         
         <p:variable name="uri1" select="base-uri(.)"/>
         <p:variable name="uri2" select="base-uri(.)" pipe="secondary"/>
         <p:variable name="prop-uri1" select="p:document-property(.,'base-uri')"/>
         <p:variable name="prop-uri2" select="p:document-property(.,'base-uri')" pipe="secondary"/>
         
         <p:identity>
            <p:with-input>
               <result xmlns="">
                  <primary-uri>{$uri1}</primary-uri>
                  <secondary-uri>{$uri2}</secondary-uri>
                  <primary-docprop>{$prop-uri1}</primary-docprop>
                  <secondary-docprop>{$prop-uri2}</secondary-docprop>
               </result>
            </p:with-input>
         </p:identity>
      </p:declare-step>
   

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="result">The document root is not 'result'.</s:assert>
               <s:assert test="result/primary-uri/text()='http://xproc-test/doc.xml'">URI is not 'http://xproc-test/doc.xml'.</s:assert>
               <s:assert test="result/secondary-uri/text()='http://xproc-test/doc1.xml'">URI is not 'http://xproc-test/doc1.xml'.</s:assert>
               <s:assert test="result/primary-docprop/text()='http://xproc-test/doc.xml'">URI is not 'http://xproc-test/doc.xml'.</s:assert>
               <s:assert test="result/secondary-docprop/text()='http://xproc-test/doc1.xml'">URI is not 'http://xproc-test/doc1.xml'.</s:assert>               
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

06 Aug 2019, Achim Berndzen

Added feature xslt-serialization to test.

04 Aug 2019, Achim Berndzen

Initial commit