Ich dachte, wenn du schon XSL nutzt, kannst du das Menü auch gleich per XSL mitgenerieren.
Beispiel:
article1.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="to_xhtml.xsl"?>
<article>
<author>K. Byte</author>
<title>Artikel 1</title>
<content>
Lorem Ipsum...
</content>
</article>
article2.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="to_xhtml.xsl"?>
<article>
<author>A. Nonymous</author>
<title>Artikel 2</title>
<content>
<p>Hello World...</p>
<p>Trallala</p>
</content>
</article>
to_xhtml.xsl
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />
<xsl:template name="menu">
<ul id="navigation">
<li><a href="article1.xml">Article 1</a></li>
<li><a href="article2.xml">Article 2</a></li>
</ul>
</xsl:template>
<xsl:template name="article">
<div id="content">
<h2><xsl:value-of select="/article/title" /></h2>
<p><xsl:value-of select="/article/author" /></p>
<p><xsl:copy-of select="/article/content" /></p>
</div>
</xsl:template>
<xsl:template name="html-head">
<head>
<meta charset="utf-8" />
<title><xsl:value-of select="/article/title" /></title>
<link href="styles.css" media="screen" rel="stylesheet" type="text/css" />
</head>
</xsl:template>
<xsl:template name="html-body">
<body>
<h1>Mein Artikelsystem</h1>
<xsl:call-template name="menu"></xsl:call-template>
<xsl:call-template name="article"></xsl:call-template>
</body>
</xsl:template>
<xsl:template match="/">
<html lang="en">
<xsl:call-template name="html-head"></xsl:call-template>
<xsl:call-template name="html-body"></xsl:call-template>
</html>
</xsl:template>
</xsl:stylesheet>
styles.css
Code:
* {
margin: 0;
padding: 0;
}
body {
padding: 20px;
font-family: Georgia, Times, serif;
}
#navigation {
width: 196px;
border: 2px solid #ccc;
float: left;
background: #f0f0f0;
list-style: none;
}
#navigation li {
border-bottom: 1px solid #ccc;
}
#navigation li:last-child {
border-bottom: none;
}
#navigation a {
display: block;
text-decoration: none;
padding: 5px 10px;
color: #66f;
}
#navigation a:hover {
background: #ff6;
}
#content {
margin-left: 220px;
}
to_xhtml.xsl (oder zumindest das Menü-Template darin) müsstest du dann eben bei jeder Änderung mit deinem C#-Script generieren.
PS: Mein XSL ist mal wieder reichlich eingerostet. Das vorsichtshalber als Hinweis.