New tests for overriding of template rules
authorMichael Kay <mike@saxonica.com>
Tue, 18 Jul 2017 22:27:09 +0100
changeset 1724 1e1a7646a90e
parent 1723 9f7bb7d3030b
child 1725 e90178818455
New tests for overriding of template rules
tests/decl/use-package/_use-package-test-set.xml
tests/decl/use-package/use-package-160-common.xsl
tests/decl/use-package/use-package-160-functions.xsl
tests/decl/use-package/use-package-160-logger.xsl
tests/decl/use-package/use-package-160-runner.xsl
tests/decl/use-package/use-package-160-variables.xsl
tests/decl/use-package/use-package-160.xml
tests/decl/use-package/use-package-160a.xsl
tests/decl/use-package/use-package-160b.xsl
tests/decl/use-package/use-package-170.xml
tests/decl/use-package/use-package-170a.xsl
tests/decl/use-package/use-package-170b.xsl
tests/decl/use-package/use-package-170c.xsl
tests/decl/use-package/use-package-171a.xsl
tests/decl/use-package/use-package-172a.xsl
tests/decl/use-package/use-package-173a.xsl
--- a/tests/decl/use-package/_use-package-test-set.xml	Sun Jul 16 00:08:21 2017 +0100
+++ b/tests/decl/use-package/_use-package-test-set.xml	Tue Jul 18 22:27:09 2017 +0100
@@ -43,6 +43,28 @@
          uri="http://www.w3.org/2013/XSLT/xml-to-json.xsl" package-version="1.0"/>
       <param name="STREAMABLE" as="xs:boolean" static="yes" select="true()"/>
    </environment>
+   
+   <environment name="use-package-160">
+      <source file="use-package-160.xml" role="."/>
+      <package file="use-package-160-variables.xsl" role="secondary"
+         uri="http://www.160.com/generalVariables" package-version="0.1"/>
+      <package file="use-package-160-functions.xsl" role="secondary"
+         uri="http://www.160.com/generalFunctions" package-version="0.1"/>
+      <package file="use-package-160-logger.xsl" role="secondary"
+         uri="http://www.160.com/logger" package-version="0.1"/>
+      <package file="use-package-160-runner.xsl" role="secondary"
+         uri="http://www.160.com/runner" package-version="0.1"/>
+      <package file="use-package-160-common.xsl" role="secondary"
+         uri="http://www.160.com/common" package-version="0.1"/>
+   </environment>
+   
+   <environment name="use-package-170">
+      <source file="use-package-170.xml" role="."/>
+      <package file="use-package-170c.xsl" role="secondary"
+         uri="urn:170c" package-version="1.0"/>
+      <package file="use-package-170b.xsl" role="secondary"
+         uri="urn:170b" package-version="1.0"/>
+   </environment>
 
    <dependencies>
       <spec value="XSLT30+"/>
@@ -324,6 +346,85 @@
          <assert>/out = '{"desc":"Distances between several cities, in kilometers.","updated":"2014-02-04T18:50:45","uptodate":true,"author":null,"cities":{"Brussels":[{"to":"London","distance":322},{"to":"Paris","distance":265},{"to":"Amsterdam","distance":173}],"London":[{"to":"Brussels","distance":322},{"to":"Paris","distance":344},{"to":"Amsterdam","distance":358}],"Paris":[{"to":"Brussels","distance":265},{"to":"London","distance":344},{"to":"Amsterdam","distance":431}],"Amsterdam":[{"to":"Brussels","distance":173},{"to":"London","distance":358},{"to":"Paris","distance":431}]}}'</assert>
       </result>
    </test-case>
