[opencms-dev] Including XML content

Juri Ganitkevitch j.ganitkevitch at gmail.com
Mon Oct 24 21:10:13 CEST 2005


Hello everyone,

my question refers to a problem I have experienced trying to do the  
following:

I am using XML content for teasers, having a front page, where I'd  
like to display some of those.
There is a detail view template for the teaser type which displays  
them exactly as they should be on the front page.

Basically, I try to treat the XML content like normal page objects  
here. So, in my front page template, I'm doing:
...
<cms:include file="somewhere/teaser_1.html" ?>
...

What I would expect is the system to apply the known template to the  
XML content object and return me processed HTML code.
Instead, this crashes. My guess would be that it interferes somehow  
with the XML content include-tag feature (accessing the attributes by  
"element="AttName" ").

The same error can be reproduced easily (on my 6.0.0) by adding the  
following three lines to include.jsp in the xmlcontentdemo:

<div class="element">
     <cms:include file="article_0002.html" />
</div>

Is there a elegant way to include detail views of XML content into  
site code? Using CmsJspActionElement.getContent() gives me nothing  
usable in return.
Should I include a template instead and pass the XML content's name  
on to it? This doesn't really seem right to me either.

Can anybody help me out here? This would be really appreciated.

Big thanks in advance!!

Cheers,

Juri






More information about the opencms-dev mailing list