| 1 |
<?xml version="1.0"?> |
|---|
| 2 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|---|
| 3 |
xmlns:xslo="http://www.w3.org/1999/XSL/TransformAlias" |
|---|
| 4 |
xmlns:fo="http://www.w3.org/1999/XSL/Format" |
|---|
| 5 |
exclude-result-prefixes="fo" |
|---|
| 6 |
version="1.0"> |
|---|
| 7 |
|
|---|
| 8 |
<xsl:include href="../lib/lib.xsl"/> |
|---|
| 9 |
|
|---|
| 10 |
<xsl:output method="xml" encoding="US-ASCII"/> |
|---|
| 11 |
|
|---|
| 12 |
<xsl:namespace-alias stylesheet-prefix="xslo" result-prefix="xsl"/> |
|---|
| 13 |
|
|---|
| 14 |
<xsl:preserve-space elements="*"/> |
|---|
| 15 |
|
|---|
| 16 |
<xsl:template match="/"> |
|---|
| 17 |
<xsl:text> </xsl:text> |
|---|
| 18 |
<xsl:comment>This file was created automatically by xsl2profile</xsl:comment> |
|---|
| 19 |
<xsl:text> </xsl:text> |
|---|
| 20 |
<xsl:comment>from the DocBook XSL stylesheets. Do not edit this file.</xsl:comment> |
|---|
| 21 |
<xsl:text> </xsl:text> |
|---|
| 22 |
<xsl:apply-templates/> |
|---|
| 23 |
<xsl:text> </xsl:text> |
|---|
| 24 |
</xsl:template> |
|---|
| 25 |
|
|---|
| 26 |
<!-- Make sure we override some templates and parameters appropriately for XHTML --> |
|---|
| 27 |
<xsl:template match="xsl:stylesheet"> |
|---|
| 28 |
<xsl:copy> |
|---|
| 29 |
<xsl:attribute name="exslt:dummy" xmlns:exslt="http://exslt.org/common">dummy</xsl:attribute> |
|---|
| 30 |
<xsl:if test="not(@extension-element-prefixes)"> |
|---|
| 31 |
<xsl:attribute name="extension-element-prefixes">exslt</xsl:attribute> |
|---|
| 32 |
</xsl:if> |
|---|
| 33 |
<xsl:if test="not(@exclude-result-prefixes)"> |
|---|
| 34 |
<xsl:attribute name="exclude-result-prefixes">exslt</xsl:attribute> |
|---|
| 35 |
</xsl:if> |
|---|
| 36 |
<xsl:for-each select="@*"> |
|---|
| 37 |
<xsl:choose> |
|---|
| 38 |
<xsl:when test="local-name(.) = 'extension-element-prefixes' or |
|---|
| 39 |
local-name(.) = 'exclude-result-prefixes'"> |
|---|
| 40 |
<xsl:attribute name="{local-name(.)}"><xsl:value-of select="concat(., ' exslt')"/></xsl:attribute> |
|---|
| 41 |
</xsl:when> |
|---|
| 42 |
<xsl:otherwise> |
|---|
| 43 |
<xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute> |
|---|
| 44 |
</xsl:otherwise> |
|---|
| 45 |
</xsl:choose> |
|---|
| 46 |
</xsl:for-each> |
|---|
| 47 |
<xsl:apply-templates/> |
|---|
| 48 |
</xsl:copy> |
|---|
| 49 |
</xsl:template> |
|---|
| 50 |
|
|---|
| 51 |
<xsl:template match="*"> |
|---|
| 52 |
<xsl:copy> |
|---|
| 53 |
<xsl:copy-of select="@*"/> |
|---|
| 54 |
<xsl:apply-templates/> |
|---|
| 55 |
</xsl:copy> |
|---|
| 56 |
</xsl:template> |
|---|
| 57 |
|
|---|
| 58 |
<xsl:template match="comment()|processing-instruction()|text()"> |
|---|
| 59 |
<xsl:copy/> |
|---|
| 60 |
</xsl:template> |
|---|
| 61 |
|
|---|
| 62 |
<xsl:template match="xsl:template[@match='/' or @name='hhc-main' or @name='hhp-main']"> |
|---|
| 63 |
<xsl:if test="@match='/'"> |
|---|
| 64 |
<xslo:include href="../profiling/profile-mode.xsl"/> |
|---|
| 65 |
</xsl:if> |
|---|
| 66 |
<xsl:copy> |
|---|
| 67 |
<xsl:copy-of select="@*"/> |
|---|
| 68 |
<xslo:variable name="profiled-content"> |
|---|
| 69 |
<xslo:apply-templates select="." mode="profile"/> |
|---|
| 70 |
</xslo:variable> |
|---|
| 71 |
<xslo:variable name="profiled-nodes" select="exslt:node-set($profiled-content)"/> |
|---|
| 72 |
|
|---|
| 73 |
<xsl:apply-templates mode="correct"/> |
|---|
| 74 |
</xsl:copy> |
|---|
| 75 |
</xsl:template> |
|---|
| 76 |
|
|---|
| 77 |
<xsl:template match="*[@select='/']" mode="correct"> |
|---|
| 78 |
<xsl:copy> |
|---|
| 79 |
<xsl:for-each select="@*"> |
|---|
| 80 |
<xsl:choose> |
|---|
| 81 |
<xsl:when test="local-name(.) = 'select' and string(.) = '/'"> |
|---|
| 82 |
<xsl:attribute name="{local-name(.)}">$profiled-nodes</xsl:attribute> |
|---|
| 83 |
</xsl:when> |
|---|
| 84 |
<xsl:otherwise> |
|---|
| 85 |
<xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute> |
|---|
| 86 |
</xsl:otherwise> |
|---|
| 87 |
</xsl:choose> |
|---|
| 88 |
</xsl:for-each> |
|---|
| 89 |
<xsl:apply-templates mode="correct"/> |
|---|
| 90 |
</xsl:copy> |
|---|
| 91 |
</xsl:template> |
|---|
| 92 |
|
|---|
| 93 |
<xsl:template match='*[contains(@*, "key('id',$rootid)")]' mode="correct" priority="2"> |
|---|
| 94 |
<xsl:copy> |
|---|
| 95 |
<xsl:for-each select="@*"> |
|---|
| 96 |
<xsl:choose> |
|---|
| 97 |
<xsl:when test='contains(., "key('id',$rootid)")'> |
|---|
| 98 |
<xsl:attribute name="{local-name(.)}"> |
|---|
| 99 |
<xsl:call-template name="string.subst"> |
|---|
| 100 |
<xsl:with-param name="string" select="."/> |
|---|
| 101 |
<xsl:with-param name="target">key('id',$rootid)</xsl:with-param> |
|---|
| 102 |
<xsl:with-param name="replacement">$profiled-nodes//*[@id=$rootid]</xsl:with-param> |
|---|
| 103 |
</xsl:call-template> |
|---|
| 104 |
</xsl:attribute> |
|---|
| 105 |
</xsl:when> |
|---|
| 106 |
<xsl:otherwise> |
|---|
| 107 |
<xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute> |
|---|
| 108 |
</xsl:otherwise> |
|---|
| 109 |
</xsl:choose> |
|---|
| 110 |
</xsl:for-each> |
|---|
| 111 |
<xsl:apply-templates mode="correct"/> |
|---|
| 112 |
</xsl:copy> |
|---|
| 113 |
</xsl:template> |
|---|
| 114 |
|
|---|
| 115 |
<!-- FO stylesheet has apply-templates without select, we must detect it by context --> |
|---|
| 116 |
<xsl:template match="fo:root//xsl:apply-templates" mode="correct"> |
|---|
| 117 |
<xsl:copy> |
|---|
| 118 |
<xsl:copy-of select="@*"/> |
|---|
| 119 |
<xsl:attribute name="select">$profiled-nodes/node()</xsl:attribute> |
|---|
| 120 |
<xsl:apply-templates mode="correct"/> |
|---|
| 121 |
</xsl:copy> |
|---|
| 122 |
</xsl:template> |
|---|
| 123 |
|
|---|
| 124 |
<xsl:template match="*" mode="correct"> |
|---|
| 125 |
<xsl:copy> |
|---|
| 126 |
<xsl:copy-of select="@*"/> |
|---|
| 127 |
<xsl:apply-templates mode="correct"/> |
|---|
| 128 |
</xsl:copy> |
|---|
| 129 |
</xsl:template> |
|---|
| 130 |
|
|---|
| 131 |
<xsl:template match="comment()|processing-instruction()|text()" mode="correct"> |
|---|
| 132 |
<xsl:copy/> |
|---|
| 133 |
</xsl:template> |
|---|
| 134 |
|
|---|
| 135 |
</xsl:stylesheet> |
|---|