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