You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stefan Geelen <st...@hotmail.com> on 2004/03/01 23:32:31 UTC

Aggregation and XInclude ?

Hi,

I aggregate some content:

..
        <map:aggregate element="page">
          <map:part element="topnavbar" ns="http://www.xmlmill.com/topnavbar" src="documents/home/menu.xml"/>
          <map:part element="mainnavbar" ns="http://www.xmlmill.com/mainnavbar" src="documents/{1}/menu.xml"/>
          <map:part element="content" ns="http://www.xmlmill.com/content" src="documents/{1}/{2}.xml"/>
        </map:aggregate>
        <map:transform type="xinclude" label="links content"/>
..

The xml file referenced  by the  src="documents/{1}/{2}.xml"/> also contains an include:
..
        <example>
          <xi:include href="Example_box.txt">
            <xi:fallback>
              <p>Example currently unavailable</p>
            </xi:fallback>
          </xi:include>
        </example>
..

The problem is that the include does not work.  Is it possible to combine and include and aggregation ?

If not , what is the solution to this problem ?

Regards,

Re: Aggregation and XInclude ?

Posted by Stephen Winnall <st...@winnall.ch>.
I had a similar problem with both xinclude and cinclude. I haven't been 
able to
isolate the problem, but I got the impression that neither xinclude nor 
cinclude
would work on the output of a transformer. I worked around the problem 
by using
a transformer which performed the include by using the document() 
function.

Steve

On 1 Mar 2004, at 23:32, Stefan Geelen wrote:

> Hi,
>  
> I aggregate some content:
>  
> ...
>         <map:aggregate element="page">
>           <map:part element="topnavbar" 
> ns="http://www.xmlmill.com/topnavbar" src="documents/home/menu.xml"/>
>           <map:part element="mainnavbar" 
> ns="http://www.xmlmill.com/mainnavbar" src="documents/{1}/menu.xml"/>
>           <map:part element="content" 
> ns="http://www.xmlmill.com/content" src="documents/{1}/{2}.xml"/>
>         </map:aggregate>
>         <map:transform type="xinclude" label="links content"/>
> ...
>  
> The xml file referenced  by the  src="documents/{1}/{2}.xml"/> also 
> contains an include:
> ...
>         <example>
>           <xi:include href="Example_box.txt">
>             <xi:fallback>
>               <p>Example currently unavailable</p>
>             </xi:fallback>
>           </xi:include>
>         </example>
> ...
>  
> The problem is that the include does not work.  Is it possible to 
> combine and include and aggregation ?
>  
> If not , what is the solution to this problem ?
>  
> Regards,
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Aggregation and XInclude ?

Posted by Jan Hoskens <jh...@schaubroeck.be>.
It would be strange that this combination doesn't work, I use an aggregation too but afterwards do XSLT transformations, and this does work (so it should work with other transformers, if syntax is right). Some things to be sure of: is you're namespacing correct? Is there an xmlns:xi="http://www.w3.org/2001/XInclude"? serialize to xml just after your aggregation to make sure its there. Also consider cocoon's transformer CInclude, if you're app is cocoon-only, you might want to have that transformer to use all of cocoon's strength (such as caching).You can also replace your aggregation with another xinclude on a page containing those three elements. But still there's no reason why it shouldn't work. (You're working with the latest release? if on cvs, well it might be broken.)

Kind Regards,

Jan
  ----- Original Message ----- 
  From: Stefan Geelen 
  To: users@cocoon.apache.org 
  Sent: Monday, March 01, 2004 11:32 PM
  Subject: Aggregation and XInclude ?


  Hi,

  I aggregate some content:

  ...
          <map:aggregate element="page">
            <map:part element="topnavbar" ns="http://www.xmlmill.com/topnavbar" src="documents/home/menu.xml"/>
            <map:part element="mainnavbar" ns="http://www.xmlmill.com/mainnavbar" src="documents/{1}/menu.xml"/>
            <map:part element="content" ns="http://www.xmlmill.com/content" src="documents/{1}/{2}.xml"/>
          </map:aggregate>
          <map:transform type="xinclude" label="links content"/>
  ...

  The xml file referenced  by the  src="documents/{1}/{2}.xml"/> also contains an include:
  ...
          <example>
            <xi:include href="Example_box.txt">
              <xi:fallback>
                <p>Example currently unavailable</p>
              </xi:fallback>
            </xi:include>
          </example>
  ...

  The problem is that the include does not work.  Is it possible to combine and include and aggregation ?

  If not , what is the solution to this problem ?

  Regards,

