Note that there are some explanatory texts on larger screens.

plurals
  1. POCombining <xsl:param> and <xsl:include>
    primarykey
    data
    text
    <p>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.</p> <p>(Updated)</p> <p>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.</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:param name="menu" select="document('../menu.xml')"/&gt; &lt;xsl:param name="sidebar" select="document('../sidebar.xml')"/&gt; &lt;xsl:param name="footer" select="document('../footer.xml')"/&gt; &lt;xsl:template match="/"&gt; &lt;!-- Split header.xsl --&gt; &lt;html lang="es"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt; &lt;title&gt;&lt;xsl:value-of select="page/title" /&gt;&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="css/main.css" /&gt; &lt;script type="text/javascript" src="js/custom.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="content"&gt; &lt;div class="header"&gt; &lt;div id="tabs" class="menu"&gt; &lt;ul&gt; &lt;xsl:for-each select="$menu/menu/category"&gt; &lt;li&gt;&lt;a&gt;&lt;xsl:attribute name="href"&gt;&lt;xsl:value-of select="link" /&gt;&lt;/xsl:attribute&gt;&lt;xsl:value-of select="name"/&gt;&lt;/a&gt;&lt;/li&gt; &lt;/xsl:for-each&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="body"&gt; &lt;!-- End Split header.xsl --&gt; &lt;div class="body_izqda"&gt; &lt;xsl:for-each select="page/news/contents/entry"&gt; &lt;h2&gt;&lt;xsl:value-of select="title" /&gt;&lt;/h2&gt; &lt;p&gt;&lt;xsl:value-of select="text" /&gt;&lt;/p&gt; &lt;/xsl:for-each&gt; &lt;/div&gt; &lt;!-- Split sidebar.xml --&gt; &lt;div class="body_dcha"&gt; &lt;ul&gt; &lt;xsl:for-each select="$sidebar/sidebar/results/category"&gt; &lt;li&gt; &lt;a&gt;&lt;xsl:attribute name="href"&gt;&lt;xsl:value-of select="link" /&gt;&lt;/xsl:attribute&gt;&lt;xsl:value-of select="name" /&gt;&lt;/a&gt; &lt;/li&gt; &lt;/xsl:for-each&gt; &lt;/ul&gt; &lt;/div&gt; &lt;!-- End Split sidebar.xml --&gt; &lt;!-- Split footer.xml --&gt; &lt;div class="clear"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="footer"&gt; &lt;ul&gt; &lt;xsl:for-each select="$footer/footer/entry"&gt; &lt;li&gt;&lt;a&gt;&lt;xsl:attribute name="href"&gt;&lt;xsl:value-of select="link" /&gt;&lt;/xsl:attribute&gt;&lt;xsl:value-of select="title" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;/xsl:for-each&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; &lt;!-- End Split footer.xml --&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>By the way, I want to split that XLST parts with XLS files. I tried with the <code>&lt;xsl:include&gt;</code> but I can't get it working with the param $menu.</p> <p>I've marqued with <em>Split</em> and <em>End Split</em> where I need to split the document</p> <p>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:</p> <blockquote> <p>Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: element import only allowed as child of stylesheet</p> </blockquote> <p>So, something is wrong with splitting in the way I'm doing and then including it. </p> <p>How can I solve it?</p> <p>Thanks in advance!</p> <p><strong>NOTE1</strong> head.xsl:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt; &lt;xsl:template match="/"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt; &lt;title&gt;&lt;xsl:value-of select="page/title" /&gt;&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="css/reset-min.css" /&gt; &lt;link rel="stylesheet" type="text/css" href="css/main.css" /&gt; &lt;link rel="stylesheet" type="text/css" href="css/jquery-ui.css" /&gt; &lt;/head&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload