cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Including Fragments
Date Thu, 15 Apr 2004 07:42:43 GMT
Dear Garrik,

I encounter such a thing and I think that the best way is using the 

what I have done , I create a resource  and I call this resource from my 
pipeline with parameters:

<map:resource name="show-simple-page" label="content">
                        <map:act type="locale">
                                <map:aggregate element="PAGE" label=
"aftergenerator  ">
                                        <map:part src=
"cocoon:/internal-portal/top" element="TOP" strip-root="true"/>
                                        <map:part src=
"cocoon:/internal-portal/left" element="LEFT" strip-root="false"/>
                                        <map:part src="{../page}" element=
"BODY" strip-root="true"/>
                                        <map:part src=
"cocoon:/internal-portal/bottom" element="BOTTOM" strip-root="false"/>
                                <map:transform type="xslt" src=
"{../style}" label="afterstyle"/>
                                <map:transform type="translator" label=
"afteri18n , print, search  ">
                                        <map:parameter name="locale" 
                                <!-- PAY ATTENTION -->
                                <!-- This transformer is required to 
remove the comment tag at the end of the pipeline -->
                                <!-- We have to do that because, we import 
some Notes Content in the XML Stream as a comment -->
                                <!-- and if we remove the comment to fast 
, we will lost the info -->
                                <!-- So, at the end of all the pipelines, 
we remove the comment tag -->
                                <map:transform src=
"context://stylesheets/system/mpe_clean_comment.xsl" label="content">
                                <map:serialize label="links, content"/>
                                <!--  For Debug -->
        <map:serialize type="xml"/>



        <!-- Main Entry for all pages -->
                                <map:match pattern="**" label="content">
                                        <map:call resource=
                                                <map:parameter name="page" 
                                                <map:parameter name=
"style" value="context://stylesheets/mpe_simple.xsl"/>

Garrick Dasbach <>
14/04/2004 18:08
Please respond to users
        Subject:        Including Fragments


We are currently migrating our website from a pure JSP environment to 
Cocoon and have run into a problem. 

The majority of our webpages have a header and footer, both of which are 
fragments of xhtml documents, that we would like to include on each page. 
We have tried using the CInclude transformer to include these elements, 
but cocoon seems to be upset that the files are not well formed (see error 
message below).

org.apache.cocoon.ProcessingException: Failed to execute pipeline.: 
file:/static/headerTest.html:6:1:org.xml.sax.SAXParseException: XML 
document structures must start and end within the same entity.

We have also tried the XInclude transformer without success.  Is there a 
way to include fragments of XHTML/XML documents in larger documents to 
create one well-formed document?

I have included some sample code below.



<html xmlns:c="">
   <c:include src="static/headerTest.html"/>
   <b>The Body</b>
   <c:include src="static/footerTest.html"/>






Any help would be greatly appreciated.


Garrick Dasbach
Software Development
Digonex Technologies, Inc.
317.638.4174 Fax

CONFIDENTIALITY NOTICE:  The information in this transmission is private, 
confidential, may be legally privileged, is property of the sender and is 
intended solely for the use of the addressee.  If you are not the 
addressee, you should not read, disclose, distribute, copy, use or rely 
upon the information contained in this transmission.  If you have received 
this transmission in error please delete or destroy it and notify DIGONEX 
TECHNOLOGIES, INC. immediately at (317) 638-4154.

View raw message