<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi list (and OpenCMS developers)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I know nested Tags always are a hurdle, but I have found a
particular strange behavior of cms:include in OpenCMS 6.2.2 when nesting it
inside a c:set.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I have replicated it using the following. I have 3 files:<o:p></o:p></span></font></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'>- blank.txt<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>- child.txt<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>- parent.jsp<o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The blank.txt is of course an empty file of the type plain.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The child.txt is a plain document containing the following
line:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I am a child<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The parent.jsp looks like this:<o:p></o:p></span></font></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'><%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=DA style='font-size:10.0pt'><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=DA style='font-size:10.0pt'><c:set var="child"><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><cms:include page="child.txt" /><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'></c:set><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>This should be the child: ${child}<br/><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>And it should have ended here, because this should be the blank.txt:<br/><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><cms:include page="blank.txt" /><o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>If it wasn’t for the last line, including the blank
file, <b><span style='font-weight:bold'>nothing</span></b> is in the response.
Not even the “This should be the child”-text<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I tried to add the last line mostly because I have tried
everything else, and the most peculiar thing is, the response then looks like
this:<o:p></o:p></span></font></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'>This should be the child: <<span
class=start-tag>br</span><span class=attribute-name>/</span>><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>And it should have ended here, because this should be the blank.txt:<<span
class=start-tag>br</span><span class=attribute-name>/</span>><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>I am a child<o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I would have just used a <cms:include page=”child.txt”
var=”child” /> if such a functionality had been available, as it
unfortunately isn’t.. yet.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The reason for all this hurdle is that I have a jsp, which
generates a menu structure as xml, which is the “child” I want to
include, and then use the xml:transform from jstl to generate some html for the
menu.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The use of xml:transform brought up some issues itself. Is
it true that the jar file xalan.jar is modified in the opencms distribution?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Usually the org/apache/xalan/res/XSLTInfo.properties has the
following lines:<o:p></o:p></span></font></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'>org.xml.sax.driver=org.apache.xerces.parsers.SAXParser<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'># org.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl<o:p></o:p></span></font></pre>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>But the one in the opencms distribution has these lines:<o:p></o:p></span></font></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'># org.xml.sax.driver=org.apache.xerces.parsers.SAXParser<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>org.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>And that is even though the crimson parser is not part of
the classpath. (not on Tomcat 5.5 running on JDK 5). And that resulted in the
following error:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>"SAX2 driver class
org.apache.crimson.parser.XMLReaderImpl not found"<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>But when I commented out the line which sets the driver
class in the properties file, everything worked fine.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Anyways. This last bit was a bit of a side-kick, but the
original problem remains. And I would really like to figure out why you can’t
nest cms:include inside c:out.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Good evening, and enjoy.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Cheers, Stefan.<o:p></o:p></span></font></p>

</div>

</body>

</html>