Пытаюсь в Cocoon отобразить XML файл в виде HTML. Но при этом не подключается внешняя таблица стилей. Файл main.xml Код | <?xml version="1.0" encoding="UTF-8"?> <page> <logotype/> </page>
|
Файл main.xsl Код | <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page"> <html> <head> <link href="style.css" rel="stylesheet" type="text/css"/> </head> <body>
<xsl:apply-templates/> </body> </html> </xsl:template>
<xsl:template match="logotype"> <div id="logo"> <div class="logo-main">Hello World</div> <div class="logo-main">Research Information System Slag-Melt</div> <div class="logo-mini">TEST TEST TEST</div> </div> </xsl:template> </xsl:stylesheet>
|
CSS Код | #main { float: left; width: 75%; background: #fff; margin-top: 0; margin-right: 1.67em; padding-top: 0; padding-right: 1em; margin-left: 1em;
}
#right-menu { float: right; width: 18%; margin-top: 0; margin-right: 20px; padding-top: 0; font-family: Vardana, Helvetica, Arial, sans-serif; font-size: 0.7em; font-weight: bold; color: #333; }
#logo { }
.logo-main { color:#004080; font-family:Arial; font-size:12pt; font-weight:bold; }
.logo-mini { color:#004080; font-family:Arial; font-size:8pt; font-weight:bold; }
#right-menu ul { list-style: none; margin: 0; padding: 0; }
#right-menu ul li { margin: 0; position: relative; }
#right-menu li ul { position: absolute; right: 215px; top: 0; display: none; width: 130px; }
#right-menu ul li a { display: block; padding: 2px 2px 2px 0.5em; border-left: 10px solid #369; border-right: 1px solid #69c; border-bottom: 1px solid #369; background-color: #9cc; color: #448; text-decoration: none; }
#right-menu ul li a:hover { border-left: 10px solid #036; border-right: 1px solid #69c; border-bottom: 1px solid #369; background-color: 69f; color: #fff; }
#right-menu li:hover ul { display: block; }
/* Fix IE. Hide from IE Mac */ * html #right-menu ul li { float: left; height: 1%; } * html #right-menu ul li a { height: 1%; } /* End */
#top-menu { color: #333; }
#top-menu ul { padding: 3px 0; margin-left: 0; border-bottom: 2px solid #778; font: bold 10px Verdana, sans-serif; }
#top-menu ul li { list-style: none; margin: 0; display: inline; color: #333; }
#top-menu ul li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #778; border-bottom: none; background: #9cc; text-decoration: none; color: #333; }
#top-menu ul li a:link { color: #448; }
#top-menu ul li a:visited { color: #667; }
#top-menu ul li a:link:hover, #top-menu ul li a:visited:hover { color: #000; background: #aae; border-color: #227; }
#top-menu ul li a#current { background: white; border-bottom: 1px solid white; }
|
Часить sitemap.xmap Код | <map:match pattern="main.xml"> <map:generate src="main.xml"/> <map:transform src="main.xsl"/> <map:serialize type="html"/> </map:match>
|
При этом отображается текст без CSS... Вот код получившейся страницы: Код |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <link type="text/css" rel="stylesheet" href="style.css"> </head> <body> <div id="logo"> <div class="logo-main">Hello World</div> <div class="logo-main">Research Information System Slag-Melt</div> <div class="logo-mini">TEST TEST TEST</div> </div>
</body> </html>
|
Это сообщение отредактировал(а) Cross - 24.4.2008, 15:02
|