home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="UTF-8" ?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
- xmlns:CogTracker="http://www.rword.ru/tracker/">
- <xsl:template match="/">
- <!-- HTML>
- <HEAD>
- <LINK rel="stylesheet" type="text/css" href="CogTrackerTree.css"/>
- <SCRIPT LANGUAGE="JScript" SRC="ctTree.js">
- </SCRIPT>
- <SCRIPT FOR="FoldersTree" EVENT="onSelectionChange">
- fnOnSelectionChange();
- </SCRIPT>
- </HEAD>
- <BODY -->
- <!-- onload="document.recalc(true); return true;" -->
- <xsl:apply-templates select="/root/CogTracker:ctDATABASE"/>
- <!-- /BODY>
- </HTML -->
- </xsl:template>
-
- <xsl:template match="/root">
- <xsl:apply-templates select="CogTracker:ctDATABASE" order-by="@Name" />
- </xsl:template>
- <xsl:script language="JScript"><![CDATA[
- var uinCurrentNode = 0;
-
- function fnIsCurrentNode(someUIN, someCurrentNode) {
- if (someCurrentNode != null) {
- uinCurrentNode = someCurrentNode;
- };
-
- if ( someUIN == uinCurrentNode) {
- return "true";
- }
- else {
- return "false";
- };
- };
-
- var bIsExpandable = false;
- function fnIsExpandable(someNodes, bSetupFlag) {
- if (bSetupFlag) {
- bIsExpandable = (someNodes != null);
- /*
- if (someNodes != null) {
- bIsExpandable = (someNodes.length > 0);
- };
- */
- };
-
- return ((bIsExpandable)?(true):(false));
- };
-
- ]]></xsl:script>
-
- <xsl:template match="CogTracker:ctDATABASE">
- <UL Class="FoldersTree" Name="FoldersTree" id="FoldersTree" onSelectionChange="top.fnOnTreeSelectionChange();">
- <xsl:attribute name="UIN"><xsl:value-of select="@UIN" /></xsl:attribute>
- <LI Class="FolderExpanded">
- <xsl:attribute name="UIN"><xsl:value-of select="@UIN" /></xsl:attribute>
-
- <xsl:attribute name="IsDatabase">1</xsl:attribute>
- <xsl:attribute name="IsExpandable"><xsl:eval>fnIsExpandable(this.selectSingleNode("./CogTracker:ctNODE"), true);</xsl:eval></xsl:attribute>
- <xsl:attribute name="IsExpanded">1</xsl:attribute>
-
- <NOBR Class="FolderNameNotFocused" name="FolderName">
- <!-- xsl:when test="@UIN[.=../@CurrentNode[.]]" -->
- <!-- xsl:attribute name="IsFocused"><xsl:value-of select=> </xsl:attribute -->
- <!-- /xsl:when -->
- <xsl:attribute name="IsFocused"><xsl:eval>fnIsCurrentNode(this.getAttribute("UIN"), this.getAttribute("CurrentNode"));</xsl:eval></xsl:attribute>
-
- <xsl:value-of select="@Name"/>
-
- </NOBR>
-
- <xsl:if expr="fnIsExpandable(0, false)"> <!--test="./CogTracker:ctNODE"-->
- <UL Class="SubTree" Name="SubTree" id="SubTree">
- <xsl:apply-templates
- select="./CogTracker:ctNODE[@IsUnsortedNode='1']"
- order-by="@Name" />
- <xsl:apply-templates
- select="./CogTracker:ctNODE[not(@IsUnsortedNode)]"
- order-by="@Name" />
- </UL>
- </xsl:if>
- </LI>
- </UL>
- </xsl:template>
- <xsl:template match="CogTracker:ctNODE">
- <LI Class="FolderCollapsed">
- <xsl:attribute name="UIN"><xsl:value-of select="@UIN" /></xsl:attribute>
-
- <!-- xsl:if test="@UIN[. = /root/CogTracker:ctDATABASE/@CurrentNode[.]]">
- <xsl:attribute name="SELECTED"/>
- </xsl:if -->
-
- <xsl:attribute name="IsExpanded">0</xsl:attribute>
- <xsl:attribute name="IsExpandable"><xsl:eval>fnIsExpandable(this.selectSingleNode("./CogTracker:ctNODE"), true);</xsl:eval></xsl:attribute>
- <xsl:if test="@IsUnsortedNode">
- <xsl:attribute name="IsUnsortedNode">1</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="IsUnsorted">1</xsl:attribute>
-
- <NOBR Class="FolderNameNotFocused" name="FolderName">
- <xsl:attribute name="IsFocused"><xsl:eval>fnIsCurrentNode(this.getAttribute("UIN"), null);</xsl:eval></xsl:attribute>
- <!-- xsl:attribute name="Title"><xsl:value-of select="@Name"/></xsl:attribute -->
-
-
- <xsl:value-of select="@Name"/>
- </NOBR>
-
- <xsl:if expr="fnIsExpandable(0, false)"> <!--test="./CogTracker:ctNODE"-->
- <UL Class="SubTree" Name="SubTree" id="SubTree">
- <xsl:apply-templates
- select="./CogTracker:ctNODE"
- order-by="@Name" />
- </UL>
- </xsl:if>
- </LI>
- </xsl:template>
-
-
- </xsl:stylesheet>