Re: Aggregation and XInclude ?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 01.03.2004 23:32, Stefan Geelen wrote:

> Hi,
> 
> I aggregate some content:
> 
>         <map:aggregate element="page">
>           <map:part element="topnavbar" ns="http://www.xmlmill.com/topnavbar" src="documents/home/menu.xml"/>
>           <map:part element="mainnavbar" ns="http://www.xmlmill.com/mainnavbar" src="documents/{1}/menu.xml"/>
>           <map:part element="content" ns="http://www.xmlmill.com/content" src="documents/{1}/{2}.xml"/>
>         </map:aggregate>
>         <map:transform type="xinclude" label="links content"/>
> 
> The xml file referenced  by the  src="documents/{1}/{2}.xml"/> also contains an include:
> 
>         <example>
>           <xi:include href="Example_box.txt">
>             <xi:fallback>
>               <p>Example currently unavailable</p>
>             </xi:fallback>
>           </xi:include>
>         </example>
> 
> The problem is that the include does not work.  Is it possible to combine and include and aggregation ?

I don't know any reason why it should not work in general. In the above 
code the XInclude namespace may be missing.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Aggregation and XInclude ?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 02.03.2004 00:13, Stephen Winnall wrote:
> I had a similar problem with both xinclude and cinclude. I haven't had 
> time to
> isolate the problem, but I got the impression that neither xinclude nor 
> cinclude
> would work on the output of a transformer. I worked around the problem 
> by using
> a transformer which performed the include by using the document() function.

I often used it myself, so I don't think that the above is true:

<map:generator type="directory" src="myDirectory"/>
<map:transform src="directory2xinclude.xsl"/>
<map:transform type="xinclude"/>
<map:transform src="myxml2html.xsl"/>
<map:serialize type="html"/>

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Aggregation and XInclude ?

Posted by Jan Hoskens <jh...@schaubroeck.be>.
That would be very strange as normally you would generate an xml doc and
send it down the pipeline towards your xinclude, while a transformer just
takes an xml and outputs the xml to your xinclude:

<map:generate>        =>xml 1=>          <map:transform type="xinclude">
=>xml=>

<map:transform>        =>xml 2=>          <map:transform type="xinclude">
=>xml=>

If (1) and (2) are the same xml documents, it should give the same result,
so you should check that intermediate format.

Jan

----- Original Message ----- 
From: "Stephen Winnall" <st...@winnall.ch>
To: <us...@cocoon.apache.org>
Sent: Tuesday, March 02, 2004 12:13 AM
Subject: Re: Aggregation and XInclude ?


> I had a similar problem with both xinclude and cinclude. I haven't had
> time to
> isolate the problem, but I got the impression that neither xinclude nor
> cinclude
> would work on the output of a transformer. I worked around the problem
> by using
> a transformer which performed the include by using the document()
> function.
>
> Steve
>
> On 1 Mar 2004, at 23:32, Stefan Geelen wrote:
>
> > Hi,
> >
> > I aggregate some content:
> >
> > ...
> > <map:aggregate element="page">
> > <map:part element="topnavbar"
> > ns="http://www.xmlmill.com/topnavbar" src="documents/home/menu.xml"/>
> > <map:part element="mainnavbar"
> > ns="http://www.xmlmill.com/mainnavbar" src="documents/{1}/menu.xml"/>
> > <map:part element="content"
> > ns="http://www.xmlmill.com/content" src="documents/{1}/{2}.xml"/>
> > </map:aggregate>
> > <map:transform type="xinclude" label="links content"/>
> > ...
> >
> > The xml file referenced by the src="documents/{1}/{2}.xml"/> also
> > contains an include:
> > ...
> > <example>
> > <xi:include href="Example_box.txt">
> > <xi:fallback>
> > <p>Example currently unavailable</p>
> > </xi:fallback>
> > </xi:include>
> > </example>
> > ...
> >
> > The problem is that the include does not work. Is it possible to
> > combine and include and aggregation ?
> >
> > If not , what is the solution to this problem ?
> >
> > Regards,
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Aggregation and XInclude ?

