RE: XInclude in sitemap.xmap

2012-11-20 Thread Robby Pelssers
Hi Mansour,

You again leave out the important bit that failed.  I still am not sure why 
your test failed. If you look in the 
cocoon-sample/COB-INF/aggregation/xinclude.xml you will see a file like this. 
It could as well have declared the namespace on the root or any parent node.

?xml version=1.0 encoding=UTF-8?
sample
  sub1
xi:include xmlns:xi=http://www.w3.org/2001/XInclude; 
href=servlet:/aggregation/sub-request/
  /sub1
  sub2
xi:include xmlns:xi=http://www.w3.org/2001/XInclude; 
href=aggregation/sub.xml/
  /sub2
/sample

?xml version=1.0 encoding=UTF-8?
sample xmlns:xi=http://www.w3.org/2001/XInclude;
  sub1
xi:include href=servlet:/aggregation/sub-request/
  /sub1
  sub2
xi:include href=aggregation/sub.xml/
  /sub2
/sample

So please specify exactly what your input looks like. I want to understand if 
you made a mistake or you spotted another potential bug.

Robby


-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] 
Sent: Tuesday, November 20, 2012 6:47 AM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

Thank you Robby. I think I found the issue. I have this in my document:

programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting

Which is generating the issue.
When I replace it with:

programlisting language=c
xi:include  href=hello.c  parse=text /
/programlisting

Everything works fine. This is strange because having an xmlns:xi shouldn't 
cause this.
Any way it's working now.

Thank you.


On Thu, Nov 15, 2012 at 3:40 AM, Robby Pelssers robby.pelss...@nxp.com wrote:
 First I downloaded the result of invoking this unmodified pipeline.
   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:serialize type=xml /
   /map:match

 No namespace garbage left so XIncludeTransformer seems to work fine:
 ?xml version=1.0 encoding=UTF-8? sample
   sub1
 subsub/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample

 Next I setup the exact same pipeline in the sample block:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:transform src=xslt/identity.xslt/
 map:serialize type=xml /
   /map:match

 No issues here.

 And just to make sure that identity.xslt was actually used I slightly 
 modified it ?xml version=1.0 encoding=utf-8? xsl:stylesheet 
 version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:xi=http://www.w3.org/2001/XInclude;


 xsl:template match=sub1/sub
   subsub replaced/sub
 /xsl:template


 xsl:template match=@*|node()
 xsl:copy
 xsl:apply-templates select=@*|node()/
 /xsl:copy
 /xsl:template
 /xsl:stylesheet

 Now the result becomes:
 ?xml version=1.0 encoding=UTF-8?sample
   sub1
 sub xmlns:xi=http://www.w3.org/2001/XInclude;sub replaced/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample


 But one might wonder why you left in the xi namespace in the first place. So 
 next I removed that namespace from the xslt.

 ?xml version=1.0 encoding=UTF-8? sample
   sub1
 subsub replaced/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample

 So  I think you might recheck if you're not doing some exotic stuff which 
 you forgot to mention.

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Thursday, November 15, 2012 1:51 AM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 One additional problem. This is not related to the property resolution, but 
 to the XInclude. After I process xinclude, if I apply another transformation, 
 I get an error:
 Caused by: org.xml.sax.SAXException: Namespace for prefix 'xi' not found.
 at 
 org.apache.cocoon.sax.AbstractSAXTransformer.endPrefixMapping(Abstract
 SAXTransformer.java:79) 
 ~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
 at 
 org.apache.cocoon.sax.component.XIncludeTransformer.endPrefixMapping(X
 IncludeTransformer.java:515) 
 ~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]


 The transformation can be any thing simple. Identity transformation will 
 cause this issue as well. Here's the transformation I am applying after the 
 xinclude:

 ?xml version=1.0 encoding=utf-8? xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:xi=http://www.w3.org/2001/XInclude;
   xsl:template match=@*|node()
 xsl:copy
   xsl:apply-templates select=@*|node()/
 /xsl:copy
   /xsl:template
 /xsl:stylesheet


 And here is the sitemap

Re: XInclude in sitemap.xmap

2012-11-20 Thread Mansour Al Akeel
Robby,
The serializer removes the extra xi:xmlns. However when you apply
another transformation immediately after the xinclude you may get this
error. Please try to do apply any transformation, and let me know if
you are able to regenerate the issue.


On Tue, Nov 20, 2012 at 3:31 AM, Robby Pelssers robby.pelss...@nxp.com wrote:
 Hi Mansour,

 You again leave out the important bit that failed.  I still am not sure why 
 your test failed. If you look in the 
 cocoon-sample/COB-INF/aggregation/xinclude.xml you will see a file like this. 
 It could as well have declared the namespace on the root or any parent node.

 ?xml version=1.0 encoding=UTF-8?
 sample
   sub1
 xi:include xmlns:xi=http://www.w3.org/2001/XInclude; 
 href=servlet:/aggregation/sub-request/
   /sub1
   sub2
 xi:include xmlns:xi=http://www.w3.org/2001/XInclude; 
 href=aggregation/sub.xml/
   /sub2
 /sample

 ?xml version=1.0 encoding=UTF-8?
 sample xmlns:xi=http://www.w3.org/2001/XInclude;
   sub1
 xi:include href=servlet:/aggregation/sub-request/
   /sub1
   sub2
 xi:include href=aggregation/sub.xml/
   /sub2
 /sample

 So please specify exactly what your input looks like. I want to understand if 
 you made a mistake or you spotted another potential bug.

 Robby


 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Tuesday, November 20, 2012 6:47 AM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 Thank you Robby. I think I found the issue. I have this in my document:

 programlisting language=c
 xi:include  href=hello.c  parse=text
 xmlns:xi=http://www.w3.org/2001/XInclude/
 /programlisting

 Which is generating the issue.
 When I replace it with:

 programlisting language=c
 xi:include  href=hello.c  parse=text /
 /programlisting

 Everything works fine. This is strange because having an xmlns:xi shouldn't 
 cause this.
 Any way it's working now.

 Thank you.


 On Thu, Nov 15, 2012 at 3:40 AM, Robby Pelssers robby.pelss...@nxp.com 
 wrote:
 First I downloaded the result of invoking this unmodified pipeline.
   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:serialize type=xml /
   /map:match

 No namespace garbage left so XIncludeTransformer seems to work fine:
 ?xml version=1.0 encoding=UTF-8? sample
   sub1
 subsub/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample

 Next I setup the exact same pipeline in the sample block:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:transform src=xslt/identity.xslt/
 map:serialize type=xml /
   /map:match

 No issues here.

 And just to make sure that identity.xslt was actually used I slightly
 modified it ?xml version=1.0 encoding=utf-8? xsl:stylesheet
 version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:xi=http://www.w3.org/2001/XInclude;


 xsl:template match=sub1/sub
   subsub replaced/sub
 /xsl:template


 xsl:template match=@*|node()
 xsl:copy
 xsl:apply-templates select=@*|node()/
 /xsl:copy
 /xsl:template
 /xsl:stylesheet

 Now the result becomes:
 ?xml version=1.0 encoding=UTF-8?sample
   sub1
 sub xmlns:xi=http://www.w3.org/2001/XInclude;sub replaced/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample


 But one might wonder why you left in the xi namespace in the first place. So 
 next I removed that namespace from the xslt.

 ?xml version=1.0 encoding=UTF-8? sample
   sub1
 subsub replaced/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample

 So  I think you might recheck if you're not doing some exotic stuff 
 which you forgot to mention.

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Thursday, November 15, 2012 1:51 AM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 One additional problem. This is not related to the property resolution, but 
 to the XInclude. After I process xinclude, if I apply another 
 transformation, I get an error:
 Caused by: org.xml.sax.SAXException: Namespace for prefix 'xi' not found.
 at
 org.apache.cocoon.sax.AbstractSAXTransformer.endPrefixMapping(Abstract
 SAXTransformer.java:79)
 ~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
 at
 org.apache.cocoon.sax.component.XIncludeTransformer.endPrefixMapping(X
 IncludeTransformer.java:515)
 ~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]


 The transformation can be any thing simple. Identity transformation will 
 cause this issue as well. Here's

RE: XInclude in sitemap.xmap

2012-11-20 Thread Robby Pelssers
If you paid careful attention to my mail... I mimicked exactly that use case. 
See below

 Next I setup the exact same pipeline in the sample block:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:transform src=xslt/identity.xslt/
 map:serialize type=xml /
   /map:match

 No issues here.


Like I said..  you should isolate this problem to a minimalistic failing use 
case and show how I can reproduce it.  Now I have nothing concrete to go on. So 
I need a sitemap match pattern.. and preferably you can copy-paste the content 
of the input file and transformer.  

Robby 



-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] 
Sent: Tuesday, November 20, 2012 2:41 PM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

Robby,
The serializer removes the extra xi:xmlns. However when you apply another 
transformation immediately after the xinclude you may get this error. Please 
try to do apply any transformation, and let me know if you are able to 
regenerate the issue.


On Tue, Nov 20, 2012 at 3:31 AM, Robby Pelssers robby.pelss...@nxp.com wrote:
 Hi Mansour,

 You again leave out the important bit that failed.  I still am not sure why 
 your test failed. If you look in the 
 cocoon-sample/COB-INF/aggregation/xinclude.xml you will see a file like this. 
 It could as well have declared the namespace on the root or any parent node.

 ?xml version=1.0 encoding=UTF-8? sample
   sub1
 xi:include xmlns:xi=http://www.w3.org/2001/XInclude; 
 href=servlet:/aggregation/sub-request/
   /sub1
   sub2
 xi:include xmlns:xi=http://www.w3.org/2001/XInclude; 
 href=aggregation/sub.xml/
   /sub2
 /sample

 ?xml version=1.0 encoding=UTF-8? sample 
 xmlns:xi=http://www.w3.org/2001/XInclude;
   sub1
 xi:include href=servlet:/aggregation/sub-request/
   /sub1
   sub2
 xi:include href=aggregation/sub.xml/
   /sub2
 /sample

 So please specify exactly what your input looks like. I want to understand if 
 you made a mistake or you spotted another potential bug.

 Robby


 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Tuesday, November 20, 2012 6:47 AM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 Thank you Robby. I think I found the issue. I have this in my document:

 programlisting language=c
 xi:include  href=hello.c  parse=text
 xmlns:xi=http://www.w3.org/2001/XInclude/
 /programlisting

 Which is generating the issue.
 When I replace it with:

 programlisting language=c
 xi:include  href=hello.c  parse=text /
 /programlisting

 Everything works fine. This is strange because having an xmlns:xi shouldn't 
 cause this.
 Any way it's working now.

 Thank you.


 On Thu, Nov 15, 2012 at 3:40 AM, Robby Pelssers robby.pelss...@nxp.com 
 wrote:
 First I downloaded the result of invoking this unmodified pipeline.
   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:serialize type=xml /
   /map:match

 No namespace garbage left so XIncludeTransformer seems to work fine:
 ?xml version=1.0 encoding=UTF-8? sample
   sub1
 subsub/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample

 Next I setup the exact same pipeline in the sample block:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:transform src=xslt/identity.xslt/
 map:serialize type=xml /
   /map:match

 No issues here.

 And just to make sure that identity.xslt was actually used I slightly 
 modified it ?xml version=1.0 encoding=utf-8? xsl:stylesheet 
 version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:xi=http://www.w3.org/2001/XInclude;


 xsl:template match=sub1/sub
   subsub replaced/sub
 /xsl:template


 xsl:template match=@*|node()
 xsl:copy
 xsl:apply-templates select=@*|node()/
 /xsl:copy
 /xsl:template
 /xsl:stylesheet

 Now the result becomes:
 ?xml version=1.0 encoding=UTF-8?sample
   sub1
 sub xmlns:xi=http://www.w3.org/2001/XInclude;sub replaced/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample


 But one might wonder why you left in the xi namespace in the first place. So 
 next I removed that namespace from the xslt.

 ?xml version=1.0 encoding=UTF-8? sample
   sub1
 subsub replaced/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample

 So  I think you might recheck

