Re: Unable to transform to docbook

2012-11-13 Thread Francesco Chicchiriccò
On 11/11/2012 18:14, Mansour Al Akeel wrote:
 Ok Finally issue resolved.

I've opened COCOON3-109 for reporting this to the website - this is
quite a common use case, I'd say.

Regards.

 It looks like I am able to use docbook. Here's the steps to do so.

 There's a file 
 cocoon_source/cocoon/cocoon-sax/src/test/resources/META-INF/services/javax.xml.transform.TransformerFactory

 This file contains the value: 
 org.apache.xalan.xsltc.trax.TransformerFactoryImpl

 If you need to use the default xalan factory, then you need to change it to.

 org.apache.xalan.processor.TransformerFactoryImpl


 Now your unit tests should create Transformer Factory using the new
 value org.apache.xalan.processor.TransformerFactoryImpl

 If you need to do this in your block, then copy this file to
 META-INF/services in your block.

 This is a good an easy way to switch factories. I hope it helps
 someone else stuck with complex XSLTs like docbook-xsl.

 Thank you all.




 On Sun, Nov 11, 2012 at 10:43 AM, Mansour Al Akeel
 mansour.alak...@gmail.com wrote:
 After googling for sometime, I found this related issue:

 https://lists.oasis-open.org/archives/docbook-apps/201006/msg00162.html

 The suggested solution was to disable compiling xslt or use saxon:

 
 Well, XSLTC is known to have problems with really complex
 transformations like DocBook XSL stylesheets. If you are in Java
 environment it is recommended to use Saxon, you can also use Xalan
 (normal version, not compiled).
 

 AFAIK, C3.0 doesn't have saxon as an option, so I will have to disable
 xslt compilation.
 Is there a way to do so ??





 On Sun, Nov 11, 2012 at 1:28 AM, Mansour Al Akeel
 mansour.alak...@gmail.com wrote:
 Robby, here's the code I am using for my test case. Nothing fancy,
 just to be able to debug loading the xslt:


 @Test
 public void docbookTest() throws Exception {
 Cache cache = new SimpleCache();

 CachingPipelineSAXPipelineComponent pipeline = new
 CachingPipelineSAXPipelineComponent();
 pipeline.setCache(cache);

 pipeline.addComponent(new 
 XMLGenerator(getClass().getResource(
 /article.xml)));

 URL xsltURL = new
 URL(file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/docbook.xsl);

 XSLTTransformer xslt = new XSLTTransformer(xsltURL);

 pipeline.addComponent(xslt);

 pipeline.addComponent(XMLSerializer.createXMLSerializer());

 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 pipeline.setup(baos);
 pipeline.execute();

 }


 here's the error I am getting:


   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
 line 939: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
 line 1063: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
 line 1193: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
 line 1193: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
 line 1294: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/inline.xsl:
 line 1332: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
 line 283: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
 line 283: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
 line 353: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/glossary.xsl:
 line 353: Attribute 'href' outside of element.
   
 file:/home/mansour/workspace/sources/cocoon/cocoon-sax/src/test/resources/docbook-xsl/html/annotations.xsl:
 line 117: Attribute 'onClick' outside of element.
 ERROR:  'Cannot find external method
 'org.apache.xalan.lib.NodeInfo.systemId' (must be public).'
 FATAL ERROR:  'Could not compile stylesheet'
 javax.xml.transform.TransformerConfigurationException: Could not
 compile stylesheet
 at 
 org.apache.xalan.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:832)
 at 
 

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

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
 

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) 
 

Trouble with disable-output-escaping

2012-11-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

All,

I'm running Cocoon 2.1.11 on Oracle Java 1.6.0_26. I'm using the
default Xalan 2.7.1 XSLT processor.

All examples are roughly mocked-up from a much more complicated
configuration so I apologize if there are typos, etc. -- I hand-typed
this message with no copy/paste.

I have some text data wrapped-up in XML like this:

node
  subnode
There is lt;bgt;HTML textlt;/bgt; in here.
  /submode
/node

I'd like to spit-out that text as if it were HTML -- that is, without
escaping it on output. I would like to get this text output:

There is bHTML/b in here.

But instead I get this:

There is lt;bgt;HTML textlt;/bgt; in here.

Which, of course, is no surprise given no other instructions.

So I tried using disable-output-escaping, which seems uniquely-suited
for this purpose:

xsl:template match=subnode
  xsl:value-of select=. disable-output-escaping=yes /
/xsl:template

I observe no change in the output. The XSL file has definitely been
re-read from the disk (I made other changes so I could verify at least
that much), so that's not an issue.

Here's my (rough) configuration:

sitemap:
map:match pattern=foo.html
  map:generate src=source.xml /

  map:transform src=generate-cincludes-1.xsl /

  map:transform src=generate-cincludes-2.xsl /

  map:transform type=cinclude /

  !-- this is the XSL I'm working with: --
  map:transform src=the-transformer-in-question.xsl /

  map:transform type=cinclude label=content /

  map:transform type=i18n /
  map:transform src=strip-namespace.xsl /
  map:serialize type=xhtml /
