|
251 | 251 | </xsl:call-template>
|
252 | 252 | </xsl:template>
|
253 | 253 |
|
| 254 | +<xsl:template name="href.target"> |
| 255 | + <xsl:param name="context" select="."/> |
| 256 | + <xsl:param name="object" select="."/> |
| 257 | + <xsl:param name="toc-context" select="."/> |
| 258 | + <!-- Optimization for pgsql-docs: Remove support for dbhtml processing |
| 259 | + instruction here --> |
| 260 | + <xsl:variable name="href.to.uri"> |
| 261 | + <xsl:call-template name="href.target.uri"> |
| 262 | + <xsl:with-param name="object" select="$object"/> |
| 263 | + </xsl:call-template> |
| 264 | + </xsl:variable> |
| 265 | + <xsl:variable name="href.from.uri"> |
| 266 | + <xsl:choose> |
| 267 | + <xsl:when test="not($toc-context = .)"> |
| 268 | + <xsl:call-template name="href.target.uri"> |
| 269 | + <xsl:with-param name="object" select="$toc-context"/> |
| 270 | + </xsl:call-template> |
| 271 | + </xsl:when> |
| 272 | + <xsl:otherwise> |
| 273 | + <xsl:call-template name="href.target.uri"> |
| 274 | + <xsl:with-param name="object" select="$context"/> |
| 275 | + </xsl:call-template> |
| 276 | + </xsl:otherwise> |
| 277 | + </xsl:choose> |
| 278 | + </xsl:variable> |
| 279 | + <xsl:variable name="href.to"> |
| 280 | + <xsl:value-of select="$href.to.uri"/> |
| 281 | + </xsl:variable> |
| 282 | + <xsl:variable name="href.from"> |
| 283 | + <xsl:call-template name="trim.common.uri.paths"> |
| 284 | + <xsl:with-param name="uriA" select="$href.to.uri"/> |
| 285 | + <xsl:with-param name="uriB" select="$href.from.uri"/> |
| 286 | + <xsl:with-param name="return" select="'B'"/> |
| 287 | + </xsl:call-template> |
| 288 | + </xsl:variable> |
| 289 | + <xsl:variable name="depth"> |
| 290 | + <xsl:call-template name="count.uri.path.depth"> |
| 291 | + <xsl:with-param name="filename" select="$href.from"/> |
| 292 | + </xsl:call-template> |
| 293 | + </xsl:variable> |
| 294 | + <xsl:variable name="href"> |
| 295 | + <xsl:call-template name="copy-string"> |
| 296 | + <xsl:with-param name="string" select="'../'"/> |
| 297 | + <xsl:with-param name="count" select="$depth"/> |
| 298 | + </xsl:call-template> |
| 299 | + <xsl:value-of select="$href.to"/> |
| 300 | + </xsl:variable> |
| 301 | + <xsl:value-of select="$href"/> |
| 302 | +</xsl:template> |
| 303 | + |
254 | 304 | <xsl:template name="html.head">
|
255 | 305 | <xsl:param name="prev" select="/foo"/>
|
256 | 306 | <xsl:param name="next" select="/foo"/>
|
|
0 commit comments