Re: XInclude in sitemap.xmap

2012-11-19 Thread Mansour Al Akeel
Thank you Robby. I think I found the issue. I have this in my document:

programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting

Which is generating the issue.
When I replace it with:

programlisting language=c
xi:include  href=hello.c  parse=text /
/programlisting

Everything works fine. This is strange because having an xmlns:xi
shouldn't cause this.
Any way it's working now.

Thank you.


On Thu, Nov 15, 2012 at 3:40 AM, Robby Pelssers robby.pelss...@nxp.com wrote:
 First I downloaded the result of invoking this unmodified pipeline.
   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:serialize type=xml /
   /map:match

 No namespace garbage left so XIncludeTransformer seems to work fine:
 ?xml version=1.0 encoding=UTF-8?
 sample
   sub1
 subsub/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample

 Next I setup the exact same pipeline in the sample block:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:transform src=xslt/identity.xslt/
 map:serialize type=xml /
   /map:match

 No issues here.

 And just to make sure that identity.xslt was actually used I slightly 
 modified it
 ?xml version=1.0 encoding=utf-8?
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:xi=http://www.w3.org/2001/XInclude;


 xsl:template match=sub1/sub
   subsub replaced/sub
 /xsl:template


 xsl:template match=@*|node()
 xsl:copy
 xsl:apply-templates select=@*|node()/
 /xsl:copy
 /xsl:template
 /xsl:stylesheet

 Now the result becomes:
 ?xml version=1.0 encoding=UTF-8?sample
   sub1
 sub xmlns:xi=http://www.w3.org/2001/XInclude;sub replaced/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample


 But one might wonder why you left in the xi namespace in the first place. So 
 next I removed that namespace from the xslt.

 ?xml version=1.0 encoding=UTF-8?
 sample
   sub1
 subsub replaced/sub
   /sub1
   sub2
 subsub/sub
   /sub2
 /sample

 So  I think you might recheck if you're not doing some exotic stuff which 
 you forgot to mention.

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Thursday, November 15, 2012 1:51 AM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 One additional problem. This is not related to the property resolution, but 
 to the XInclude. After I process xinclude, if I apply another transformation, 
 I get an error:
 Caused by: org.xml.sax.SAXException: Namespace for prefix 'xi' not found.
 at 
 org.apache.cocoon.sax.AbstractSAXTransformer.endPrefixMapping(AbstractSAXTransformer.java:79)
 ~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
 at 
 org.apache.cocoon.sax.component.XIncludeTransformer.endPrefixMapping(XIncludeTransformer.java:515)
 ~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]


 The transformation can be any thing simple. Identity transformation will 
 cause this issue as well. Here's the transformation I am applying after the 
 xinclude:

 ?xml version=1.0 encoding=utf-8?
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:xi=http://www.w3.org/2001/XInclude;
   xsl:template match=@*|node()
 xsl:copy
   xsl:apply-templates select=@*|node()/
 /xsl:copy
   /xsl:template
 /xsl:stylesheet


 And here is the sitemap:

 map:match pattern=article/{id}.xml
 map:generate 
 src={global:base.repo.path}/articles/{map:id}/index.xml /
 map:transform type=xinclude 
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl
 value=file:///home/mansour/workspace/pipelines/repo/articles/example/
 /
 /map:transform
 map:transform src=sheets/html/identity.xsl  /
 map:serialize type=xml  /
 /map:match


 If I remove the identity.xsl step, then things works fine.
 I am not sure how to solve this issue, but I think I can use two match one 
 for each step. However, knowing that cocoon applies xslt in a pipeline 
 without additional tweaks, should allow me to directly process the stream 
 with identity.xsl.

 Thank you.

 On Wed, Nov 14, 2012 at 7:39 PM, Mansour Al Akeel mansour.alak...@gmail.com 
 wrote:
 Robby, thank you for taking care of this issue.



 On Wed, Nov 14, 2012 at 12:11 PM, Robby Pelssers robby.pelss...@nxp.com 
 wrote:
 I'm closing in on finding

RE: XInclude in sitemap.xmap

2012-11-15 Thread Robby Pelssers
Ok... my first impression would be that the XIncludeTransformer leaves an 
unwanted default namespace xi after inclusion.  I will debug and see what's 
happening.

Robby

-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] 
Sent: Thursday, November 15, 2012 1:51 AM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

One additional problem. This is not related to the property resolution, but to 
the XInclude. After I process xinclude, if I apply another transformation, I 
get an error:
Caused by: org.xml.sax.SAXException: Namespace for prefix 'xi' not found.
at 
org.apache.cocoon.sax.AbstractSAXTransformer.endPrefixMapping(AbstractSAXTransformer.java:79)
~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.sax.component.XIncludeTransformer.endPrefixMapping(XIncludeTransformer.java:515)
~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]


The transformation can be any thing simple. Identity transformation will cause 
this issue as well. Here's the transformation I am applying after the xinclude:

?xml version=1.0 encoding=utf-8?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:xi=http://www.w3.org/2001/XInclude;
  xsl:template match=@*|node()
xsl:copy
  xsl:apply-templates select=@*|node()/
/xsl:copy
  /xsl:template
/xsl:stylesheet


And here is the sitemap:

map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl
value=file:///home/mansour/workspace/pipelines/repo/articles/example/
/
/map:transform
map:transform src=sheets/html/identity.xsl  /
map:serialize type=xml  /
/map:match


If I remove the identity.xsl step, then things works fine.
I am not sure how to solve this issue, but I think I can use two match one 
for each step. However, knowing that cocoon applies xslt in a pipeline without 
additional tweaks, should allow me to directly process the stream with 
identity.xsl.

Thank you.

On Wed, Nov 14, 2012 at 7:39 PM, Mansour Al Akeel mansour.alak...@gmail.com 
wrote:
 Robby, thank you for taking care of this issue.



 On Wed, Nov 14, 2012 at 12:11 PM, Robby Pelssers robby.pelss...@nxp.com 
 wrote:
 I'm closing in on finding the issue but not sure if I can fix it this week.

 Test 1:  Use {global:propertyName} in @src of a generator works fine
 -

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/{global:testProperty}.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:serialize type=xml /
   /map:match

 Test2: Use {global:propertyName} in the @value of a parameter does 
 not seem to work
 
   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value={global:testProperty}/
 /map:transform
 map:serialize type=xml /
   /map:match


 The real magic happens in org.apache.cocoon.sitemap.InvocationImpl

 public Object resolveParameter(final String parameter) {

 }

 But I think that method is not called for evaluating @value of a 
 map:parameter.

 If anyone can fix this today.. be my guest.  Otherwise I will take another 
 look this week (latest this weekend).

 Robby

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Wednesday, November 14, 2012 5:38 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 The solution you're looking for resides in using a LanguageInterpreter.

 Cocoon already has a few implementations:
 - org.apache.cocoon.sitemap.expression.SettingsInterpreter  (works 
 together with cocoon-spring-configurator)
 - org.apache.cocoon.sitemap.expression.JexlLanguageInterpreter
 - org.apache.cocoon.sitemap.expression.SitemapLanguageInterpreter

 http://cocoon.apache.org/3.0/apidocs/index.html

 In cocoon-expression-language.xml these are configured as beans. You see 
 that the last part after the colon is the prefix you can use in a sitemap.  
 I think you should just use the SettingsInterpreter in your case.  It's the 
 default way to access properties.



 beans xmlns=http://www.springframework.org/schema/beans; 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

RE: XInclude in sitemap.xmap

2012-11-15 Thread Robby Pelssers
First I downloaded the result of invoking this unmodified pipeline.
  map:match equals=aggregation/xinclude-transformer
map:generate src=aggregation/xinclude.xml /
map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
/map:transform
map:serialize type=xml /
  /map:match

No namespace garbage left so XIncludeTransformer seems to work fine:
?xml version=1.0 encoding=UTF-8?
sample
  sub1
subsub/sub
  /sub1
  sub2
subsub/sub
  /sub2
/sample

Next I setup the exact same pipeline in the sample block:

  map:match equals=aggregation/xinclude-transformer
map:generate src=aggregation/xinclude.xml /
map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
/map:transform
map:transform src=xslt/identity.xslt/
map:serialize type=xml /
  /map:match

No issues here.

And just to make sure that identity.xslt was actually used I slightly modified 
it
?xml version=1.0 encoding=utf-8?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:xi=http://www.w3.org/2001/XInclude;


xsl:template match=sub1/sub
  subsub replaced/sub
/xsl:template


xsl:template match=@*|node()
xsl:copy
xsl:apply-templates select=@*|node()/
/xsl:copy
/xsl:template
/xsl:stylesheet

Now the result becomes:
?xml version=1.0 encoding=UTF-8?sample
  sub1
sub xmlns:xi=http://www.w3.org/2001/XInclude;sub replaced/sub
  /sub1
  sub2
subsub/sub
  /sub2
/sample


But one might wonder why you left in the xi namespace in the first place. So 
next I removed that namespace from the xslt.

?xml version=1.0 encoding=UTF-8?
sample
  sub1
subsub replaced/sub
  /sub1
  sub2
subsub/sub
  /sub2
/sample

So  I think you might recheck if you're not doing some exotic stuff which 
you forgot to mention.  

Robby

-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] 
Sent: Thursday, November 15, 2012 1:51 AM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

One additional problem. This is not related to the property resolution, but to 
the XInclude. After I process xinclude, if I apply another transformation, I 
get an error:
Caused by: org.xml.sax.SAXException: Namespace for prefix 'xi' not found.
at 
org.apache.cocoon.sax.AbstractSAXTransformer.endPrefixMapping(AbstractSAXTransformer.java:79)
~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.sax.component.XIncludeTransformer.endPrefixMapping(XIncludeTransformer.java:515)
~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]


The transformation can be any thing simple. Identity transformation will cause 
this issue as well. Here's the transformation I am applying after the xinclude:

?xml version=1.0 encoding=utf-8?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:xi=http://www.w3.org/2001/XInclude;
  xsl:template match=@*|node()
xsl:copy
  xsl:apply-templates select=@*|node()/
/xsl:copy
  /xsl:template
/xsl:stylesheet


And here is the sitemap:

map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl
value=file:///home/mansour/workspace/pipelines/repo/articles/example/
/
/map:transform
map:transform src=sheets/html/identity.xsl  /
map:serialize type=xml  /
/map:match


If I remove the identity.xsl step, then things works fine.
I am not sure how to solve this issue, but I think I can use two match one 
for each step. However, knowing that cocoon applies xslt in a pipeline without 
additional tweaks, should allow me to directly process the stream with 
identity.xsl.

Thank you.

