<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="../xsl/html.xsl"/>
<xsl:include href="../xsl/nav.xsl"/>
<xsl:include href="../xsl/banner.xsl"/>
<xsl:variable name="topics" select="document('../xml/topics.xml')" />
<xsl:variable name="p4web-url">http://perforce</xsl:variable>
<xsl:variable name="bug-url">http://bugs/show_bug.cgi?id=</xsl:variable>
<xsl:key name="ItemKey" match="/content/section/item" use="@id"/>
<!-- html output -->
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="/content/topic/@title"/></title>
<link rel="stylesheet" type="text/css" href="../css/road.css" />
<script type="text/javascript" src="../js/road.js"></script>
</head>
<body>
<div id="page">
<xsl:call-template name="banner"/>
<xsl:call-template name="nav"/>
<div id="content">
<h2 id="TOP"><xsl:value-of select="/content/topic/@title"/></h2>
<xsl:apply-templates select="/content/topic" />
<!-- table of contents -->
<xsl:for-each select="/content/section">
<xsl:variable name="section-id" select="@id" />
<div class="sectionheader">
<h4 id="{@id}"><a href="#TOP"><img src="../img/nav/up.gif" class="uparrow" width="11" height="9" border="0" alt="UP" /></a><xsl:value-of select="@title" /></h4>
</div>
<div class="sectionbody">
<xsl:apply-templates select="node()[name(.)!='item']"/>
</div>
<div class="sectionitems">
<ul>
<xsl:choose>
<xsl:when test="@order='sorted'">
<xsl:for-each select="./item">
<xsl:sort select="@title" order="ascending" />
<li><a href="#{@id}"><xsl:value-of select="@title" /></a></li>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="./item">
<li><a href="#{@id}"><xsl:value-of select="@title" /></a></li>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</ul>
</div>
</xsl:for-each>
<p>Updated: <xsl:value-of select="concat(substring(/content/topic/@fileChange, 42), ' ', substring(/content/topic/@fileChange, 12, 10))"/></p>
<!-- answers -->
<div id="answers">
<xsl:for-each select="/content/section">
<xsl:variable name="section-id" select="@id" />
<xsl:if test="count(item) != 0">
<div class="sectionheader">
<h4><xsl:value-of select="@title" /></h4>
</div>
</xsl:if>
<xsl:choose>
<xsl:when test="@order='sorted'">
<xsl:for-each select="./item">
<xsl:sort select="@title" order="ascending" />
<xsl:call-template name="item-contents" />
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="./item">
<xsl:call-template name="item-contents" />
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</div>
</div>
</div>
</body>
</html>
</xsl:template>
<xsl:template name="item-contents">
<div class="faq-title">
<h5 id="{@id}"><a href="#TOP">
<img src="../img/nav/up.gif" class="uparrow" width="11" height="9" border="0" alt="UP" /></a>
<xsl:value-of select="@title" />
<xsl:if test="@author or @date">
[<xsl:value-of select="@author"/> <xsl:value-of select="@date"/>]
</xsl:if>
</h5>
</div>
<div class="faq-body">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="iref">
<xsl:choose>
<xsl:when test="@item">
<xsl:if test="@p4 or @bug">
<xsl:message>Attributes 'p4' and 'bug' are not usable with '<iref item=>' in '<xsl:value-of select="ancestor::item/@id"/>'</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="@file">
<xsl:choose>
<xsl:when test="@page">
[<a href="{@file}#{@item}"><xsl:value-of select="@item"/></a>, page <xsl:value-of select="@page"/>]
</xsl:when>
<xsl:when test="@title">
<a href="{@file}#{@item}"><xsl:value-of select="@title"/></a>
</xsl:when>
<xsl:otherwise>
<a href="{@file}#{@item}"><xsl:value-of select="@item"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@page">
[<a href="#{@item}"><xsl:value-of select="@item"/></a>, page <xsl:value-of select="@page"/>]
</xsl:when>
<xsl:when test="@title">
<a href="#{@item}"><xsl:value-of select="@title"/></a>
</xsl:when>
<xsl:when test="count(key('ItemKey', @item)) = 0">
<a href="#{@item}"><xsl:value-of select="@item"/></a>
</xsl:when>
<xsl:otherwise>
<a href="#{@item}"><xsl:value-of select="key('ItemKey', @item)/@title"/></a>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="count(key('ItemKey', @item)) = 0">
UNDEFINED
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@p4">
<xsl:if test="@file or @bug">
<xsl:message>Attributes 'file' or 'bug' are not usable with '<iref p4=>' in '<xsl:value-of select="ancestor::item/@id"/>'</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="@title">
<a href="{$p4web-url}/{@p4}"><xsl:value-of select="@title"/></a>
</xsl:when>
<xsl:otherwise>
<a href="{$p4web-url}/{@p4}"><xsl:value-of select="@p4"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@bug">
<xsl:if test="@file">
<xsl:message>Attribute 'file' is not usable with '<iref p4=>' in '<xsl:value-of select="ancestor::item/@id"/>'</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="@title">
<a href="{$bug-url}{@bug}"><xsl:value-of select="@title"/></a>
</xsl:when>
<xsl:otherwise>
<a href="{$bug-url}{@bug}">Bug <xsl:value-of select="@bug"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:message>An <b>iref</b> in '<xsl:value-of select="ancestor::item/@id"/>' requires an 'item' or 'p4' attribute.</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
# |
Change |
User |
Description |
Committed |
|
#1
|
5162 |
brad_barber |
Road web site with information on managing Perforce and Windows development. |
|
|