home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" ?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns:CogTracker="http://www.rword.ru/tracker/">
- <xsl:template match="/">
-
- <xsl:apply-templates select="./root"/>
-
- </xsl:template>
-
- <xsl:template match="root">
- <!-- xsl:for-each select=".//*" -->
- <xsl:apply-templates select="./CogTracker:ctDATABASE"/>
- <!-- /xsl:for-each -->
- </xsl:template>
-
- <xsl:script language="JScript"><![CDATA[
- var bRootNode = 1;
-
- function fnGetRootNodeFlag() {
- var bCurrentRoot = bRootNode;
- bRootNode = 0;
- return (bCurrentRoot != 0);
- };
-
- var bTOCMode = 0;
- function fnGetTOCMode() {
- return bTOCMode;
- };
-
- function fnSetTOCMode(bMode) {
- bTOCMode = bMode;
- return "";
- };
- function fnIsURLEmpty(someNode) {
- if (someNode != null) {
- var sBaseURL = someNode.getAttribute("BaseURL");
- if (sBaseURL != null) {
- if (sBaseURL != "") {
- return true;
- }
- }
- }
-
- return false;
- };
-
- ]]></xsl:script>
-
- <xsl:template match="CogTracker:ctDATABASE|CogTracker:ctNODE">
- <xsl:choose>
-
- <xsl:when expr="fnGetRootNodeFlag()">
- <HTML>
- <HEAD>
- <TITLE>
- <xsl:value-of select="@Name"/>
- </TITLE>
- <STYLE><![CDATA[
- H2,H3 {
- font-family: Verdana, sans-serif;
- font-size: 10pt;
- };
- BODY {
- font-family: Verdana, sans-serif;
- font-size: 10pt;
- text-align: center;
- };
- TD.Contents {
- BACKGROUND-COLOR: #f3f3f3;
- };
- DIV.ContentsEntry {
- font-family: Verdana, sans-serif;
- font-size: 10pt;
- text-align:left;
- margin-left: 15pt;
- };
- TABLE.Fragment, TD.FieldTitle, TD.FieldData {
- font-family: Verdana, sans-serif;
- font-size: 10pt;
- PADDING: 0px;
- MARGIN: 0px;
- VERTICAL-ALIGN: text-top;
- };
- TD.FieldTitle {
- BACKGROUND-COLOR: #E0E0E0;
- };
- TD.FieldData {
- BACKGROUND-COLOR: #f3f3f3;
- };
- DIV.EmptyFolder {
- font-style: italic;
- };
- DIV.Source {
- PADDING-LEFT: 3px;
- PADDING-TOP: 0px;
- PADDING-BOTTOM: 0px;
- MARGIN-TOP: 0px;
- MARGIN-BOTTOM: 0px;
- DISPLAY: block;
- FLOAT: right;
- TEXT-ALIGN: right;
- VERTICAL-ALIGN: top;
- font-size: x-small;
- };
- TD.ContentsHead{
- text-align: center;
- BACKGROUND-COLOR: #f3f3f3;
- };
- TD.FolderHead {
- text-align: center;
- BACKGROUND-COLOR: #f3f3f3;
- };
- ]]>
- </STYLE>
- </HEAD>
- <BODY>
- <DIV ALIGN="center" WIDTH="600px">
-
- <TABLE Class="TheData" COLS="1" WIDTH="600">
-
- <!-- following if is used to remove Contents generation section -->
- <xsl:if test="./CogTracker:ctNODE//CogTracker:ctFRAGMENT">
-
- <TR>
- <TD CLASS="ContentsHead">
- <H2>Contents</H2>
- </TD>
- </TR>
-
- <xsl:eval>fnSetTOCMode(true);</xsl:eval>
-
- <TR>
- <TD WIDTH="600" Class="Contents">
- <DIV Class="ContentsEntry">
- <xsl:choose>
- <xsl:when test="./CogTracker:ctFRAGMENT">
- <A>
- <xsl:attribute name="HREF"
- >#href<xsl:value-of select="@UIN"
- /></xsl:attribute>
- <xsl:value-of select="@Name"/>
- </A>
- </xsl:when>
- <xsl:otherwise>
-
- <xsl:choose>
- <xsl:when test=".//CogTracker:ctFRAGMENT">
- <xsl:value-of select="@Name"/>
- </xsl:when>
-
- <xsl:otherwise>
- <DIV Class="EmptyFolder">
- There is no content to show.
- </DIV>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:otherwise>
- </xsl:choose>
-
-
- <xsl:apply-templates
- select="./CogTracker:ctNODE"
- order-by="@Name"/>
- </DIV>
- </TD>
- </TR>
- </xsl:if>
-
-
- <xsl:eval>fnSetTOCMode(false);</xsl:eval>
-
- <xsl:if test="./CogTracker:ctFRAGMENT">
- <TR><TD> </TD></TR>
- <TR>
- <TD Class="FolderHead">
- <H2>
- <A>
- <xsl:attribute name="NAME"
- >href<xsl:value-of select="@UIN"
- /></xsl:attribute>
- <xsl:value-of select="@Name"/>
- </A>
- </H2>
- </TD>
- </TR>
-
- <TR>
- <TD>
- <xsl:apply-templates
- select="./CogTracker:ctFRAGMENT"
- order-by="-@CreationDate"/>
- </TD>
- </TR>
- </xsl:if>
-
-
- <xsl:apply-templates
- select="./CogTracker:ctNODE"
- order-by="@Name"/>
-
- </TABLE>
- </DIV>
- </BODY>
- </HTML>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when expr="fnGetTOCMode()">
- <DIV Class="ContentsEntry">
-
- <xsl:choose>
- <xsl:when test="./CogTracker:ctFRAGMENT">
- <A>
- <xsl:attribute name="HREF"
- >#href<xsl:value-of select="@UIN"
- /></xsl:attribute>
- <xsl:value-of select="@Name"/>
- </A>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test=".//CogTracker:ctFRAGMENT">
- <xsl:value-of select="@Name"/>
-
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:apply-templates
- select="./CogTracker:ctNODE"
- order-by="@Name"/>
- </DIV>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="./CogTracker:ctFRAGMENT">
-
- <TR><TD> </TD></TR>
- <TR>
- <TD Class="FolderHead">
- <H3>
-
- <A>
- <xsl:attribute name="NAME"
- >href<xsl:value-of select="@UIN"
- /></xsl:attribute>
-
- <xsl:value-of select="@Name"/>
- </A>
- </H3>
- </TD>
- </TR>
-
-
- <TR>
- <TD>
- <xsl:apply-templates
- select="./CogTracker:ctFRAGMENT"
- order-by="-@CreationDate"/>
- </TD>
- </TR>
- </xsl:if>
-
- <xsl:apply-templates
- select="./CogTracker:ctNODE"
- order-by="@Name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="CogTracker:ctFRAGMENT">
- <TABLE CLASS="Fragment" COLS="2" WIDTH="600">
- <TBODY>
- <TR CLASS="TitleAndDate">
- <TD CLASS="FieldTitle" WIDTH="3em">Title:
- </TD>
- <TD CLASS="FieldData" WIDTH="90%">
- <xsl:if expr="fnIsURLEmpty(this)">
- <!-- xsl:if test="@CreationDate" -->
- <!-- SPAN Class="Date" NAME="FragmentDate" ID="FragmentDate">
- <xsl:eval>(new Date(parseInt(this.selectSingleNode("@CreationDate").text, 10))).toLocaleString()</xsl:eval>
- </SPAN -->
- <DIV Class="Source" TITLE="Jump to citation source">| <A TARGET="_blank">
- <xsl:attribute name="HREF">
- <xsl:value-of select="@BaseURL"/>
- </xsl:attribute>
- Source...</A
- ></DIV>
- </xsl:if>
-
- <DIV CLASS="FragmentTitle">
- <xsl:value-of select="@Name"
- /></DIV>
- </TD>
- </TR>
- <TR CLASS="Text">
- <TD CLASS="FieldTitle" WIDTH="3em">
- Text:
- </TD>
- <TD CLASS="FieldData" WIDTH="90%">
- <DIV>
- <xsl:value-of select="@Text"
- />
- </DIV>
- </TD>
- </TR>
-
- <TR CLASS="Comment">
- <TD CLASS="FieldTitle" WIDTH="3em">Comment: </TD>
- <TD CLASS="FieldData" WIDTH="90%">
- <DIV>
- <xsl:value-of select="@Comment"
- /> </DIV></TD>
- </TR>
- <!-- TR CLASS="BaseURL">
- <TD CLASS="FieldTitle">From: </TD>
- <TD CLASS="FieldData">
- <A TARGET="_blank" CLASS="BaseURL">
- <xsl:attribute name="HREF">
- <xsl:value-of select="@BaseURL"/>
- </xsl:attribute>
- <xsl:value-of select="@BaseURL"
- /></A>
- </TD>
- </TR -->
- </TBODY>
- <TFOOT>
- <TR>
- <TD COLSPAN="2">
- <HR></HR>
- </TD>
- </TR>
- </TFOOT>
- </TABLE>
- </xsl:template>
-
-
- </xsl:stylesheet>