You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Legg <da...@searchevent.co.uk> on 2008/09/01 00:39:53 UTC
Re: cforms + javaflow + sitemap problem
Мария Григорьева wrote:
>
> <map:match pattern="*/*">
>
> <map:aggregate element="content">
>
> <map:part src="index.xml"/>
>
> <map:part src="cocoon:/main/{1}/{2}" element="main"/>
>
> </map:aggregate>
>
> <map:transform src="styles/main.xsl"/>
>
> <map:serialize type="html"/>
>
> </map:match>
>
> ……..
>
> <map:match pattern="main/experiments/*.do">
>
> <map:call function="{1}"/>
>
> </map:match>
>
> <map:match pattern="main/form-template/*">
>
> <map:generate type="jx" src="form-template/{1}.xml"/>
>
> <map:transform src="styles/input-forms.xsl"/>
>
> <map:serialize/>
>
> </map:match>
>
> ……………………..
>
> In my flowscript :
>
> sendPage("form-template/experiment-template", new
> VarMap().add("experiment", results));
>
> But at the output - I have double-header part! (The part <map:part
> src="index.xml"/> from the sitemap)
>
> I’ve have had this problem with the flowscript with the redirect function.
>
> So, I decide it with the help of param “false” --- redirect(“url”, false);
>
> Help please!!!
>
It looks like your route takes you through two separate stylesheets
(styles/main.xsl and styles/input-forms.xsl). Is it possible both these
stylesheets add a header? Or perhaps, index.xml contains a header?
Without more info it's difficult to tell.
Regards,
David Legg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: cforms + javaflow + sitemap problem
Posted by Мария Григорьева <ma...@gmail.com>.
Index.xml
<?xml version="1.0" encoding="Windows-1251"?>
<head>
<logotype/>
<top-menu/>
</head>
And JX:
<?xml version="1.0" encoding="windows-1251"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
<jx:import
uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
<jx:import uri="pages/menu.xml"/>
<div id="forms">
<link href="forms.css" rel="stylesheet" type="text/css"/>
<h2>Components:</h2>
<table>
<tr>
<th>Name</th>
<th>Amount</th>
</tr>
<jx:forEach var="comps" items="${components}">
<tr>
<td>${comps}</td>
<td>${comps}</td>
</tr>
</jx:forEach>
</table>
</div>
</xsl:stylesheet>
-----Original Message-----
From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
Sent: Monday, September 22, 2008 2:53 AM
To: users@cocoon.apache.org
Subject: Re: cforms + javaflow + sitemap problem
On 21.09.2008 15:11, Magsend wrote:
> the content is still duplicates... but without style
My guess is that one of the parts comes with a <content> root element as
well (or something like that). How do index.xml and
form-template/{1}.xml look like?
Joerg
---------------------------------------------------------------------
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: cforms + javaflow + sitemap problem
Posted by Joerg Heinicke <jo...@gmx.de>.
On 21.09.2008 15:11, Magsend wrote:
> the content is still duplicates... but without style
My guess is that one of the parts comes with a <content> root element as
well (or something like that). How do index.xml and
form-template/{1}.xml look like?
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: cforms + javaflow + sitemap problem
Posted by Magsend <ma...@gmail.com>.
Hello!
When I try to remove this line:
<xsl:template match="@*|node()"
priority="-1"><xsl:copy><xsl:apply-templates
select="@*|node()"/></xsl:copy></xsl:template>
the content is still duplicates... but without style
Andre Juffer wrote:
>
> David Legg wrote:
>> Hi Maria,
>>
>> I'm very rusty on XSLT I'm afraid
>>> Here is the file main.xsl:
>>>
>>> ...
>>> <xsl:template match="@*|node()"
>>> priority="-1"><xsl:copy><xsl:apply-templates
>>> select="@*|node()"/></xsl:copy></xsl:template>
>>> ...
>>>
>>
>> What is the purpose of this line?
>
> This copies input XML to the output that did not mach any other
> <xsl:template match="..."> in the XSL style sheet.
>
>> What happens if you remove it?
>
> You may loose portions of the input XML that may be required by one of
> the next XSLT transformers in the pipeline.
>>
>> David Legg
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>
>
> --
> Andre H. Juffer | Phone: +358-8-553 1161
> The Biocenter and | Fax: +358-8-553-1141
> the Dep. of Biochemistry | Email: Andre.Juffer@oulu.fi
> University of Oulu, Finland | WWW: www.biochem.oulu.fi/Biocomputing/
> NordProt | WWW: www.nordprot.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/cforms-%2B-javaflow-%2B-sitemap-problem-tp19246213p19594335.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: cforms + javaflow + sitemap problem
Posted by Andre Juffer <an...@oulu.fi>.
David Legg wrote:
> Hi Maria,
>
> I'm very rusty on XSLT I'm afraid
>> Here is the file main.xsl:
>>
>> ...
>> <xsl:template match="@*|node()"
>> priority="-1"><xsl:copy><xsl:apply-templates
>> select="@*|node()"/></xsl:copy></xsl:template>
>> ...
>>
>
> What is the purpose of this line?
This copies input XML to the output that did not mach any other
<xsl:template match="..."> in the XSL style sheet.
> What happens if you remove it?
You may loose portions of the input XML that may be required by one of
the next XSLT transformers in the pipeline.
>
> David Legg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
--
Andre H. Juffer | Phone: +358-8-553 1161
The Biocenter and | Fax: +358-8-553-1141
the Dep. of Biochemistry | Email: Andre.Juffer@oulu.fi
University of Oulu, Finland | WWW: www.biochem.oulu.fi/Biocomputing/
NordProt | WWW: www.nordprot.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: cforms + javaflow + sitemap problem
Posted by David Legg <da...@searchevent.co.uk>.
Hi Maria,
I'm very rusty on XSLT I'm afraid
> Here is the file main.xsl:
>
> ...
> <xsl:template match="@*|node()" priority="-1"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template>
> ...
>
What is the purpose of this line? What happens if you remove it?
David Legg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: cforms + javaflow + sitemap problem
Posted by Мария Григорьева <ma...@gmail.com>.
The transformer <map:transform src="styles/input-forms.xsl"/> doesn't need... It's my mistake...
But the problem still exist.
<map:match pattern="main/form-template/*">
<map:generate type="jx" src="form-template/{1}.xml"/>
<map:serialize/>
</map:match>
Index.xml contains the header:
<?xml version="1.0" encoding="Windows-1251"?>
<head>
<logotype/>
<top-menu/>
</head>
Here is the file main.xsl:
<?xml version="1.0" encoding="windows-1251"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://apache.org/xsp">
<xsl:template name="root">
<xsl:apply-templates select="node()"/>
</xsl:template>
<xsl:template match="content">
<html>
<head>
<link href="style.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="head">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="logotype">
<div id="logo">
......
</div>
</xsl:template>
<xsl:template match="top-menu">
<div id="top-menu">
.......
</div>
</xsl:template>
<xsl:template match="main">
<div id="main">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="current-experiments">
.....
</xsl:template>
<xsl:template match="@*|node()" priority="-1"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template>
</xsl:stylesheet>
-----Original Message-----
From: David Legg [mailto:david.legg@searchevent.co.uk]
Sent: Monday, September 01, 2008 2:40 AM
To: users@cocoon.apache.org
Subject: Re: cforms + javaflow + sitemap problem
Мария Григорьева wrote:
>
> <map:match pattern="*/*">
>
> <map:aggregate element="content">
>
> <map:part src="index.xml"/>
>
> <map:part src="cocoon:/main/{1}/{2}" element="main"/>
>
> </map:aggregate>
>
> <map:transform src="styles/main.xsl"/>
>
> <map:serialize type="html"/>
>
> </map:match>
>
> ……..
>
> <map:match pattern="main/experiments/*.do">
>
> <map:call function="{1}"/>
>
> </map:match>
>
> <map:match pattern="main/form-template/*">
>
> <map:generate type="jx" src="form-template/{1}.xml"/>
>
> <map:transform src="styles/input-forms.xsl"/>
>
> <map:serialize/>
>
> </map:match>
>
> ……………………..
>
> In my flowscript :
>
> sendPage("form-template/experiment-template", new
> VarMap().add("experiment", results));
>
> But at the output - I have double-header part! (The part <map:part
> src="index.xml"/> from the sitemap)
>
> I’ve have had this problem with the flowscript with the redirect function.
>
> So, I decide it with the help of param “false” --- redirect(“url”, false);
>
> Help please!!!
>
It looks like your route takes you through two separate stylesheets
(styles/main.xsl and styles/input-forms.xsl). Is it possible both these
stylesheets add a header? Or perhaps, index.xml contains a header?
Without more info it's difficult to tell.
Regards,
David Legg
---------------------------------------------------------------------
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