I'm trying to make a website more dinamically with splitting it in parts. I had a XML file for the first page that now has been converted to 4 files: index.xml, menu.xml, sidebar.xml and footer.xml.
(Updated)
I include correctly the XML's on the index.xsl file. Now I need to include the .xls that they will use. Actually I've it all in the same file and works fine, so XML include are solved.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="menu" select="document('../menu.xml')"/>
<xsl:param name="sidebar" select="document('../sidebar.xml')"/>
<xsl:param name="footer" select="document('../footer.xml')"/>
<xsl:template match="/">
<!-- Split header.xsl -->
<html lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title><xsl:value-of select="page/title" /></title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script type="text/javascript" src="js/custom.js"></script>
</head>
<body>
<div class="content">
<div class="header">
<div id="tabs" class="menu">
<ul>
<xsl:for-each select="$menu/menu/category">
<li><a><xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute><xsl:value-of select="name"/></a></li>
</xsl:for-each>
</ul>
</div>
</div>
<div class="body">
<!-- End Split header.xsl -->
<div class="body_izqda">
<xsl:for-each select="page/news/contents/entry">
<h2><xsl:value-of select="title" /></h2>
<p><xsl:value-of select="text" /></p>
</xsl:for-each>
</div>
<!-- Split sidebar.xml -->
<div class="body_dcha">
<ul>
<xsl:for-each select="$sidebar/sidebar/results/category">
<li>
<a><xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute><xsl:value-of select="name" /></a>
</li>
</xsl:for-each>
</ul>
</div>
<!-- End Split sidebar.xml -->
<!-- Split footer.xml -->
<div class="clear">
</div>
</div>
<div class="footer">
<ul>
<xsl:for-each select="$footer/footer/entry">
<li><a><xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute><xsl:value-of select="title" /></a></li>
</xsl:for-each>
</ul>
</div>
</div>
</body>
</html>
<!-- End Split footer.xml -->
</xsl:template>
</xsl:stylesheet>
By the way, I want to split that XLST parts with XLS files. I tried with the <xsl:include>
but I can't get it working with the param $menu.
I've marqued with Split and End Split where I need to split the document
I already tried to solve with the first reply by @svick, but splitting it with the marks I've done the XSLTPRocessor class for PHP gives me:
Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: element import only allowed as child of stylesheet
So, something is wrong with splitting in the way I'm doing and then including it.
How can I solve it?
Thanks in advance!
NOTE1 head.xsl:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title><xsl:value-of select="page/title" /></title>
<link rel="stylesheet" type="text/css" href="css/reset-min.css" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" />
</head>
</xsl:template>
</xsl:stylesheet>