On Wed, Nov 14, 2012 at 7:39 PM, Mansour Al Akeel mansour.alak...@gmail.com 
wrote:
 Robby, thank you for taking care of this issue.



 On Wed, Nov 14, 2012 at 12:11 PM, Robby Pelssers robby.pelss...@nxp.com 
 wrote:
 I'm closing in on finding the issue but not sure if I can fix it this week.

 Test 1:  Use {global:propertyName} in @src of a generator works fine
 -

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/{global:testProperty}.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:serialize type=xml /
   /map:match

 Test2: Use {global:propertyName} in the @value of a parameter does 
 not seem to work
 
   map:match equals=aggregation/xinclude

RE: XInclude in sitemap.xmap

2012-11-14 Thread Robby Pelssers
I think you will need to paste the complete sitemap to get more insight into 
your issue.  Can you please specify which version of Cocoon you're using per 
question.. even if repeated. I really need to know the context as some things 
might work differently between versions.

I don't exactly remember why you used an input module. In C2.2 I use properties 
in combination with both the cocoon-spring-configurator to 
- set bean property values in the application context files
- use them directly in my sitemap using ${propertyName}



  map:match pattern=exportMergedFiles/*
map:generate src=cocoon:/linkinginfo/{1}/
map:transform src=xslt/writeTopics.xslt type=saxon
  map:parameter name=folderPath value=${exportFolder}/{1}/merged/
/map:transform
map:serialize type=xml/
  /map:match

Robby

-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] 
Sent: Wednesday, November 14, 2012 6:40 AM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

Thank you both for helping.
Robby,
this is the message I am getting now.
05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Adding 
component XMLSerializer(hashCode=306853147) to pipeline
[CachingPipeline(hashCode=1346781896
components=[XMLGenerator(hashCode=1918414275
internalGenerator=URLGenerator(hashCode=1966798757
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml)),
XIncludeTransformer(hashCode=950275600
baseUrl=file:/{global:base.repo.path}/articles/{map:id}/)])].
05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XMLGenerator(hashCode=1918414275
internalGenerator=URLGenerator(hashCode=1966798757
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
with XIncludeTransformer(hashCode=950275600
baseUrl=file:/{global:base.repo.path}/articles/{map:id}/).
05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XIncludeTransformer(hashCode=950275600
baseUrl=file:/{global:base.repo.path}/articles/{map:id}/) with 
XMLSerializer(hashCode=306853147).

It looks like the baseUrl is not being resolved with the input modules. For 
example:

baseUrl=file:/{global:base.repo.path}/articles/{map:id}/

Your efforts is highly appreciated.
Thank you.


On Tue, Nov 13, 2012 at 10:43 AM, Francesco Chicchiriccò ilgro...@apache.org 
wrote:
 On 13/11/2012 16:33, Robby Pelssers wrote:
 Ok..

 I fixed the issue:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value=file:///c:/tmp//
 map:parameter name=test value=hello world/
 /map:transform
 map:serialize type=xml /
   /map:match

 Works now.

 I committed the fix to Cocoon3 trunk.

 Hi Robby,
 thank you for taking care of this: just tested your fix and the build 
 runs fine.

 For records, could you please file an issue on JIRA (COCOON3), add 
 your fix revision number as comment and then close it?
 Thanks.

 Regards.

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Tuesday, November 13, 2012 2:49 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 Ok... I found the problem.

 Inside org.apache.cocoon.sitemap.node.AbstractSitemapNode the baseUrl is 
 overridden, although it correctly receives the baseUrl.

 invocationParams = {
 baseUrl=file:///c:/tmp/
 cacheKey={map:0}
 test=hello world
 }


 protected InvocationResult invoke(final String src, final String 
 type,  final Invocation invocation) {

 
 // set the baseUrl  PROBLEMATIC PART
 invocationParams.put(baseUrl, invocation.resolve());

 }


 But before starting making changes... this might need careful attention.

 Robby


 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Tuesday, November 13, 2012 2:32 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 I'm debugging your issue and so far I'm pretty bedazzled about what the hell 
 is going on:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value=file:///c:/tmp//
 map:parameter name=test value=hello world/
 /map:transform
 map:serialize type=xml /
   /map:match

 While debugging I see following Configuration - MapString, Object

 baseUrl=file:/C:/workspaces/apache/cocoon/cocoon3/trunk/cocoon-sample
 /./src/main/resources/COB-INF/ 
 cacheKey=aggregation/xinclude-transformer
 test=hello world

 Will keep you posted.. Maybe the baseUrl is somewhere overridden while 
 setting up the pipeline? Anyone

Re: XInclude in sitemap.xmap

2012-11-14 Thread Mansour Al Akeel
I am using 3.0.0-beta-1-SNAPSHOT built from trunk. Here's my sitemap:

 map:pipeline
  map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl
value={global:base.repo.path}/articles/{map:id}/ /
/map:transform
!-- map:transform src=sheets/html/xslthl.xsl  / --
map:serialize type=xml  /
/map:match

Here's part of the document:

Another Example using xinclude:
===
programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting

Here's the log:
15:04:37.529 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline -
~ adding ParameterCacheKey(hashCode=516462290
parameters={encoding=UTF-8, method=xml}) for component
XMLSerializer(hashCode=834671663)
15:04:37.530 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline -
Creating  CompoundCacheKey(hashCode=2115562712
key=[TimestampCacheKey(hashCode=2006330189
url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
timestamp=1352905028000 (2012-11-14 14:57:08.0)),
CachedCacheKey(hashCode=772251321
internalCacheKey=ObjectCacheKey(hashCode=686698957
obj=article/example.xml)
cachedCacheKey=org.apache.cocoon.pipeline.caching.InvalidCacheKey@b78a1f0d),
ParameterCacheKey(hashCode=516462290 parameters={encoding=UTF-8,
method=xml})]) for pipeline CachingPipeline(hashCode=1875503051
components=[XMLGenerator(hashCode=437776393
internalGenerator=URLGenerator(hashCode=333002925
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml)),
XIncludeTransformer(hashCode=1313024268
baseUrl=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/{global:base.repo.path}/articles/{map:id}/),
XMLSerializer(hashCode=834671663)])
15:04:37.530 [btpool0-1] INFO  o.a.cocoon.servlet.RequestProcessor -
Going to send NOT MODIFIED response: statusCode=304, lastModified=-1
15:04:37.530 [btpool0-1] INFO  o.a.cocoon.servlet.RequestProcessor -
Sitemap execution for /article/example.xml took 195.35498 ms.

The variables are matching the correct document, and it's served
correctly, but without xincludes being processed.



On Wed, Nov 14, 2012 at 6:54 AM, Robby Pelssers robby.pelss...@nxp.com wrote:
 I think you will need to paste the complete sitemap to get more insight into 
 your issue.  Can you please specify which version of Cocoon you're using per 
 question.. even if repeated. I really need to know the context as some things 
 might work differently between versions.

 I don't exactly remember why you used an input module. In C2.2 I use 
 properties in combination with both the cocoon-spring-configurator to
 - set bean property values in the application context files
 - use them directly in my sitemap using ${propertyName}



   map:match pattern=exportMergedFiles/*
 map:generate src=cocoon:/linkinginfo/{1}/
 map:transform src=xslt/writeTopics.xslt type=saxon
   map:parameter name=folderPath 
 value=${exportFolder}/{1}/merged/
 /map:transform
 map:serialize type=xml/
   /map:match

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Wednesday, November 14, 2012 6:40 AM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 Thank you both for helping.
 Robby,
 this is the message I am getting now.
 05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Adding 
 component XMLSerializer(hashCode=306853147) to pipeline
 [CachingPipeline(hashCode=1346781896
 components=[XMLGenerator(hashCode=1918414275
 internalGenerator=URLGenerator(hashCode=1966798757
 source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml)),
 XIncludeTransformer(hashCode=950275600
 baseUrl=file:/{global:base.repo.path}/articles/{map:id}/)])].
 05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going 
 to link the component XMLGenerator(hashCode=1918414275
 internalGenerator=URLGenerator(hashCode=1966798757
 source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
 with XIncludeTransformer(hashCode=950275600
 baseUrl=file:/{global:base.repo.path}/articles/{map:id}/).
 05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going 
 to link the component XIncludeTransformer(hashCode=950275600
 baseUrl=file:/{global:base.repo.path}/articles/{map:id}/) with 
 XMLSerializer(hashCode=306853147).

 It looks like the baseUrl is not being resolved with the input modules. For 
 example:

 baseUrl=file:/{global:base.repo.path}/articles/{map:id}/

 Your efforts is highly appreciated.
 Thank you.


 On Tue, Nov 13, 2012 at 10:43 AM, Francesco Chicchiriccò 
 ilgro

RE: XInclude in sitemap.xmap

2012-11-14 Thread Robby Pelssers
I did a little test myself and by the looks of it it's not supported.  

map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl 
value=file:///c:/{request-param:subfolder}//
/map:transform


I hacked a bit in the cocoon-sample project and invoked this url:

http://localhost:/aggregation/xinclude-transformer?subfolder=tmp



In that case I get a nice XML exception page with following message:
messagec:\{request-param:subfolder}\xinclude\testinclude.xml (The filename, 
directory name, or volume label syntax is incorrect)/message

This means... that input modules are not supported yet. Will be interesting to 
see if we plan to support this in C3.  But this would work in C2.2 as I've used 
inputmodules quite a lot.

Robby


-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] 
Sent: Wednesday, November 14, 2012 4:09 PM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

I am using 3.0.0-beta-1-SNAPSHOT built from trunk. Here's my sitemap:

 map:pipeline
  map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl
value={global:base.repo.path}/articles/{map:id}/ /
/map:transform
!-- map:transform src=sheets/html/xslthl.xsl  / --
map:serialize type=xml  /
/map:match

Here's part of the document:

Another Example using xinclude:
===
programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting

Here's the log:
15:04:37.529 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
ParameterCacheKey(hashCode=516462290
parameters={encoding=UTF-8, method=xml}) for component
XMLSerializer(hashCode=834671663)
15:04:37.530 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating  
CompoundCacheKey(hashCode=2115562712
key=[TimestampCacheKey(hashCode=2006330189
url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
timestamp=1352905028000 (2012-11-14 14:57:08.0)),
CachedCacheKey(hashCode=772251321
internalCacheKey=ObjectCacheKey(hashCode=686698957
obj=article/example.xml)
cachedCacheKey=org.apache.cocoon.pipeline.caching.InvalidCacheKey@b78a1f0d),
ParameterCacheKey(hashCode=516462290 parameters={encoding=UTF-8,
method=xml})]) for pipeline CachingPipeline(hashCode=1875503051
components=[XMLGenerator(hashCode=437776393
internalGenerator=URLGenerator(hashCode=333002925
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml)),
XIncludeTransformer(hashCode=1313024268
baseUrl=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/{global:base.repo.path}/articles/{map:id}/),
XMLSerializer(hashCode=834671663)])
15:04:37.530 [btpool0-1] INFO  o.a.cocoon.servlet.RequestProcessor - Going to 
send NOT MODIFIED response: statusCode=304, lastModified=-1 15:04:37.530 
[btpool0-1] INFO  o.a.cocoon.servlet.RequestProcessor - Sitemap execution for 
/article/example.xml took 195.35498 ms.

The variables are matching the correct document, and it's served correctly, but 
without xincludes being processed.



On Wed, Nov 14, 2012 at 6:54 AM, Robby Pelssers robby.pelss...@nxp.com wrote:
 I think you will need to paste the complete sitemap to get more insight into 
 your issue.  Can you please specify which version of Cocoon you're using per 
 question.. even if repeated. I really need to know the context as some things 
 might work differently between versions.

 I don't exactly remember why you used an input module. In C2.2 I use 
 properties in combination with both the cocoon-spring-configurator to
 - set bean property values in the application context files
 - use them directly in my sitemap using ${propertyName}



   map:match pattern=exportMergedFiles/*
 map:generate src=cocoon:/linkinginfo/{1}/
 map:transform src=xslt/writeTopics.xslt type=saxon
   map:parameter name=folderPath 
 value=${exportFolder}/{1}/merged/
 /map:transform
 map:serialize type=xml/
   /map:match

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Wednesday, November 14, 2012 6:40 AM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 Thank you both for helping.
 Robby,
 this is the message I am getting now.
 05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - 
 Adding component XMLSerializer(hashCode=306853147) to pipeline
 [CachingPipeline(hashCode=1346781896
 components=[XMLGenerator(hashCode=1918414275
 internalGenerator=URLGenerator(hashCode=1966798757
 source=file:/home/mansour/workspace/pipelines/repo

RE: XInclude in sitemap.xmap

2012-11-14 Thread Robby Pelssers
The solution you're looking for resides in using a LanguageInterpreter.

Cocoon already has a few implementations:
- org.apache.cocoon.sitemap.expression.SettingsInterpreter  (works together 
with cocoon-spring-configurator)
- org.apache.cocoon.sitemap.expression.JexlLanguageInterpreter
- org.apache.cocoon.sitemap.expression.SitemapLanguageInterpreter

http://cocoon.apache.org/3.0/apidocs/index.html

In cocoon-expression-language.xml these are configured as beans. You see that 
the last part after the colon is the prefix you can use in a sitemap.  I think 
you should just use the SettingsInterpreter in your case.  It's the default way 
to access properties.



beans xmlns=http://www.springframework.org/schema/beans; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd;

  bean name=org.apache.cocoon.sitemap.expression.LanguageInterpreterFactory

class=org.apache.cocoon.sitemap.expression.PrototypeLanguageInterpreterFactory
 /

  bean name=expression-language:map 
class=org.apache.cocoon.sitemap.expression.SitemapLanguageInterpreter /
  
  bean name=expression-language:jexl 
class=org.apache.cocoon.sitemap.expression.JexlLanguageInterpreter /
  
  bean name=expression-language:global 
class=org.apache.cocoon.sitemap.expression.SettingsInterpreter /

/beans

Robby

-Original Message-
From: Robby Pelssers [mailto:robby.pelss...@nxp.com] 
Sent: Wednesday, November 14, 2012 5:18 PM
To: users@cocoon.apache.org
Subject: RE: XInclude in sitemap.xmap

I did a little test myself and by the looks of it it's not supported.  

map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl 
value=file:///c:/{request-param:subfolder}//
/map:transform


I hacked a bit in the cocoon-sample project and invoked this url:

http://localhost:/aggregation/xinclude-transformer?subfolder=tmp



In that case I get a nice XML exception page with following message:
messagec:\{request-param:subfolder}\xinclude\testinclude.xml (The filename, 
directory name, or volume label syntax is incorrect)/message

This means... that input modules are not supported yet. Will be interesting to 
see if we plan to support this in C3.  But this would work in C2.2 as I've used 
inputmodules quite a lot.

Robby


-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
Sent: Wednesday, November 14, 2012 4:09 PM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

I am using 3.0.0-beta-1-SNAPSHOT built from trunk. Here's my sitemap:

 map:pipeline
  map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl
value={global:base.repo.path}/articles/{map:id}/ /
/map:transform
!-- map:transform src=sheets/html/xslthl.xsl  / --
map:serialize type=xml  /
/map:match

Here's part of the document:

Another Example using xinclude:
===
programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting

Here's the log:
15:04:37.529 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
ParameterCacheKey(hashCode=516462290
parameters={encoding=UTF-8, method=xml}) for component
XMLSerializer(hashCode=834671663)
15:04:37.530 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating  
CompoundCacheKey(hashCode=2115562712
key=[TimestampCacheKey(hashCode=2006330189
url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
timestamp=1352905028000 (2012-11-14 14:57:08.0)),
CachedCacheKey(hashCode=772251321
internalCacheKey=ObjectCacheKey(hashCode=686698957
obj=article/example.xml)
cachedCacheKey=org.apache.cocoon.pipeline.caching.InvalidCacheKey@b78a1f0d),
ParameterCacheKey(hashCode=516462290 parameters={encoding=UTF-8,
method=xml})]) for pipeline CachingPipeline(hashCode=1875503051
components=[XMLGenerator(hashCode=437776393
internalGenerator=URLGenerator(hashCode=333002925
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml)),
XIncludeTransformer(hashCode=1313024268
baseUrl=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/{global:base.repo.path}/articles/{map:id}/),
XMLSerializer(hashCode=834671663)])
15:04:37.530 [btpool0-1] INFO  o.a.cocoon.servlet.RequestProcessor - Going to 
send NOT MODIFIED response: statusCode=304, lastModified=-1 15:04:37.530 
[btpool0-1] INFO  o.a.cocoon.servlet.RequestProcessor - Sitemap execution for 
/article/example.xml took 195.35498 ms.

The variables are matching the correct document

RE: XInclude in sitemap.xmap

2012-11-14 Thread Robby Pelssers
I'm closing in on finding the issue but not sure if I can fix it this week.

Test 1:  Use {global:propertyName} in @src of a generator works fine
-

  map:match equals=aggregation/xinclude-transformer
map:generate src=aggregation/{global:testProperty}.xml /
map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
/map:transform
map:serialize type=xml /
  /map:match

Test2: Use {global:propertyName} in the @value of a parameter does not seem to 
work

  map:match equals=aggregation/xinclude-transformer
map:generate src=aggregation/xinclude.xml /
map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl value={global:testProperty}/
/map:transform
map:serialize type=xml /
  /map:match


The real magic happens in org.apache.cocoon.sitemap.InvocationImpl 

public Object resolveParameter(final String parameter) {
   
}

But I think that method is not called for evaluating @value of a 
map:parameter.

If anyone can fix this today.. be my guest.  Otherwise I will take another look 
this week (latest this weekend).

Robby

-Original Message-
From: Robby Pelssers [mailto:robby.pelss...@nxp.com] 
Sent: Wednesday, November 14, 2012 5:38 PM
To: users@cocoon.apache.org
Subject: RE: XInclude in sitemap.xmap

The solution you're looking for resides in using a LanguageInterpreter.

Cocoon already has a few implementations:
- org.apache.cocoon.sitemap.expression.SettingsInterpreter  (works together 
with cocoon-spring-configurator)
- org.apache.cocoon.sitemap.expression.JexlLanguageInterpreter
- org.apache.cocoon.sitemap.expression.SitemapLanguageInterpreter

http://cocoon.apache.org/3.0/apidocs/index.html

In cocoon-expression-language.xml these are configured as beans. You see that 
the last part after the colon is the prefix you can use in a sitemap.  I think 
you should just use the SettingsInterpreter in your case.  It's the default way 
to access properties.



beans xmlns=http://www.springframework.org/schema/beans; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd;

  bean name=org.apache.cocoon.sitemap.expression.LanguageInterpreterFactory

class=org.apache.cocoon.sitemap.expression.PrototypeLanguageInterpreterFactory
 /

  bean name=expression-language:map 
class=org.apache.cocoon.sitemap.expression.SitemapLanguageInterpreter /
  
  bean name=expression-language:jexl 
class=org.apache.cocoon.sitemap.expression.JexlLanguageInterpreter /
  
  bean name=expression-language:global 
class=org.apache.cocoon.sitemap.expression.SettingsInterpreter /

/beans

Robby

-Original Message-
From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
Sent: Wednesday, November 14, 2012 5:18 PM
To: users@cocoon.apache.org
Subject: RE: XInclude in sitemap.xmap

I did a little test myself and by the looks of it it's not supported.  

map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl 
value=file:///c:/{request-param:subfolder}//
/map:transform


I hacked a bit in the cocoon-sample project and invoked this url:

http://localhost:/aggregation/xinclude-transformer?subfolder=tmp



In that case I get a nice XML exception page with following message:
messagec:\{request-param:subfolder}\xinclude\testinclude.xml (The filename, 
directory name, or volume label syntax is incorrect)/message

This means... that input modules are not supported yet. Will be interesting to 
see if we plan to support this in C3.  But this would work in C2.2 as I've used 
inputmodules quite a lot.

Robby


-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
Sent: Wednesday, November 14, 2012 4:09 PM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

I am using 3.0.0-beta-1-SNAPSHOT built from trunk. Here's my sitemap:

 map:pipeline
  map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl
value={global:base.repo.path}/articles/{map:id}/ /
/map:transform
!-- map:transform src=sheets/html/xslthl.xsl  / --
map:serialize type=xml  /
/map:match

Here's part of the document:

Another Example using xinclude:
===
programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude

Re: XInclude in sitemap.xmap

2012-11-14 Thread Mansour Al Akeel
Robby, thank you for taking care of this issue.



On Wed, Nov 14, 2012 at 12:11 PM, Robby Pelssers robby.pelss...@nxp.com wrote:
 I'm closing in on finding the issue but not sure if I can fix it this week.

 Test 1:  Use {global:propertyName} in @src of a generator works fine
 -

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/{global:testProperty}.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:serialize type=xml /
   /map:match

 Test2: Use {global:propertyName} in the @value of a parameter does not seem 
 to work
 
   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value={global:testProperty}/
 /map:transform
 map:serialize type=xml /
   /map:match


 The real magic happens in org.apache.cocoon.sitemap.InvocationImpl

 public Object resolveParameter(final String parameter) {

 }

 But I think that method is not called for evaluating @value of a 
 map:parameter.

 If anyone can fix this today.. be my guest.  Otherwise I will take another 
 look this week (latest this weekend).

 Robby

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Wednesday, November 14, 2012 5:38 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 The solution you're looking for resides in using a LanguageInterpreter.

 Cocoon already has a few implementations:
 - org.apache.cocoon.sitemap.expression.SettingsInterpreter  (works together 
 with cocoon-spring-configurator)
 - org.apache.cocoon.sitemap.expression.JexlLanguageInterpreter
 - org.apache.cocoon.sitemap.expression.SitemapLanguageInterpreter

 http://cocoon.apache.org/3.0/apidocs/index.html

 In cocoon-expression-language.xml these are configured as beans. You see that 
 the last part after the colon is the prefix you can use in a sitemap.  I 
 think you should just use the SettingsInterpreter in your case.  It's the 
 default way to access properties.



 beans xmlns=http://www.springframework.org/schema/beans; 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd;

   bean name=org.apache.cocoon.sitemap.expression.LanguageInterpreterFactory
 
 class=org.apache.cocoon.sitemap.expression.PrototypeLanguageInterpreterFactory
  /

   bean name=expression-language:map 
 class=org.apache.cocoon.sitemap.expression.SitemapLanguageInterpreter /

   bean name=expression-language:jexl 
 class=org.apache.cocoon.sitemap.expression.JexlLanguageInterpreter /

   bean name=expression-language:global 
 class=org.apache.cocoon.sitemap.expression.SettingsInterpreter /

 /beans

 Robby

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Wednesday, November 14, 2012 5:18 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 I did a little test myself and by the looks of it it's not supported.

 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl 
 value=file:///c:/{request-param:subfolder}//
 /map:transform


 I hacked a bit in the cocoon-sample project and invoked this url:

 http://localhost:/aggregation/xinclude-transformer?subfolder=tmp



 In that case I get a nice XML exception page with following message:
 messagec:\{request-param:subfolder}\xinclude\testinclude.xml (The filename, 
 directory name, or volume label syntax is incorrect)/message

 This means... that input modules are not supported yet. Will be interesting 
 to see if we plan to support this in C3.  But this would work in C2.2 as I've 
 used inputmodules quite a lot.

 Robby


 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Wednesday, November 14, 2012 4:09 PM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 I am using 3.0.0-beta-1-SNAPSHOT built from trunk. Here's my sitemap:

  map:pipeline
   map:match pattern=article/{id}.xml
 map:generate 
 src={global:base.repo.path}/articles/{map:id}/index.xml /
 map:transform type=xinclude 
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl
 value={global:base.repo.path}/articles/{map:id}/ /
 /map:transform
 !-- map:transform src=sheets/html/xslthl.xsl  / --
 map:serialize type=xml  /
 /map:match

 Here's part

Re: XInclude in sitemap.xmap

2012-11-14 Thread Mansour Al Akeel
One additional problem. This is not related to the property
resolution, but to the XInclude. After I process xinclude, if I apply
another transformation, I get an error:
Caused by: org.xml.sax.SAXException: Namespace for prefix 'xi' not
found.
at 
org.apache.cocoon.sax.AbstractSAXTransformer.endPrefixMapping(AbstractSAXTransformer.java:79)
~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.sax.component.XIncludeTransformer.endPrefixMapping(XIncludeTransformer.java:515)
~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]


The transformation can be any thing simple. Identity transformation
will cause this issue as well. Here's the transformation I am applying
after the xinclude:

?xml version=1.0 encoding=utf-8?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:xi=http://www.w3.org/2001/XInclude;
  xsl:template match=@*|node()
xsl:copy
  xsl:apply-templates select=@*|node()/
/xsl:copy
  /xsl:template
/xsl:stylesheet


And here is the sitemap:

map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl
value=file:///home/mansour/workspace/pipelines/repo/articles/example/
/
/map:transform
map:transform src=sheets/html/identity.xsl  /
map:serialize type=xml  /
/map:match


If I remove the identity.xsl step, then things works fine.
I am not sure how to solve this issue, but I think I can use two
match one for each step. However, knowing that cocoon applies xslt
in a pipeline without additional tweaks, should allow me to directly
process the stream with identity.xsl.

Thank you.

On Wed, Nov 14, 2012 at 7:39 PM, Mansour Al Akeel
mansour.alak...@gmail.com wrote:
 Robby, thank you for taking care of this issue.



 On Wed, Nov 14, 2012 at 12:11 PM, Robby Pelssers robby.pelss...@nxp.com 
 wrote:
 I'm closing in on finding the issue but not sure if I can fix it this week.

 Test 1:  Use {global:propertyName} in @src of a generator works fine
 -

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/{global:testProperty}.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 /map:transform
 map:serialize type=xml /
   /map:match

 Test2: Use {global:propertyName} in the @value of a parameter does not seem 
 to work
 
   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value={global:testProperty}/
 /map:transform
 map:serialize type=xml /
   /map:match


 The real magic happens in org.apache.cocoon.sitemap.InvocationImpl

 public Object resolveParameter(final String parameter) {

 }

 But I think that method is not called for evaluating @value of a 
 map:parameter.

 If anyone can fix this today.. be my guest.  Otherwise I will take another 
 look this week (latest this weekend).

 Robby

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Wednesday, November 14, 2012 5:38 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 The solution you're looking for resides in using a LanguageInterpreter.

 Cocoon already has a few implementations:
 - org.apache.cocoon.sitemap.expression.SettingsInterpreter  (works together 
 with cocoon-spring-configurator)
 - org.apache.cocoon.sitemap.expression.JexlLanguageInterpreter
 - org.apache.cocoon.sitemap.expression.SitemapLanguageInterpreter

 http://cocoon.apache.org/3.0/apidocs/index.html

 In cocoon-expression-language.xml these are configured as beans. You see 
 that the last part after the colon is the prefix you can use in a sitemap.  
 I think you should just use the SettingsInterpreter in your case.  It's the 
 default way to access properties.



 beans xmlns=http://www.springframework.org/schema/beans; 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd;

   bean 
 name=org.apache.cocoon.sitemap.expression.LanguageInterpreterFactory
 
 class=org.apache.cocoon.sitemap.expression.PrototypeLanguageInterpreterFactory
  /

   bean name=expression-language:map 
 class=org.apache.cocoon.sitemap.expression.SitemapLanguageInterpreter /

   bean name=expression-language:jexl 
 class

Re: XInclude in sitemap.xmap

2012-11-13 Thread Mansour Al Akeel
I can not include all my files, but here's the relevant parts:


map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value=false/
map:parameter name=baseUrl
value=file://{global:base.repo.path}/articles/{map:id}/ /
/map:transform
!-- map:transform src=sheets/html/xslthl.xsl  / --
map:serialize type=xml  /
/map:match

In my xml file:

programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting


In the log I am getting this:

12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
Going to link the component XMLGenerator(hashCode=1295514377
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipeline
s/repo/articles/example/index.xml)) with
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
Going to link the component XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
wi
th XMLSerializer(hashCode=1413585408).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline -
Creating CompoundCacheKey(hashCode=518365495 key=[]):
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline -
~ adding TimestampCacheKey(hashCode=1975202233
url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
timestamp=1352808707000 (2012-11-
13 12:11:47.0)) for component XMLGenerator(hashCode=1295514377
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline -
~ adding CachedCacheKey(hashCode=1855990413
internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false)
cachedCacheKey=URLListCacheKey(hashCode=13584830
78 urls=[TimestampCacheKey(hashCode=334463211
url=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/hello.c
timestamp=0 (1970-01-01 00:00:00.0))])) for component
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline -
~ adding ParameterCacheKey(hashCode=1430898616
parameters={encoding=UTF-8, method=xml}) for component
XMLSerializer(hashCode=1413585408)
12:11:57.040 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline -
Creating  CompoundCacheKey(hashCode=518365495
key=[TimestampCacheKey(hashCode=1975202233
url=file:/home/mansour/workspace/pipelines/repo/articles/example/ind
ex.xml timestamp=1352808707000 (2012-11-13 12:11:47.0)),
CachedCacheKey(hashCode=1855990413
internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false)
cachedCacheKey=URLListCacheKey(hashCode=1358483078
urls=[TimestampCache
Key(hashCode=334463211
url=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/hello.c
timestamp=0 (1970-01-01 00:00:00.0))])),
ParameterCacheKey(hashCode=1430898616 parameters={encoding=UTF-8,
method=xm
l})]) for pipeline CachingPipeline(hashCode=839414089
components=[XMLGenerator(hashCode=1295514377
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xm
l)), XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/),
XMLSerializer(hashCode=1413585408)])
12:11:57.040 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline -
Used cache: SimpleCache(hashCode=1672230800)
12:11:57.040 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline -
No cache value available for CompoundCacheKey(hashCode=518365495
key=[TimestampCacheKey(hashCode=1975202233
url=file:/home/mansour/workspace/pipelines/repo/a
rticles/example/index.xml timestamp=1352808707000 (2012-11-13
12:11:47.0)), CachedCacheKey(hashCode=1855990413
internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false)
cachedCacheKey=URLListCacheKey(hashCode=1358483078 u
rls=[TimestampCacheKey(hashCode=334463211
url=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/hello.c
timestamp=0 (1970-01-01 00:00:00.0))])),
ParameterCacheKey(hashCode=1430898616 parameters={encodi
ng=UTF-8, method=xml})])
12:11:57.040 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
Invoking first component of CachingPipeline(hashCode=839414089
components=[XMLGenerator(hashCode=1295514377
internalGenerator=URLGenerator(hashCode=12125166
80 
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml)),
XIncludeTransformer(hashCode=373437306

RE: XInclude in sitemap.xmap

2012-11-13 Thread Robby Pelssers
I'm debugging your issue and so far I'm pretty bedazzled about what the hell is 
going on:

  map:match equals=aggregation/xinclude-transformer
map:generate src=aggregation/xinclude.xml /
map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl value=file:///c:/tmp//
map:parameter name=test value=hello world/
/map:transform
map:serialize type=xml /
  /map:match

While debugging I see following Configuration - MapString, Object

baseUrl=file:/C:/workspaces/apache/cocoon/cocoon3/trunk/cocoon-sample/./src/main/resources/COB-INF/
cacheKey=aggregation/xinclude-transformer
test=hello world

Will keep you posted.. Maybe the baseUrl is somewhere overridden while setting 
up the pipeline? Anyone who can tell this?

Robby

-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] 
Sent: Tuesday, November 13, 2012 1:19 PM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

I can not include all my files, but here's the relevant parts:


map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value=false/
map:parameter name=baseUrl
value=file://{global:base.repo.path}/articles/{map:id}/ /
/map:transform
!-- map:transform src=sheets/html/xslthl.xsl  / --
map:serialize type=xml  /
/map:match

In my xml file:

programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting


In the log I am getting this:

12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XMLGenerator(hashCode=1295514377 
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipeline
s/repo/articles/example/index.xml)) with
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
wi
th XMLSerializer(hashCode=1413585408).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating 
CompoundCacheKey(hashCode=518365495 key=[]):
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
TimestampCacheKey(hashCode=1975202233
url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
timestamp=1352808707000 (2012-11-
13 12:11:47.0)) for component XMLGenerator(hashCode=1295514377 
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
CachedCacheKey(hashCode=1855990413
internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false) 
cachedCacheKey=URLListCacheKey(hashCode=13584830
78 urls=[TimestampCacheKey(hashCode=334463211
url=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/hello.c
timestamp=0 (1970-01-01 00:00:00.0))])) for component
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
ParameterCacheKey(hashCode=1430898616
parameters={encoding=UTF-8, method=xml}) for component
XMLSerializer(hashCode=1413585408)
12:11:57.040 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating  
CompoundCacheKey(hashCode=518365495
key=[TimestampCacheKey(hashCode=1975202233
url=file:/home/mansour/workspace/pipelines/repo/articles/example/ind
ex.xml timestamp=1352808707000 (2012-11-13 12:11:47.0)),
CachedCacheKey(hashCode=1855990413
internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false)
cachedCacheKey=URLListCacheKey(hashCode=1358483078
urls=[TimestampCache
Key(hashCode=334463211
url=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/hello.c
timestamp=0 (1970-01-01 00:00:00.0))])),
ParameterCacheKey(hashCode=1430898616 parameters={encoding=UTF-8, method=xm
l})]) for pipeline CachingPipeline(hashCode=839414089
components=[XMLGenerator(hashCode=1295514377
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xm
l)), XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/),
XMLSerializer(hashCode=1413585408)])
12:11:57.040 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Used 
cache: SimpleCache(hashCode=1672230800) 12:11:57.040 [btpool0-1] DEBUG

RE: XInclude in sitemap.xmap

2012-11-13 Thread Robby Pelssers
Ok... I found the problem.

Inside org.apache.cocoon.sitemap.node.AbstractSitemapNode the baseUrl is 
overridden, although it correctly receives the baseUrl.

invocationParams = {
baseUrl=file:///c:/tmp/
cacheKey={map:0}
test=hello world
}


protected InvocationResult invoke(final String src, final String type,  final 
Invocation invocation) {


// set the baseUrl  PROBLEMATIC PART
invocationParams.put(baseUrl, invocation.resolve());

}


But before starting making changes... this might need careful attention.

Robby


-Original Message-
From: Robby Pelssers [mailto:robby.pelss...@nxp.com] 
Sent: Tuesday, November 13, 2012 2:32 PM
To: users@cocoon.apache.org
Subject: RE: XInclude in sitemap.xmap

I'm debugging your issue and so far I'm pretty bedazzled about what the hell is 
going on:

  map:match equals=aggregation/xinclude-transformer
map:generate src=aggregation/xinclude.xml /
map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl value=file:///c:/tmp//
map:parameter name=test value=hello world/
/map:transform
map:serialize type=xml /
  /map:match

While debugging I see following Configuration - MapString, Object

baseUrl=file:/C:/workspaces/apache/cocoon/cocoon3/trunk/cocoon-sample/./src/main/resources/COB-INF/
cacheKey=aggregation/xinclude-transformer
test=hello world

Will keep you posted.. Maybe the baseUrl is somewhere overridden while setting 
up the pipeline? Anyone who can tell this?

Robby

-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
Sent: Tuesday, November 13, 2012 1:19 PM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

I can not include all my files, but here's the relevant parts:


map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value=false/
map:parameter name=baseUrl
value=file://{global:base.repo.path}/articles/{map:id}/ /
/map:transform
!-- map:transform src=sheets/html/xslthl.xsl  / --
map:serialize type=xml  /
/map:match

In my xml file:

programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting


In the log I am getting this:

12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XMLGenerator(hashCode=1295514377 
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipeline
s/repo/articles/example/index.xml)) with
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
wi
th XMLSerializer(hashCode=1413585408).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating 
CompoundCacheKey(hashCode=518365495 key=[]):
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
TimestampCacheKey(hashCode=1975202233
url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
timestamp=1352808707000 (2012-11-
13 12:11:47.0)) for component XMLGenerator(hashCode=1295514377 
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
CachedCacheKey(hashCode=1855990413
internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false) 
cachedCacheKey=URLListCacheKey(hashCode=13584830
78 urls=[TimestampCacheKey(hashCode=334463211
url=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/hello.c
timestamp=0 (1970-01-01 00:00:00.0))])) for component
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
ParameterCacheKey(hashCode=1430898616
parameters={encoding=UTF-8, method=xml}) for component
XMLSerializer(hashCode=1413585408)
12:11:57.040 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating  
CompoundCacheKey(hashCode=518365495
key=[TimestampCacheKey(hashCode=1975202233
url=file:/home/mansour/workspace/pipelines/repo/articles/example/ind
ex.xml timestamp=1352808707000 (2012-11-13 12:11:47.0)),
CachedCacheKey(hashCode=1855990413
internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false)
cachedCacheKey=URLListCacheKey(hashCode=1358483078
urls=[TimestampCache
Key(hashCode=334463211
url=file:/home

RE: XInclude in sitemap.xmap

2012-11-13 Thread Robby Pelssers
I made a little change to that class and will check if that resolves the issue:

// set the baseUrl
if (!invocationParams.containsKey(baseUrl)) {
invocationParams.put(baseUrl, invocation.resolve());
}
Will let you know once tested.

Robby

-Original Message-
From: Robby Pelssers [mailto:robby.pelss...@nxp.com] 
Sent: Tuesday, November 13, 2012 2:49 PM
To: users@cocoon.apache.org
Subject: RE: XInclude in sitemap.xmap

Ok... I found the problem.

Inside org.apache.cocoon.sitemap.node.AbstractSitemapNode the baseUrl is 
overridden, although it correctly receives the baseUrl.

invocationParams = {
baseUrl=file:///c:/tmp/
cacheKey={map:0}
test=hello world
}


protected InvocationResult invoke(final String src, final String type,  final 
Invocation invocation) {


// set the baseUrl  PROBLEMATIC PART
invocationParams.put(baseUrl, invocation.resolve());

}


But before starting making changes... this might need careful attention.

Robby


-Original Message-
From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
Sent: Tuesday, November 13, 2012 2:32 PM
To: users@cocoon.apache.org
Subject: RE: XInclude in sitemap.xmap

I'm debugging your issue and so far I'm pretty bedazzled about what the hell is 
going on:

  map:match equals=aggregation/xinclude-transformer
map:generate src=aggregation/xinclude.xml /
map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl value=file:///c:/tmp//
map:parameter name=test value=hello world/
/map:transform
map:serialize type=xml /
  /map:match

While debugging I see following Configuration - MapString, Object

baseUrl=file:/C:/workspaces/apache/cocoon/cocoon3/trunk/cocoon-sample/./src/main/resources/COB-INF/
cacheKey=aggregation/xinclude-transformer
test=hello world

Will keep you posted.. Maybe the baseUrl is somewhere overridden while setting 
up the pipeline? Anyone who can tell this?

Robby

-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
Sent: Tuesday, November 13, 2012 1:19 PM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

I can not include all my files, but here's the relevant parts:


map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value=false/
map:parameter name=baseUrl
value=file://{global:base.repo.path}/articles/{map:id}/ /
/map:transform
!-- map:transform src=sheets/html/xslthl.xsl  / --
map:serialize type=xml  /
/map:match

In my xml file:

programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting


In the log I am getting this:

12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XMLGenerator(hashCode=1295514377 
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipeline
s/repo/articles/example/index.xml)) with
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
wi
th XMLSerializer(hashCode=1413585408).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating 
CompoundCacheKey(hashCode=518365495 key=[]):
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
TimestampCacheKey(hashCode=1975202233
url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
timestamp=1352808707000 (2012-11-
13 12:11:47.0)) for component XMLGenerator(hashCode=1295514377 
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
CachedCacheKey(hashCode=1855990413
internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false) 
cachedCacheKey=URLListCacheKey(hashCode=13584830
78 urls=[TimestampCacheKey(hashCode=334463211
url=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/hello.c
timestamp=0 (1970-01-01 00:00:00.0))])) for component
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
ParameterCacheKey(hashCode=1430898616
parameters={encoding=UTF-8, method=xml}) for component
XMLSerializer(hashCode=1413585408)
12:11:57.040 [btpool0-1

Re: XInclude in sitemap.xmap

2012-11-13 Thread Mansour Al Akeel
Robby,
thank you a lot for helping in this, in a timely manner.
My recommendation is to use an instance of unmodifiable collections to
hold configurations and prevent over writing them.
We can either use a method that ensures configurations is not over
written, and put this method in the top level class (ie,
AbstractTransformer .. etc.).
Or just use the read only collections. Here's an example
http://javarevisited.blogspot.ca/2012/07/create-read-only-list-map-set-example-java.html

This may solve potential problems with other invocations.


On Tue, Nov 13, 2012 at 8:54 AM, Robby Pelssers robby.pelss...@nxp.com wrote:
 I made a little change to that class and will check if that resolves the 
 issue:

 // set the baseUrl
 if (!invocationParams.containsKey(baseUrl)) {
 invocationParams.put(baseUrl, invocation.resolve());
 }
 Will let you know once tested.

 Robby

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Tuesday, November 13, 2012 2:49 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 Ok... I found the problem.

 Inside org.apache.cocoon.sitemap.node.AbstractSitemapNode the baseUrl is 
 overridden, although it correctly receives the baseUrl.

 invocationParams = {
 baseUrl=file:///c:/tmp/
 cacheKey={map:0}
 test=hello world
 }


 protected InvocationResult invoke(final String src, final String type,  final 
 Invocation invocation) {

 
 // set the baseUrl  PROBLEMATIC PART
 invocationParams.put(baseUrl, invocation.resolve());

 }


 But before starting making changes... this might need careful attention.

 Robby


 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Tuesday, November 13, 2012 2:32 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 I'm debugging your issue and so far I'm pretty bedazzled about what the hell 
 is going on:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value=file:///c:/tmp//
 map:parameter name=test value=hello world/
 /map:transform
 map:serialize type=xml /
   /map:match

 While debugging I see following Configuration - MapString, Object

 baseUrl=file:/C:/workspaces/apache/cocoon/cocoon3/trunk/cocoon-sample/./src/main/resources/COB-INF/
 cacheKey=aggregation/xinclude-transformer
 test=hello world

 Will keep you posted.. Maybe the baseUrl is somewhere overridden while 
 setting up the pipeline? Anyone who can tell this?

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Tuesday, November 13, 2012 1:19 PM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 I can not include all my files, but here's the relevant parts:


 map:match pattern=article/{id}.xml
 map:generate 
 src={global:base.repo.path}/articles/{map:id}/index.xml /
 map:transform type=xinclude 
 map:parameter name=cacheKey value=false/
 map:parameter name=baseUrl
 value=file://{global:base.repo.path}/articles/{map:id}/ /
 /map:transform
 !-- map:transform src=sheets/html/xslthl.xsl  / --
 map:serialize type=xml  /
 /map:match

 In my xml file:

 programlisting language=c
 xi:include  href=hello.c  parse=text
 xmlns:xi=http://www.w3.org/2001/XInclude/
 /programlisting


 In the log I am getting this:

 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going 
 to link the component XMLGenerator(hashCode=1295514377 
 internalGenerator=URLGenerator(hashCode=1212516680
 source=file:/home/mansour/workspace/pipeline
 s/repo/articles/example/index.xml)) with
 XIncludeTransformer(hashCode=373437306
 baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/).
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going 
 to link the component XIncludeTransformer(hashCode=373437306
 baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
 wi
 th XMLSerializer(hashCode=1413585408).
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating 
 CompoundCacheKey(hashCode=518365495 key=[]):
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
 TimestampCacheKey(hashCode=1975202233
 url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
 timestamp=1352808707000 (2012-11-
 13 12:11:47.0)) for component XMLGenerator(hashCode=1295514377 
 internalGenerator=URLGenerator(hashCode=1212516680
 source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
 12:11:57.039 [btpool0-1] DEBUG

RE: XInclude in sitemap.xmap

2012-11-13 Thread Robby Pelssers
I still need to commit the fix... will let you know once done.

Robby

-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com] 
Sent: Tuesday, November 13, 2012 3:51 PM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

Robby,
thank you a lot for helping in this, in a timely manner.
My recommendation is to use an instance of unmodifiable collections to hold 
configurations and prevent over writing them.
We can either use a method that ensures configurations is not over written, and 
put this method in the top level class (ie, AbstractTransformer .. etc.).
Or just use the read only collections. Here's an example 
http://javarevisited.blogspot.ca/2012/07/create-read-only-list-map-set-example-java.html

This may solve potential problems with other invocations.


On Tue, Nov 13, 2012 at 8:54 AM, Robby Pelssers robby.pelss...@nxp.com wrote:
 I made a little change to that class and will check if that resolves the 
 issue:

 // set the baseUrl
 if (!invocationParams.containsKey(baseUrl)) {
 invocationParams.put(baseUrl, invocation.resolve());
 }
 Will let you know once tested.

 Robby

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Tuesday, November 13, 2012 2:49 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 Ok... I found the problem.

 Inside org.apache.cocoon.sitemap.node.AbstractSitemapNode the baseUrl is 
 overridden, although it correctly receives the baseUrl.

 invocationParams = {
 baseUrl=file:///c:/tmp/
 cacheKey={map:0}
 test=hello world
 }


 protected InvocationResult invoke(final String src, final String type,  
 final Invocation invocation) {

 
 // set the baseUrl  PROBLEMATIC PART
 invocationParams.put(baseUrl, invocation.resolve());

 }


 But before starting making changes... this might need careful attention.

 Robby


 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Tuesday, November 13, 2012 2:32 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 I'm debugging your issue and so far I'm pretty bedazzled about what the hell 
 is going on:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value=file:///c:/tmp//
 map:parameter name=test value=hello world/
 /map:transform
 map:serialize type=xml /
   /map:match

 While debugging I see following Configuration - MapString, Object

 baseUrl=file:/C:/workspaces/apache/cocoon/cocoon3/trunk/cocoon-sample/
 ./src/main/resources/COB-INF/ 
 cacheKey=aggregation/xinclude-transformer
 test=hello world

 Will keep you posted.. Maybe the baseUrl is somewhere overridden while 
 setting up the pipeline? Anyone who can tell this?

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Tuesday, November 13, 2012 1:19 PM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 I can not include all my files, but here's the relevant parts:


 map:match pattern=article/{id}.xml
 map:generate 
 src={global:base.repo.path}/articles/{map:id}/index.xml /
 map:transform type=xinclude 
 map:parameter name=cacheKey value=false/
 map:parameter name=baseUrl
 value=file://{global:base.repo.path}/articles/{map:id}/ /
 /map:transform
 !-- map:transform src=sheets/html/xslthl.xsl  / --
 map:serialize type=xml  /
 /map:match

 In my xml file:

 programlisting language=c
 xi:include  href=hello.c  parse=text
 xmlns:xi=http://www.w3.org/2001/XInclude/
 /programlisting


 In the log I am getting this:

 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - 
 Going to link the component XMLGenerator(hashCode=1295514377 
 internalGenerator=URLGenerator(hashCode=1212516680
 source=file:/home/mansour/workspace/pipeline
 s/repo/articles/example/index.xml)) with
 XIncludeTransformer(hashCode=373437306
 baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/).
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - 
 Going to link the component XIncludeTransformer(hashCode=373437306
 baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/res
 ources/COB-INF/)
 wi
 th XMLSerializer(hashCode=1413585408).
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating 
 CompoundCacheKey(hashCode=518365495 key=[]):
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ 
 adding TimestampCacheKey(hashCode=1975202233
 url=file:/home/mansour/workspace/pipelines/repo/articles/example/index
 .xml
 timestamp

RE: XInclude in sitemap.xmap

2012-11-13 Thread Robby Pelssers
Ok..

I fixed the issue:

  map:match equals=aggregation/xinclude-transformer
map:generate src=aggregation/xinclude.xml /
map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl value=file:///c:/tmp//
map:parameter name=test value=hello world/
/map:transform
map:serialize type=xml /
  /map:match

Works now.

I committed the fix to Cocoon3 trunk.

Robby

-Original Message-
From: Robby Pelssers [mailto:robby.pelss...@nxp.com] 
Sent: Tuesday, November 13, 2012 2:49 PM
To: users@cocoon.apache.org
Subject: RE: XInclude in sitemap.xmap

Ok... I found the problem.

Inside org.apache.cocoon.sitemap.node.AbstractSitemapNode the baseUrl is 
overridden, although it correctly receives the baseUrl.

invocationParams = {
baseUrl=file:///c:/tmp/
cacheKey={map:0}
test=hello world
}


protected InvocationResult invoke(final String src, final String type,  final 
Invocation invocation) {


// set the baseUrl  PROBLEMATIC PART
invocationParams.put(baseUrl, invocation.resolve());

}


But before starting making changes... this might need careful attention.

Robby


-Original Message-
From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
Sent: Tuesday, November 13, 2012 2:32 PM
To: users@cocoon.apache.org
Subject: RE: XInclude in sitemap.xmap

I'm debugging your issue and so far I'm pretty bedazzled about what the hell is 
going on:

  map:match equals=aggregation/xinclude-transformer
map:generate src=aggregation/xinclude.xml /
map:transform type=xinclude
map:parameter name=cacheKey value={map:0}/
map:parameter name=baseUrl value=file:///c:/tmp//
map:parameter name=test value=hello world/
/map:transform
map:serialize type=xml /
  /map:match

While debugging I see following Configuration - MapString, Object

baseUrl=file:/C:/workspaces/apache/cocoon/cocoon3/trunk/cocoon-sample/./src/main/resources/COB-INF/
cacheKey=aggregation/xinclude-transformer
test=hello world

Will keep you posted.. Maybe the baseUrl is somewhere overridden while setting 
up the pipeline? Anyone who can tell this?

Robby

-Original Message-
From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
Sent: Tuesday, November 13, 2012 1:19 PM
To: users@cocoon.apache.org
Subject: Re: XInclude in sitemap.xmap

I can not include all my files, but here's the relevant parts:


map:match pattern=article/{id}.xml
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude 
map:parameter name=cacheKey value=false/
map:parameter name=baseUrl
value=file://{global:base.repo.path}/articles/{map:id}/ /
/map:transform
!-- map:transform src=sheets/html/xslthl.xsl  / --
map:serialize type=xml  /
/map:match

In my xml file:

programlisting language=c
xi:include  href=hello.c  parse=text
xmlns:xi=http://www.w3.org/2001/XInclude/
/programlisting


In the log I am getting this:

12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XMLGenerator(hashCode=1295514377 
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipeline
s/repo/articles/example/index.xml)) with
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going to 
link the component XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
wi
th XMLSerializer(hashCode=1413585408).
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating 
CompoundCacheKey(hashCode=518365495 key=[]):
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
TimestampCacheKey(hashCode=1975202233
url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
timestamp=1352808707000 (2012-11-
13 12:11:47.0)) for component XMLGenerator(hashCode=1295514377 
internalGenerator=URLGenerator(hashCode=1212516680
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
CachedCacheKey(hashCode=1855990413
internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false) 
cachedCacheKey=URLListCacheKey(hashCode=13584830
78 urls=[TimestampCacheKey(hashCode=334463211
url=file:/home/mansour/workspace/pipelines/contents/src/main/resources/COB-INF/hello.c
timestamp=0 (1970-01-01 00:00:00.0))])) for component
XIncludeTransformer(hashCode=373437306
baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
12:11:57.039 [btpool0-1] DEBUG

Re: XInclude in sitemap.xmap

2012-11-13 Thread Francesco Chicchiriccò
On 13/11/2012 16:33, Robby Pelssers wrote:
 Ok..

 I fixed the issue:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value=file:///c:/tmp//
 map:parameter name=test value=hello world/
 /map:transform
 map:serialize type=xml /
   /map:match

 Works now.

 I committed the fix to Cocoon3 trunk.

Hi Robby,
thank you for taking care of this: just tested your fix and the build
runs fine.

For records, could you please file an issue on JIRA (COCOON3), add your
fix revision number as comment and then close it?
Thanks.

Regards.

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com] 
 Sent: Tuesday, November 13, 2012 2:49 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 Ok... I found the problem.

 Inside org.apache.cocoon.sitemap.node.AbstractSitemapNode the baseUrl is 
 overridden, although it correctly receives the baseUrl.

 invocationParams = {
 baseUrl=file:///c:/tmp/
 cacheKey={map:0}
 test=hello world
 }


 protected InvocationResult invoke(final String src, final String type,  final 
 Invocation invocation) {

 
 // set the baseUrl  PROBLEMATIC PART
 invocationParams.put(baseUrl, invocation.resolve());

 }


 But before starting making changes... this might need careful attention.

 Robby


 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Tuesday, November 13, 2012 2:32 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 I'm debugging your issue and so far I'm pretty bedazzled about what the hell 
 is going on:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value=file:///c:/tmp//
 map:parameter name=test value=hello world/
 /map:transform
 map:serialize type=xml /
   /map:match

 While debugging I see following Configuration - MapString, Object

 baseUrl=file:/C:/workspaces/apache/cocoon/cocoon3/trunk/cocoon-sample/./src/main/resources/COB-INF/
 cacheKey=aggregation/xinclude-transformer
 test=hello world

 Will keep you posted.. Maybe the baseUrl is somewhere overridden while 
 setting up the pipeline? Anyone who can tell this?

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Tuesday, November 13, 2012 1:19 PM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 I can not include all my files, but here's the relevant parts:


 map:match pattern=article/{id}.xml
   map:generate 
 src={global:base.repo.path}/articles/{map:id}/index.xml /
   map:transform type=xinclude 
   map:parameter name=cacheKey value=false/
   map:parameter name=baseUrl
 value=file://{global:base.repo.path}/articles/{map:id}/ /
   /map:transform
   !-- map:transform src=sheets/html/xslthl.xsl  / --
   map:serialize type=xml  /
 /map:match

 In my xml file:

   programlisting language=c
   xi:include  href=hello.c  parse=text
 xmlns:xi=http://www.w3.org/2001/XInclude/
   /programlisting


 In the log I am getting this:

 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going 
 to link the component XMLGenerator(hashCode=1295514377 
 internalGenerator=URLGenerator(hashCode=1212516680
 source=file:/home/mansour/workspace/pipeline
 s/repo/articles/example/index.xml)) with
 XIncludeTransformer(hashCode=373437306
 baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/).
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline - Going 
 to link the component XIncludeTransformer(hashCode=373437306
 baseUrl=file:/home/mansour/workspace/pipelines/contents/./src/main/resources/COB-INF/)
 wi
 th XMLSerializer(hashCode=1413585408).
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - Creating 
 CompoundCacheKey(hashCode=518365495 key=[]):
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
 TimestampCacheKey(hashCode=1975202233
 url=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml
 timestamp=1352808707000 (2012-11-
 13 12:11:47.0)) for component XMLGenerator(hashCode=1295514377 
 internalGenerator=URLGenerator(hashCode=1212516680
 source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
 12:11:57.039 [btpool0-1] DEBUG o.a.cocoon.pipeline.CachingPipeline - ~ adding 
 CachedCacheKey(hashCode=1855990413
 internalCacheKey=ObjectCacheKey(hashCode=1421714705 obj=false) 
 cachedCacheKey=URLListCacheKey(hashCode

Re: XInclude in sitemap.xmap

2012-11-13 Thread Mansour Al Akeel
Thank you both for helping.
Robby,
this is the message I am getting now.
05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
Adding component XMLSerializer(hashCode=306853147) to pipeline
[CachingPipeline(hashCode=1346781896
components=[XMLGenerator(hashCode=1918414275
internalGenerator=URLGenerator(hashCode=1966798757
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml)),
XIncludeTransformer(hashCode=950275600
baseUrl=file:/{global:base.repo.path}/articles/{map:id}/)])].
05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
Going to link the component XMLGenerator(hashCode=1918414275
internalGenerator=URLGenerator(hashCode=1966798757
source=file:/home/mansour/workspace/pipelines/repo/articles/example/index.xml))
with XIncludeTransformer(hashCode=950275600
baseUrl=file:/{global:base.repo.path}/articles/{map:id}/).
05:35:08.304 [btpool0-1] DEBUG o.a.cocoon.pipeline.AbstractPipeline -
Going to link the component XIncludeTransformer(hashCode=950275600
baseUrl=file:/{global:base.repo.path}/articles/{map:id}/) with
XMLSerializer(hashCode=306853147).

It looks like the baseUrl is not being resolved with the input
modules. For example:

baseUrl=file:/{global:base.repo.path}/articles/{map:id}/

Your efforts is highly appreciated.
Thank you.


On Tue, Nov 13, 2012 at 10:43 AM, Francesco Chicchiriccò
ilgro...@apache.org wrote:
 On 13/11/2012 16:33, Robby Pelssers wrote:
 Ok..

 I fixed the issue:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value=file:///c:/tmp//
 map:parameter name=test value=hello world/
 /map:transform
 map:serialize type=xml /
   /map:match

 Works now.

 I committed the fix to Cocoon3 trunk.

 Hi Robby,
 thank you for taking care of this: just tested your fix and the build
 runs fine.

 For records, could you please file an issue on JIRA (COCOON3), add your
 fix revision number as comment and then close it?
 Thanks.

 Regards.

 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Tuesday, November 13, 2012 2:49 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 Ok... I found the problem.

 Inside org.apache.cocoon.sitemap.node.AbstractSitemapNode the baseUrl is 
 overridden, although it correctly receives the baseUrl.

 invocationParams = {
 baseUrl=file:///c:/tmp/
 cacheKey={map:0}
 test=hello world
 }


 protected InvocationResult invoke(final String src, final String type,  
 final Invocation invocation) {

 
 // set the baseUrl  PROBLEMATIC PART
 invocationParams.put(baseUrl, invocation.resolve());

 }


 But before starting making changes... this might need careful attention.

 Robby


 -Original Message-
 From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
 Sent: Tuesday, November 13, 2012 2:32 PM
 To: users@cocoon.apache.org
 Subject: RE: XInclude in sitemap.xmap

 I'm debugging your issue and so far I'm pretty bedazzled about what the hell 
 is going on:

   map:match equals=aggregation/xinclude-transformer
 map:generate src=aggregation/xinclude.xml /
 map:transform type=xinclude
 map:parameter name=cacheKey value={map:0}/
 map:parameter name=baseUrl value=file:///c:/tmp//
 map:parameter name=test value=hello world/
 /map:transform
 map:serialize type=xml /
   /map:match

 While debugging I see following Configuration - MapString, Object

 baseUrl=file:/C:/workspaces/apache/cocoon/cocoon3/trunk/cocoon-sample/./src/main/resources/COB-INF/
 cacheKey=aggregation/xinclude-transformer
 test=hello world

 Will keep you posted.. Maybe the baseUrl is somewhere overridden while 
 setting up the pipeline? Anyone who can tell this?

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Tuesday, November 13, 2012 1:19 PM
 To: users@cocoon.apache.org
 Subject: Re: XInclude in sitemap.xmap

 I can not include all my files, but here's the relevant parts:


 map:match pattern=article/{id}.xml
   map:generate 
 src={global:base.repo.path}/articles/{map:id}/index.xml /
   map:transform type=xinclude 
   map:parameter name=cacheKey value=false/
   map:parameter name=baseUrl
 value=file://{global:base.repo.path}/articles/{map:id}/ /
   /map:transform
   !-- map:transform src=sheets/html/xslthl.xsl  / --
   map:serialize type=xml  /
 /map:match

 In my xml file:

   programlisting language=c
   xi:include  href=hello.c  parse=text
 xmlns:xi=http://www.w3.org/2001/XInclude/
   /programlisting


 In the log I am getting this:

 12:11:57.039 [btpool0-1] DEBUG

Re: XInclude in sitemap.xmap

2012-11-12 Thread Mansour Al Akeel
I am doing two project.
A personal one with C3.0, and one for a product, and using C2.2.
This issue is happening with C3.0.

I didn't get a chance to test the files you sent me.

However, from the logs (which are really hard to read), it looks like
I am having issues with the baseUrl.
I looked into the source, and tried to set
baseUrl=full-path-to-my-repo, but that didn't work either.

Would be nice to see a document describing the attributes to be set on
each transformer.
A clear error message can be a lot of help as well.

Thank you.


On Mon, Nov 12, 2012 at 2:23 AM, Francesco Chicchiriccò
ilgro...@apache.org wrote:
 On 12/11/2012 07:59, Mansour Al Akeel wrote:
 Here's what I am doing:

  map:match pattern=article/{id}
   map:generate 
 src={global:base.repo.path}/articles/{map:id}/index.xml /
   map:transform type=xinclude /
   map:serialize type=xhtml  /

 and this is error:
 [...]

 Hi,
 did you take a look at sample sitemap.xmap [1] (around line 387) and
 specifically xinclude.xml [2]?

 BTW: which version are you running? From the reported stacktrace I
 understand C3, but some of your earlier questions were referring to C2.2

 Regards.

 [1]
 https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
 [2]
 https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/aggregation/xinclude.xml

 --
 Francesco Chicchiriccò

 ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
 http://people.apache.org/~ilgrosso/


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


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



Re: XInclude in sitemap.xmap

2012-11-12 Thread Francesco Chicchiriccò
On 13/11/2012 05:49, Mansour Al Akeel wrote:
 I am doing two project.
 A personal one with C3.0, and one for a product, and using C2.2.
 This issue is happening with C3.0.

 I didn't get a chance to test the files you sent me.

Ok, take a look there, then: using the XInclude transformer should be
pretty straightforward.

 However, from the logs (which are really hard to read), it looks like I am 
 having issues with the baseUrl.
 I looked into the source, and tried to set baseUrl=full-path-to-my-repo, 
 but that didn't work either.

Again, please take a look at [1] and [2].

 Would be nice to see a document describing the attributes to be set on each 
 transformer.

XInclude transformer hasn't changed much since C2.1 [3] / C2.2 [4].

 A clear error message can be a lot of help as well.

Definitely: in your case, though, I suspect that something really
basic is getting wrong.

Please share your files if you'd like to get more in-depth help.

Regards.

 On Mon, Nov 12, 2012 at 2:23 AM, Francesco Chicchiriccò
 ilgro...@apache.org wrote:
 On 12/11/2012 07:59, Mansour Al Akeel wrote:
 Here's what I am doing:

  map:match pattern=article/{id}
   map:generate 
 src={global:base.repo.path}/articles/{map:id}/index.xml /
   map:transform type=xinclude /
   map:serialize type=xhtml  /

 and this is error:
 [...]
 Hi,
 did you take a look at sample sitemap.xmap [1] (around line 387) and
 specifically xinclude.xml [2]?

 BTW: which version are you running? From the reported stacktrace I
 understand C3, but some of your earlier questions were referring to C2.2

 Regards.

 [1] 
 https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
 [2] 
 https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/aggregation/xinclude.xml
[3] http://cocoon.apache.org/2.1/userdocs/xinclude-transformer.html
[4] http://cocoon.apache.org/2.2/core-modules/core/2.2/985_1_1.html

-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


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



Re: XInclude in sitemap.xmap

2012-11-11 Thread Mansour Al Akeel
Here's what I am doing:

 map:match pattern=article/{id}
map:generate 
src={global:base.repo.path}/articles/{map:id}/index.xml /
map:transform type=xinclude /
map:serialize type=xhtml  /

and this is error:

06:49:07.958 [btpool0-1] DEBUG o.a.c.jci.stores.MemoryResourceStore -
reading resource org/apache/cocoon/sitemap/InvocationImpl.class
06:49:07.959 [btpool0-1] ERROR o.a.cocoon.servlet.XMLSitemapServlet -
Cocoon can't process the request.
org.apache.cocoon.sitemap.InvocationException:
java.lang.NullPointerException
at 
org.apache.cocoon.sitemap.util.ExceptionHandler.getInvocationException(ExceptionHandler.java:39)
~[cocoon-sitemap-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.sitemap.node.PipelineNode.handleException(PipelineNode.java:103)
~[cocoon-sitemap-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.sitemap.node.PipelineNode.invoke(PipelineNode.java:73)
~[cocoon-sitemap-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:100)
~[cocoon-sitemap-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.sitemap.node.PipelinesNode.invoke(PipelinesNode.java:49)
~[cocoon-sitemap-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.sitemap.node.AbstractSitemapNode.invoke(AbstractSitemapNode.java:100)
~[cocoon-sitemap-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at org.apache.cocoon.sitemap.node.Sitemap.invoke(Sitemap.java:42)
~[cocoon-sitemap-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.servlet.RequestProcessor.invoke(RequestProcessor.java:245)
~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.servlet.RequestProcessor.sendSitemapResponse(RequestProcessor.java:313)
~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:92)
~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.servlet.XMLSitemapServlet.service(XMLSitemapServlet.java:49)
~[cocoon-servlet-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
[servlet-api-2.5-6.1.7.jar:6.1.7]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.7.0]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
~[na:1.7.0]



Caused by: java.lang.NullPointerException: null
at 
org.apache.cocoon.pipeline.caching.ObjectCacheKey.hashCode(ObjectCacheKey.java:53)
~[cocoon-pipeline-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at java.util.WeakHashMap.get(WeakHashMap.java:374) ~[na:1.7.0]
at 
org.apache.cocoon.pipeline.caching.SimpleCache.retrieve(SimpleCache.java:57)
~[cocoon-pipeline-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.pipeline.caching.AbstractCache.get(AbstractCache.java:46)
~[cocoon-pipeline-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.pipeline.caching.CachedCacheKey.setKey(CachedCacheKey.java:73)
~[cocoon-pipeline-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.sax.component.XIncludeTransformer.constructCacheKey(XIncludeTransformer.java:664)
~[cocoon-sax-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.pipeline.CachingPipeline.constructCacheKey(CachingPipeline.java:79)
~[cocoon-pipeline-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at 
org.apache.cocoon.pipeline.CachingPipeline.setup(CachingPipeline.java:203)
~[cocoon-pipeline-3.0.0-beta-1-SNAPSHOT.jar:3.0.0-beta-1-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.7.0]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
~[na:1.7.0]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.7.0]
at java.lang.reflect.Method.invoke(Method.java:601)
~[na:1.7.0]
at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
[spring-aop-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183


The samples has:

359  map:match equals=aggregation/xinclude-transformer
360 map:generate src=aggregation/xinclude.xml /
361 map:transform type=xinclude /
362 map:serialize type=xml /
363   /map:match

The file aggregation/xinclude.xml doesn't even exist, so I can not
test if this is working and compare it to mine.

Am I missing something ??


On Sun, Nov 11, 2012 at 10:21 PM, Mansour Al Akeel
mansour.alak...@gmail.com wrote:
 Is there a 

Re: XInclude in sitemap.xmap

2012-11-11 Thread Francesco Chicchiriccò
On 12/11/2012 07:59, Mansour Al Akeel wrote:
 Here's what I am doing:

  map:match pattern=article/{id}
   map:generate 
 src={global:base.repo.path}/articles/{map:id}/index.xml /
   map:transform type=xinclude /
   map:serialize type=xhtml  /

 and this is error:
 [...]

Hi,
did you take a look at sample sitemap.xmap [1] (around line 387) and
specifically xinclude.xml [2]?

BTW: which version are you running? From the reported stacktrace I
understand C3, but some of your earlier questions were referring to C2.2

Regards.

[1]
https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
[2]
https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/aggregation/xinclude.xml

-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


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