Posted by Stephen Winnall <st...@winnall.ch>.
I had a similar problem with both xinclude and cinclude. I haven't had 
time to
isolate the problem, but I got the impression that neither xinclude nor 
cinclude
would work on the output of a transformer. I worked around the problem 
by using
a transformer which performed the include by using the document() 
function.

Steve

On 1 Mar 2004, at 23:32, Stefan Geelen wrote:

> Hi,
>  
> I aggregate some content:
>  
> ...
>         <map:aggregate element="page">
>           <map:part element="topnavbar" 
> ns="http://www.xmlmill.com/topnavbar" src="documents/home/menu.xml"/>
>           <map:part element="mainnavbar" 
> ns="http://www.xmlmill.com/mainnavbar" src="documents/{1}/menu.xml"/>
>           <map:part element="content" 
> ns="http://www.xmlmill.com/content" src="documents/{1}/{2}.xml"/>
>         </map:aggregate>
>         <map:transform type="xinclude" label="links content"/>
> ...
>  
> The xml file referenced  by the  src="documents/{1}/{2}.xml"/> also 
> contains an include:
> ...
>         <example>
>           <xi:include href="Example_box.txt">
>             <xi:fallback>
>               <p>Example currently unavailable</p>
>             </xi:fallback>
>           </xi:include>
>         </example>
> ...
>  
> The problem is that the include does not work.  Is it possible to 
> combine and include and aggregation ?
>  
> If not , what is the solution to this problem ?
>  
> Regards,
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Aggregation and XInclude ?

Posted by Lionel Crine <cr...@4dconcept.fr>.
Is this working ?

<map:part element="content" 
ns="<http://www.xmlmill.com/content>http://www.xmlmill.com/content" 
src="cocoon:/myfirstincludeDocument_{1}_{2}"/>

PS :  you can also send the parameters in the request using 
"cocoon:/myfirstincludeDocument?variable1={1}&amp;variable2={2}"

Then you create antohre pipeline :


<map:match pattern="myfirstincludeDocument_*_*">
   <map:generate type="file" src="documents/{1}/{2}.xml"/>
   <map:transform type="cinclude"/>
   <map:serialize type="xml"/>
</map:pattern>


Hope this gives you some clues.


Lionel


At 23:32 01/03/2004 +0100, you wrote:
>Hi,
>
>I aggregate some content:
>
>...
>         <map:aggregate element="page">
>           <map:part element="topnavbar" 
> ns="<http://www.xmlmill.com/topnavbar>http://www.xmlmill.com/topnavbar" 
> src="documents/home/menu.xml"/>
>           <map:part element="mainnavbar" 
> ns="<http://www.xmlmill.com/mainnavbar>http://www.xmlmill.com/mainnavbar" 
> src="documents/{1}/menu.xml"/>
>           <map:part element="content" 
> ns="<http://www.xmlmill.com/content>http://www.xmlmill.com/content" 
> src="documents/{1}/{2}.xml"/>
>         </map:aggregate>
>         <map:transform type="xinclude" label="links content"/>
>...
>
>The xml file referenced  by the  src="documents/{1}/{2}.xml"/> also 
>contains an include:
>...
>         <example>
>           <xi:include href="Example_box.txt">
>             <xi:fallback>
>               <p>Example currently unavailable</p>
>             </xi:fallback>
>           </xi:include>
>         </example>
>...
>
>The problem is that the include does not work.  Is it possible to combine 
>and include and aggregation ?
>
>If not , what is the solution to this problem ?
>
>Regards,
>

Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org