+   
+   <test-case name="use-package-160">
+      <description>A more complex package hierarchy</description>
+      <created by="Michael Kay after Mark Dunn" on="2017-07-17"/>
+      <environment ref="use-package-160"/>
+      <test>
+         <stylesheet file="use-package-160a.xsl" role="principal"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<output><log>Oxford</log><city>Oxford</city></output>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-package-161">
+      <description>A more complex package hierarchy</description>
+      <created by="Michael Kay after Mark Dunn" on="2017-07-17"/>
+      <environment ref="use-package-160"/>
+      <test>
+         <stylesheet file="use-package-160b.xsl" role="principal"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<output><log>Oxford</log><city>Oxford</city></output>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-package-170">
+      <description>A more complex package hierarchy</description>
+      <created by="Michael Kay after Toshihito Makita" on="2017-07-17"/>
+      <environment ref="use-package-170"/>
+      <test>
+         <stylesheet file="use-package-170a.xsl" role="principal"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" color="red"
+            ><fo:inline>ph:Phrase text</fo:inline><fo:inline font-weight="bold">Bold text</fo:inline></fo:block>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-package-171">
+      <description>Variant of -170 with a mode explicitly accepted</description>
+      <created by="Michael Kay after Toshihito Makita" on="2017-07-17"/>
+      <environment ref="use-package-170"/>
+      <test>
+         <stylesheet file="use-package-171a.xsl" role="principal"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" color="red"
+            ><fo:inline>ph:Phrase text</fo:inline><fo:inline font-weight="bold">Bold text</fo:inline></fo:block>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-package-172">
+      <description>Variant of -170 with multiple layers of template rule overriding</description>
+      <created by="Michael Kay" on="2017-07-17"/>
+      <environment ref="use-package-170"/>
+      <test>
+         <stylesheet file="use-package-172a.xsl" role="principal"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" color="red"
+            ><fo:inline>right:Phrase text</fo:inline><fo:inline>right:Bold text</fo:inline></fo:block>]]></assert-xml>
+      </result>
+   </test-case>
+   
+   <test-case name="use-package-173">
+      <description>Variant of -170 with multiple layers of template rule overriding and next-match</description>
+      <created by="Michael Kay" on="2017-07-17"/>
+      <environment ref="use-package-170"/>
+      <test>
+         <stylesheet file="use-package-173a.xsl" role="principal"/>
+      </test>
+      <result>
+         <assert-xml><![CDATA[<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" color="red"
+            ><fo:inline>one:<fo:inline>two:<fo:inline>ph:Phrase text</fo:inline></fo:inline
+            ></fo:inline><fo:inline>one:<fo:inline>two:<fo:inline>ph:Bold text</fo:inline
+            ></fo:inline></fo:inline></fo:block>]]></assert-xml>
+      </result>
+   </test-case>
+   
 
    <test-case name="use-package-201">
       <description>Testing package versioning - version 1.0.0</description>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-160-common.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+    xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    name="http://www.160.com/common"
