ik hep ook zoiets gemaakt, maar dan met arrays (GetRows() op je recordset)
1 versie in gewoon XHTML, en 1 versie in XML. de laatste is zo simpel dat je het niet gelooft.
ik heb 2 tabellen;
1 met alle links,
1 met de titels (text bovenaan elk blok),
de titels hebben allemaal een kolomnummer (1 - 3, maar kan van alles zijn)
voor de xml versie sorteer je op titel, en laat je ALLE records onder elkaar zien. in je stylesheet kan je de code dan een tabel zetten met het aantal kolommen dat je wilt hebben. (niet verder denken,m dit is het werkelijk)
daarna doorloop je de xml-file net zoveel keer als dat je kolommen hebt. (met natuurlijk de wijziging dat je een andere kolomnummer wilt)
voorbeeld:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
| <?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="imagetoolbar" content="no" />
<style type="text/css">
.div1 {font-family: 'Arial', 'Times New Roman', 'Courier';
background-color: #003366;
color: #ffffff;
font-size: 10pt;
font-weight: bold;
border-width: 1px 1px 0px;}
.div2 {background-color: white;
border-width: 0px 1px;}
.div3 {background-color: white; color: blue;
border-width: 0px 1px 1px;}
div {width: 200px;
border-style: solid;
border-color: #003366;}
body {background-color: #e9e9e9;
font-family: 'Arial', 'Times New Roman', 'Courier';
color: #003366;
font-size: 11pt;
overflow: auto;
width: 100%;}
a.top {font-family: 'Arial', 'Times New Roman', 'Courier';
color: #003366;
font-size: 11pt;}
a.bottom {font-family: 'Arial', 'Times New Roman', 'Courier';
color: #ffffff;
font-size: 11pt;}
a {font-family: 'Arial', 'Times New Roman', 'Courier';
color: blue;
font-size: 10pt;}
span {color:green;
font-size: 9pt;}
</style>
</head>
<body><form method="GET" action="http://www.google.nl/search" target="_blank">
<center>
<table>
<tr>
<td colspan="4" align="center">In samenwerking met<br/>
<a class="top" href="http://www.google.nl" target="_blank" title="www.conet.nl">www.google.nl</a><hr/>
<b>titel hier</b><hr/></td>
</tr>
<tr>
<td colspan="4" align="center">
<a href="http://www.google.nl/">
[img]"images/Logo_40wht.gif"[/img]</a>
<input type="text" name="q" size="31" maxlength="255" value=""/>
<input type="hidden" name="hl" value="nl"/>
<input type="submit" name="btnG" value="Google Zoeken"/>
</td>
</tr>
<tr>
<td valign="top">
<xsl:for-each select="root/links/link">
<xsl:if test="@column=1">
<xsl:if test="@start>0">
<div class="div1"><xsl:value-of select="@header"/></div>
</xsl:if>
<xsl:choose>
<xsl:when test="@end>0">
<div class="div3"><a><xsl:attribute name="href"><xsl:value-of select="@url"/>
</xsl:attribute><xsl:value-of select="@text"/></a>
<span><xsl:value-of select="@tooltip"/></span></div><br/>
</xsl:when>
<xsl:otherwise>
<div class="div2"><a><xsl:attribute name="href"><xsl:value-of select="@url"/>
</xsl:attribute><xsl:value-of select="@text"/></a>
<span><xsl:value-of select="@tooltip"/></span></div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each></td>
<td valign="top"><xsl:for-each select="root/links/link">
<xsl:if test="@column=2">
<xsl:if test="@start>0">
<div class="div1"><xsl:value-of select="@header"/></div>
</xsl:if>
<xsl:choose>
<xsl:when test="@end>0">
<div class="div3"><a><xsl:attribute name="href"><xsl:value-of select="@url"/>
</xsl:attribute><xsl:value-of select="@text"/></a>
<span><xsl:value-of select="@tooltip"/></span></div><br/>
</xsl:when>
<xsl:otherwise>
<div class="div2"><a><xsl:attribute name="href"><xsl:value-of select="@url"/>
</xsl:attribute><xsl:value-of select="@text"/></a>
<span><xsl:value-of select="@tooltip"/></span></div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</td>
<td valign="top"><xsl:for-each select="root/links/link">
<xsl:if test="@column=3">
<xsl:if test="@start>0">
<div class="div1"><xsl:value-of select="@header"/></div>
</xsl:if>
<xsl:choose>
<xsl:when test="@end>0">
<div class="div3"><a><xsl:attribute name="href"><xsl:value-of select="@url"/>
</xsl:attribute><xsl:value-of select="@text"/></a>
<span><xsl:value-of select="@tooltip"/></span></div><br/>
</xsl:when>
<xsl:otherwise>
<div class="div2"><a><xsl:attribute name="href"><xsl:value-of select="@url"/>
</xsl:attribute><xsl:value-of select="@text"/></a>
<span><xsl:value-of select="@tooltip"/></span></div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</td>
</tr>
<tr><td style="height: 100%;" colspan="4"> </td></tr>
<tr>
<td valign="bottom" colspan="4" style="background-color: #003366;" align="center">
<a class="bottom" href="">Opmerkingen of suggesties?</a></td>
</tr>
</table>
</center></form>
</body>
</html>
</xsl:template>
</xsl:stylesheet> |
xml file: (in asp)
0=url, 1=title, 2=link_ID, 3=subject_ID, 4=subject, 5=column, 6=extra
SQL = "SELECT * FROM [Linktable] ORDER BY [Subject_ID];"
ASP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| <root>
<links>
<% GetLinks
subject = linktable(4, 0)
for I = LBound(linktable, 2) to UBound(linktable, 2)
if I + 1 <= UBound(linktable, 2) then
X = I + 1
else
X = I
end if
if subject <> linktable(4, I) OR I = Lbound(linktable,2) then
strSTART = "1"
else
strSTART = "0"
end if
subject = linktable(4, I)
if I = UBound(linktable, 2) OR Cstr(subject) <> Cstr(linktable(4, X)) then
strEnd = "1"
else
strEnd = "0"
end if %><link column="<%= linktable(5, I) %>" start="<%= strSTART %>" end="<%= strEnd %>" header="<%= linktable(4, I) %>" url="<%= server.HTMLEncode(linktable(0, I)) %>" text="<%= server.HTMLEncode(linktable(1, I)) %>" tooltip=" <% if Len(linktable(6, I)) >1 then %>(<%= server.HTMLEncode(linktable(6, I)) %>)<% end if %>" />
<% next %>
</links>
</root> |
[
Voor 32% gewijzigd door
BasSpruit op 11-12-2003 10:40
]