You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Huib Verwey <Hu...@mpi.nl> on 2011/06/09 13:44:55 UTC

PS. Re: Cocoon 2.2, STX block, TraxTransformer, transformer-factory

It's still a bit shady to me. Just tried it again and again it didn't work. So sometimes it works, sometimes it doesn't. Maybe, apparently.

Anyway, I added a version attribute in the XSL namespace to the STX stylesheet root element and now it works again.

xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0"

(It seems to me that it shouldn't make a difference, but hey, I started doing crazy things when nothing seemed to work! :-) )

Just wanted to let fellow "stylesheets requires version attribute" victims know.

Hartelijke groet,

Huib Verweij.

--
Drs. Huib Verweij
Senior software developer - The Language Archive
Max Planck Institute for Psycholinguistics
P.O. Box 310
6500 AH Nijmegen
The Netherlands
t +31-24-3521911
e huib.verwey@mpi.nl<ma...@mpi.nl>
w http://www.mpi.nl/

Op 30 jan 2011, om 13:42 heeft Huib Verweij het volgende geschreven:

Looking further into it I found that defining a separate "XSLT processor" allows me to use the STX transformer:

in META-INF/cocoon/avalan/cocoon-core-xslt-stx.xconf I now have:
<components>
 <component role="org.apache.excalibur.xml.xslt.XSLTProcessor/stx"
  class="org.apache.cocoon.components.xslt.TraxProcessor">
  <parameter name="transformer-factory" value="net.sf.joost.trax.TransformerFactoryImpl"/>
 </component>
</components>


and in META-INF/cocoon/avalan/sitemap-transformers-stx-tansformer.xconf I have:

<map:components xmlns:map="http://apache.org/cocoon/sitemap/1.0">

    <map:transformers>
        <map:transformer name="stx" src="org.apache.cocoon.transformation.TraxTransformer">
            <xslt-processor-role>stx</xslt-processor-role>
        </map:transformer>
    </map:transformers>
</map:components>

and it works! Excellent!

So I answered my own question. I always have the same thing with directions as well: the moment I ask for directions, I'm almost there ;-).

Huib Verweij.


Op 30 jan 2011, om 12:59 heeft Huib Verweij het volgende geschreven:

Hi,

I'd like to use the STX block in Cocoon 2.2, but it doesn't work, I get the same error as mentioned here: http://www.mail-archive.com/dev@cocoon.apache.org/msg52324.html ("stylesheet requires attribute version").

I think the problem is in the TraxTransformer that no longer supports the "transformer-factory" config option (the Cocoon 2.1.11 version does).In the stx block the stx transformer is declared like this:

<map:transformer name="stx"
                     logger="sitemap.transformer.stx"
                     src="org.apache.cocoon.transformation.TraxTransformer">
        <transformer-factory>net.sf.joost.trax.TransformerFactoryImpl</transformer-factory>
    </map:transformer>

so it is using the "transformer-factory" config option. So what happens is, I think, the default transformer factory for XSLT stylesheets is used, it generates a transformer, which is a XSLT transformer, which checks for the version attribute on the <xsl:stylesheet/> element, which does not exist in the STX stylesheet, and it generates the above error. Or something like that.

So, do you have any tips on how to get this working again?

Huib Verweij.




Re: PS. Re: Cocoon 2.2, STX block, TraxTransformer, transformer-factory

Posted by Huib Verweij <hh...@home.nl>.
Hi David,

Op 11 jun 2011, om 04:12 heeft David Crossley het volgende geschreven:

> Huib Verwey wrote:
>> Magic stuff really does not happen. Of course it wasn't the silly attribute that did the trick, it was adding a dependency on the Joost jar that did the trick. Of course, once you know it's obvious ;-).
> 
> Thanks Huib, glad that you worked it out and reported back.

Thanks for your time and support.

> 
> Is there something that needs to be modified
> in the Cocoon-2.2 SVN?

Seems to me that the cocoon-stx-impl could do with a dependency on Joost.

But like I said in another post, I would like to use some of the blocks like cocoon-validation-impl, cocoon-stx-impl, cocoon-fop-ng-impl without a -SNAPSHOT version and just depending on the Cocoon 2.2 version that is out there in the repo. I tried to check out the tag "cocoon-2.2" from SVN but in that version these blocks have -SNAPSHOT versions, so that didn't really help. But I wouldn't know how to build this cocoon-2.2 tag, the necessary files for that just are not there - or am I not supposed to do that? I would really like to have some of these (imo stable) blocks to be in some repo somewhere without a -SNAPSHOT version. Right now, AFAIK, if I want these blocks I'll have to build Cocoon from source, is that correct? If not, please let me know from which (snapshot-)repository I can get these blocks.

Also, for me there are many things wrong with a Cocoon 2.2 SVN trunk checkout (when I build with an empty local maven repo). One test fails, there a dependencies on jars that cannot be found and there are dependencies on Cocoon's own (sub)projects that have wrong version numbers. To save my colleagues time and frustration I now check out 2.2 trunk from SVN, patch it up so that it builds, zip the whole thing and send that to them. I would be happy trying to collect all the patches I did and send them to you - my patches are of course "just make it work" patches, but most of them are OK I guess.

Hartelijke groet,

Huib.


Re: PS. Re: Cocoon 2.2, STX block, TraxTransformer, transformer-factory

Posted by David Crossley <cr...@apache.org>.
Huib Verwey wrote:
> Magic stuff really does not happen. Of course it wasn't the silly attribute that did the trick, it was adding a dependency on the Joost jar that did the trick. Of course, once you know it's obvious ;-).

Thanks Huib, glad that you worked it out and reported back.

Is there something that needs to be modified
in the Cocoon-2.2 SVN?

-David

Re: PS. Re: Cocoon 2.2, STX block, TraxTransformer, transformer-factory

Posted by Huib Verwey <Hu...@mpi.nl>.
Magic stuff really does not happen. Of course it wasn't the silly attribute that did the trick, it was adding a dependency on the Joost jar that did the trick. Of course, once you know it's obvious ;-).

huib.


Op 9 jun 2011, om 13:44 heeft Huib Verwey het volgende geschreven:

It's still a bit shady to me. Just tried it again and again it didn't work. So sometimes it works, sometimes it doesn't. Maybe, apparently.


--
Drs. Huib Verweij
Senior software developer - The Language Archive
Max Planck Institute for Psycholinguistics
P.O. Box 310
6500 AH Nijmegen
The Netherlands
t +31-24-3521911
e huib.verwey@mpi.nl<ma...@mpi.nl>
w http://www.mpi.nl/