+    package-version="0.1"
+    version="3.0">
+        
+    <xsl:use-package name="http://www.160.com/logger" package-version="0.1">
+        <xsl:accept component="*" names="*" visibility="public"/> 
+    </xsl:use-package>
+    <xsl:use-package name="http://www.160.com/generalFunctions" package-version="0.1">
+        <xsl:accept component="*" names="*" visibility="public"/>
+    </xsl:use-package>
+    <xsl:use-package name="http://www.160.com/generalVariables" package-version="0.1">
+        <xsl:accept component="*" names="*" visibility="public"/>
+    </xsl:use-package>
+    <xsl:use-package name="http://www.160.com/runner" package-version="0.1">
+        <xsl:accept component="*" names="*" visibility="public"/>
+    </xsl:use-package>
+    
+    
+</xsl:package>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-160-functions.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
+  xmlns:oupdtg="http://www.160.com/oupdtg" 
+  name="http://www.160.com/generalFunctions"
+  package-version="0.1"
+  exclude-result-prefixes="#all" 
+  version="3.0">
+  
+
+  <xsl:use-package name="http://www.160.com/generalVariables" package-version="0.1">
+    <xsl:accept component="*" names="*" visibility="private"/>
+  </xsl:use-package>
+  
+
+  <xsl:function name="oupdtg:getCity" visibility="public">
+    <city>
+      <xsl:value-of select="$oupdtg:city"/>
+    </city>
+  </xsl:function>
+  
+</xsl:package>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-160-logger.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
+  xmlns:oupdtg="http://www.160.com/oupdtg" 
+  name="http://www.160.com/logger"
+  package-version="0.1"
+  exclude-result-prefixes="#all" 
+  version="3.0">
+  
+ 
+
+  <xsl:use-package name="http://www.160.com/generalVariables" package-version="0.1">
+    <xsl:accept component="*" names="*" visibility="private"/>
+  </xsl:use-package>
+  
+
+  <xsl:template name="oupdtg:log" visibility="public">
+    <log>
+      <xsl:value-of select="$oupdtg:city"/>
+    </log>
+  </xsl:template>
+  
+</xsl:package>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-160-runner.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
+  xmlns:oupdtg="http://www.160.com/oupdtg" 
+  name="http://www.160.com/runner"
+  package-version="0.1"
+  exclude-result-prefixes="#all" 
+  version="3.0">
+  
+  
+  <xd:doc scope="stylesheet">
+    <xd:desc>
+      <xd:p><xd:b>Created on:</xd:b> 2017-07-04</xd:p>
+      <xd:p><xd:b>Author:</xd:b> Mark Dunn</xd:p>
+      <xd:p><xd:b>Description:</xd:b> Test inclusion of packages. https://saxonica.plan.io/issues/3333</xd:p>
+    </xd:desc>
+  </xd:doc>
+
+
+  <xsl:use-package name="http://www.160.com/logger" package-version="0.1">
+    <xsl:accept component="*" names="*" visibility="private"/>    
+  </xsl:use-package>
+  <xsl:use-package name="http://www.160.com/generalFunctions" package-version="0.1">
+    <xsl:accept component="*" names="*" visibility="private"/>
+  </xsl:use-package>
+  
+  <xsl:mode name="transform" visibility="public"/>
+  
+  
+
+  <xsl:template match="*" mode="transform">
+    <output>
+      <xsl:call-template name="oupdtg:log"/>
+      <xsl:copy-of select="oupdtg:getCity()"/>
+    </output>
+  </xsl:template>
+  
+</xsl:package>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-160-variables.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
+    xmlns:oupdtg="http://www.160.com/oupdtg" 
+    name="http://www.160.com/generalVariables"
+    package-version="0.1"
+    version="3.0">
+    
+
+    
+    <xsl:variable name="oupdtg:city" as="xs:string" visibility="public" select="'Oxford'"/>
+    
+     
+</xsl:package>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-160.xml	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TEST>
+    <!-- test comment -->
+    <test1 test="yes">Child 1</test1>
+    <test2 purpose="display" rename="yes">Child 2</test2>
+</TEST>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-160a.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
+    xmlns:map="http://www.w3.org/2005/xpath-functions/map"
+    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
+    xmlns:oupdtg="http://www.160.com/oupdtg"
+    exclude-result-prefixes="#all"
+    version="3.0">
+    
+    <xsl:use-package name="http://www.160.com/common" package-version="0.1"/>
+    
+    <xsl:template match="/">
+        <output>
+            <xsl:call-template name="oupdtg:log"/>
+            <xsl:copy-of select="oupdtg:getCity()"/>
+        </output>
+    </xsl:template>
+        
+ 
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-160b.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
+    xmlns:map="http://www.w3.org/2005/xpath-functions/map"
+    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
+    xmlns:oupdtg="http://www.160.com/oupdtg" 
+    version="3.0">
+    
+    <xsl:use-package name="http://www.160.com/runner" package-version="0.1"/>
+    
+    <xsl:template match="/">
+        <xsl:apply-templates select="*" mode="transform"/>
+    </xsl:template>
+        
+ 
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-170.xml	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dita-doc>
+    <ph class="- topic/ph ">Phrase text</ph>
+    <b class="+ topic/ph hi-d/b ">Bold text</b>
+</dita-doc>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-170a.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"
+    xmlns:ahf="http://www.antennahouse.com/Names/XSLT/Document"
+    exclude-result-prefixes="xs math ahf"
+    version="3.0"
+    name="urn:170a">
+    
+    <xsl:use-package name="urn:170b"/>
+    <xsl:mode/>
+    
+    <xsl:template match="/*">
+        <fo:block>
+            <xsl:copy-of select="ahf:setRed()"/>
+            <xsl:apply-templates mode="normal"/>
+        </fo:block>
+    </xsl:template>
+    
+</xsl:package>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-170b.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"
+    package-version="1.0"
+    name="urn:170b"
+    exclude-result-prefixes="xs"
+    version="3.0">
+    
+    <xsl:mode/>
+    
+    <xsl:use-package name="urn:170c" package-version="1.0">
+        <xsl:accept component="template" names="*" visibility="public" />
+        <xsl:accept component="function" names="*:setRed" visibility="public" />
+        <xsl:accept component="mode" names="normal" visibility="public" />
+        <xsl:override>
+            <xsl:template match="*[contains(@class,' topic/ph ')]" mode="normal">
+                <fo:inline>
+                    <xsl:text>ph:</xsl:text>
+                    <xsl:apply-templates/>
+                </fo:inline>
+            </xsl:template>
+        </xsl:override>
+    </xsl:use-package>
+    
+</xsl:package>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-170c.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"
+    xmlns:ahf="http://www.antennahouse.com/Names/XSLT/Document"
+    package-version="1.0"
+    name="urn:170c"
+    exclude-result-prefixes="xs ahf"
+    version="3.0"
+    default-mode="normal">
+    
+    <xsl:mode name="normal" visibility="public"/>
+    <xsl:mode/>
+    
+    <xsl:template match="*[contains(@class,' topic/ph ')]" name="tplPh">
+        <fo:inline matched-by="tplPh">
+            <xsl:apply-templates/>
+        </fo:inline>
+    </xsl:template>
+    
+    <xsl:template match="*[contains(@class,' hi-d/b ')]" priority="2" name="tplB">
+        <fo:inline font-weight="bold">
+            <xsl:apply-templates/>
+        </fo:inline>
+    </xsl:template>
+    
+    <xsl:function name="ahf:setRed" as="attribute()*" visibility="public">
+        <xsl:attribute name="color" select="'red'"/>
+    </xsl:function>
+    
+</xsl:package>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-171a.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"
+    xmlns:ahf="http://www.antennahouse.com/Names/XSLT/Document"
+    exclude-result-prefixes="xs math ahf"
+    version="3.0"
+    name="urn:170a">
+    
+    <xsl:use-package name="urn:170b">
+        <xsl:accept component="mode" names="normal" visibility="public" />
+    </xsl:use-package>
+    
+    <xsl:mode/>
+    
+    <xsl:template match="/*">
+        <fo:block>
+            <xsl:copy-of select="ahf:setRed()"/>
+            <xsl:apply-templates mode="normal"/>
+        </fo:block>
+    </xsl:template>
+    
+</xsl:package>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-172a.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"
+    xmlns:ahf="http://www.antennahouse.com/Names/XSLT/Document"
+    exclude-result-prefixes="xs math ahf"
+    version="3.0"
+    name="urn:170a">
+    
+    <xsl:use-package name="urn:170b">
+        <xsl:override>
+            <xsl:template match="*[contains(@class,' topic/ph ')]" mode="normal">
+                <fo:inline>
+                    <xsl:text>wrong:</xsl:text>
+                    <xsl:apply-templates/>
+                </fo:inline>
+            </xsl:template>
+            <xsl:template match="*[contains(@class,'/ph ')]" mode="normal">
+                <fo:inline>
+                    <xsl:text>right:</xsl:text>
+                    <xsl:apply-templates/>
+                </fo:inline>
+            </xsl:template>
+        </xsl:override>
+    </xsl:use-package>
+    
+    <xsl:mode/>
+    
+    <xsl:template match="/*">
+        <fo:block>
+            <xsl:copy-of select="ahf:setRed()"/>
+            <xsl:apply-templates mode="normal"/>
+        </fo:block>
+    </xsl:template>
+    
+</xsl:package>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/decl/use-package/use-package-173a.xsl	Tue Jul 18 22:27:09 2017 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:package xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"
+    xmlns:ahf="http://www.antennahouse.com/Names/XSLT/Document"
+    exclude-result-prefixes="xs math ahf"
+    version="3.0"
+    name="urn:170a">
+    
+    <xsl:use-package name="urn:170b">
+        <xsl:override>
+            <xsl:template match="*[contains(@class,' topic/ph ')]" mode="normal">
+                <fo:inline>
+                    <xsl:text>two:</xsl:text>
+                    <xsl:next-match/>
+                </fo:inline>
+            </xsl:template>
+            <xsl:template match="*[contains(@class,'/ph ')]" mode="normal">
+                <fo:inline>
+                    <xsl:text>one:</xsl:text>
+                    <xsl:next-match/>
+                </fo:inline>
+            </xsl:template>
+        </xsl:override>
+    </xsl:use-package>
+    
+    <xsl:mode/>
+    
+    <xsl:template match="/*">
+        <fo:block>
+            <xsl:copy-of select="ahf:setRed()"/>
+            <xsl:apply-templates mode="normal"/>
+        </fo:block>
+    </xsl:template>
+    
+</xsl:package>