/map:match

My template header:

xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:i18n=http://apache.org/cocoon/i18n/2.1;
xmlns:cinclude=http://apache.org/cocoon/include/1.0;
xmlns:java=http://xml.apache.org/xalan/java;
 
xsl:output method=html indent=yes /
...

My understanding is that Xalan itself does support
disable-output-escaping, and I can't see why Cocoon would interfere
with that.

Am I trying to use disable-output-escaping incorrectly? Do I need to
run Cocoon (or Xalan) in any special mode or with any particular
settings in order to enable disable-output-escaping?

Thanks,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCik6cACgkQ9CaO5/Lv0PAqZgCeIX65HKLVa6rEe6TnL65wEdoi
48gAmgJfBNT+082ehqg7DhduZtEg/4RV
=l8ul
-END PGP SIGNATURE-

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



RE: Trouble with disable-output-escaping

2012-11-13 Thread Robby Pelssers
Allright...

You should reminder this tip.  It will only work if you do this in the very 
last transformer right before calling the serializer.

You owe me a beer ;-)

Robby

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Tuesday, November 13, 2012 7:39 PM
To: users@cocoon.apache.org
Subject: Trouble with disable-output-escaping

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

All,

I'm running Cocoon 2.1.11 on Oracle Java 1.6.0_26. I'm using the default Xalan 
2.7.1 XSLT processor.

All examples are roughly mocked-up from a much more complicated configuration 
so I apologize if there are typos, etc. -- I hand-typed this message with no 
copy/paste.

I have some text data wrapped-up in XML like this:

node
  subnode
There is lt;bgt;HTML textlt;/bgt; in here.
  /submode
/node

I'd like to spit-out that text as if it were HTML -- that is, without escaping 
it on output. I would like to get this text output:

There is bHTML/b in here.

But instead I get this:

There is lt;bgt;HTML textlt;/bgt; in here.

Which, of course, is no surprise given no other instructions.

So I tried using disable-output-escaping, which seems uniquely-suited for this 
purpose:

xsl:template match=subnode
  xsl:value-of select=. disable-output-escaping=yes / /xsl:template

I observe no change in the output. The XSL file has definitely been re-read 
from the disk (I made other changes so I could verify at least that much), so 
that's not an issue.

Here's my (rough) configuration:

sitemap:
map:match pattern=foo.html
  map:generate src=source.xml /

  map:transform src=generate-cincludes-1.xsl /

  map:transform src=generate-cincludes-2.xsl /

  map:transform type=cinclude /

  !-- this is the XSL I'm working with: --
  map:transform src=the-transformer-in-question.xsl /

  map:transform type=cinclude label=content /

  map:transform type=i18n /
  map:transform src=strip-namespace.xsl /
  map:serialize type=xhtml /
/map:match

My template header:

xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:i18n=http://apache.org/cocoon/i18n/2.1;
xmlns:cinclude=http://apache.org/cocoon/include/1.0;
xmlns:java=http://xml.apache.org/xalan/java;
 
xsl:output method=html indent=yes / ...

My understanding is that Xalan itself does support disable-output-escaping, and 
I can't see why Cocoon would interfere with that.

Am I trying to use disable-output-escaping incorrectly? Do I need to run Cocoon 
(or Xalan) in any special mode or with any particular settings in order to 
enable disable-output-escaping?

Thanks,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCik6cACgkQ9CaO5/Lv0PAqZgCeIX65HKLVa6rEe6TnL65wEdoi
48gAmgJfBNT+082ehqg7DhduZtEg/4RV
=l8ul
-END PGP SIGNATURE-

-
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-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: accessing a spring bean methods from sitemap

2012-11-13 Thread Mansour Al Akeel
Thank you all for helping in this.
Thorsten,
I went with you suggestion and it worked great just like expected.


On Sun, Nov 11, 2012 at 3:24 PM, Robby Pelssers robby.pelss...@nxp.com wrote:
 Hi Mansour,

 I do know how to access spring beans from C2.2 flowscript if that is of any 
 help.

 Some sample code:

 function getTicket() {
 var authenticator = cocoon.getComponent(name_of_spring_bean); //this is 
 how you can get hold of a spring bean
 }

 But the main question is .. what are you trying to accomplish. It's not very 
 clear to me yet.  What is the end goal you are trying to accomplish? Maybe 
 you can do it purely in xslt.. just saying.

 Robby

 -Original Message-
 From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
 Sent: Saturday, November 10, 2012 6:38 PM
 To: users
 Subject: accessing a spring bean methods from sitemap

 I need to link documents through some identification. For example, assuming 
 that I have:

 articles/my-first-article.xml
 articles/second-one.xml
 articles/hello-world-article.xml

 books/book1.xml  which has  references to  artice-1 and article-3 identified 
 by an id of the form: A001

 I need to create a hashtable linking both so that I pass query param by ID or 
 by name. The idea I have is to initialize spring bean that will extract the 
 data from these files, and construct a MapString,String.

 My question is how can I access this HashTable from sitemap ??

 I am using C2.2.

 -
 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


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