Re: org.apache.cocoon.transformation.SourceWritingTransformer

2004-02-12 Thread Geoff Howard
Anthony Davies wrote:

Hi,

I'm trying to get this transformer working so that I can write xml on 
the fly on my server. Unfortunately, I can't get this component to work. 
What error do you get?

The relevant sitemap bits as I have them are:
...

altersubmit.xsl is:
...

 xsl:template match=/
   source:write create=true
 source:sourcefile://poo.xml/source:source
 source:fragment
   xsl:apply-templates/
 /source:fragment
   /source:write
 /xsl:template
Seems you are creating a whole file here in which case the whitespace 
after source:fragment could be causing a problem (not sure how the xsl 
would affect that)

Try : source:fragmentxsl:apply-templates//source:write

Geoff

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: org.apache.cocoon.transformation.SourceWritingTransformer

2004-02-12 Thread Anthony Davies
I get this line in the log:

DEBUG   (2004-02-12) 15:24.06:218   [sitemap.transformer.tofile] 
(/documents/admin/altersubmit) 
HttpProcessor[8080][2]/SourceWritingTransformer: Configuration - no 
serializer yet

Geoff Howard wrote:

Anthony Davies wrote:

Hi,

I'm trying to get this transformer working so that I can write xml on 
the fly on my server. Unfortunately, I can't get this component to work. 


What error do you get?

The relevant sitemap bits as I have them are:


...

altersubmit.xsl is:


...

 xsl:template match=/
   source:write create=true
 source:sourcefile://poo.xml/source:source
 source:fragment
   xsl:apply-templates/
 /source:fragment
   /source:write
 /xsl:template


Seems you are creating a whole file here in which case the whitespace 
after source:fragment could be causing a problem (not sure how the xsl 
would affect that)

Try : source:fragmentxsl:apply-templates//source:write

Geoff

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: org.apache.cocoon.transformation.SourceWritingTransformer

2004-02-12 Thread Bert Van Kets
Hi Anthony,
I was strugling with the SourceWriterTransformer yesterday too. It seemed
like the transformer didn't work at all.
Checking the logs showed that indent settings are not allowed.

Try getting rid of  indent=yes on the xsl:output tag.

HTH,
Bert

- Original Message - 
From: Anthony Davies [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 4:35 PM
Subject: org.apache.cocoon.transformation.SourceWritingTransformer


 Hi,

 I'm trying to get this transformer working so that I can write xml on
 the fly on my server. Unfortunately, I can't get this component to work.
 The relevant sitemap bits as I have them are:

map:transformer logger=sitemap.transformer.tofile name=tofile
 src=org.apache.cocoon.transformation.SourceWritingTransformer
  map:parameter name=serializer value=xml/
/map:transformer

   map:generate src=doclist.xml/
   map:transform src=adminXSL/altersubmit.xsl/
   map:transform type=tofile
 map:parameter name=serializer value=xml/
   /map:transform

 altersubmit.xsl is:

 ?xml version=1.0 encoding=UTF-8?
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:fo=http://www.w3.org/1999/XSL/Format;
 xmlns:source=http://www.apache.org/cocoon/transformer/source;
   xsl:output method=xml encoding=ISO-8859-1 indent=yes
 doctype-system=doclist.dtd/
   xsl:param name=id/
   xsl:param name=product/
   xsl:param name=suppgroup/
   xsl:param name=version/
   xsl:param name=comment/

   xsl:template match=/
 source:write create=true
   source:sourcefile://poo.xml/source:source
   source:fragment
 xsl:apply-templates/
   /source:fragment
 /source:write
   /xsl:template

   xsl:template match=*
 xsl:choose
   xsl:when test=@id = $id
 xsl:choose
   xsl:when test=starts-with($id, 'p')
 xsl:element name=Product
   xsl:attribute name=ProductNamexsl:value-of
 select=$product//xsl:attribute
   xsl:attribute name=idxsl:value-of
 select=$id//xsl:attribute
   xsl:element name=Commentxsl:value-of
 select=$comment//xsl:element
   xsl:apply-templates/
 /xsl:element
   /xsl:when
   xsl:when test=starts-with($id, 's')
 xsl:element name=SupplementalGroup
   xsl:attribute name=GroupNamexsl:value-of
 select=$suppgroup//xsl:attribute
   xsl:attribute name=idxsl:value-of
 select=$id//xsl:attribute
   xsl:apply-templates/
 /xsl:element
   /xsl:when
   xsl:when test=starts-with($id, 'v')
 xsl:element name=Version
   xsl:attribute name=Numberxsl:value-of
 select=$version//xsl:attribute
   xsl:attribute name=idxsl:value-of
 select=$id//xsl:attribute
   xsl:apply-templates/
 /xsl:element
   /xsl:when
 /xsl:choose
   /xsl:when
   xsl:otherwise
 xsl:copy
   xsl:apply-templates select=@*/
   xsl:apply-templates/
 /xsl:copy
   /xsl:otherwise
 /xsl:choose
   /xsl:template

   xsl:template match=text()
 xsl:copy
   xsl:apply-templates select=@*/
   xsl:apply-templates/
 /xsl:copy
   /xsl:template

   xsl:template match=@*
 xsl:copy
   xsl:apply-templates select=@*/
   xsl:apply-templates/
 /xsl:copy
   /xsl:template

 /xsl:stylesheet

 Any help would be very much appreciated.

 Thanks,

 Anthony Davies.
 Documentation Engineer
 MSN: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: org.apache.cocoon.transformation.SourceWritingTransformer

2004-02-12 Thread Jan Hoskens
Im using the sourcewriter currently with cocoon 2.1 cvs head updated around
2/2/2004. It does work with my setup:

map:transformer logger=sitemap.transformer.write-source
name=write-source
src=org.apache.cocoon.transformation.SourceWritingTransformer/

in my pipeline:
map:transform type=write-source
 map:parameter name=serializer value=xml/
/map:transform

my instructions:
source:write
   source:sourcexsp:exprpath/xsp:expr/source:source
   source:fragment
cinclude:include
 xsp:attribute name=srcxsp:exprurl/xsp:expr/xsp:attribute
/cinclude:include
   /source:fragment
  /source:write

As far as I can see, your setup does not differ very much, but maybe you can
try the map:transformer .. that I use (standard sitemap).
Have you checked your xml before the sourcewriting transformer?

Jan

- Original Message - 
From: Anthony Davies [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 12, 2004 4:35 PM
Subject: org.apache.cocoon.transformation.SourceWritingTransformer


 Hi,

 I'm trying to get this transformer working so that I can write xml on
 the fly on my server. Unfortunately, I can't get this component to work.
 The relevant sitemap bits as I have them are:

map:transformer logger=sitemap.transformer.tofile name=tofile
 src=org.apache.cocoon.transformation.SourceWritingTransformer
  map:parameter name=serializer value=xml/
/map:transformer

   map:generate src=doclist.xml/
   map:transform src=adminXSL/altersubmit.xsl/
   map:transform type=tofile
 map:parameter name=serializer value=xml/
   /map:transform

 altersubmit.xsl is:

 ?xml version=1.0 encoding=UTF-8?
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:fo=http://www.w3.org/1999/XSL/Format;
 xmlns:source=http://www.apache.org/cocoon/transformer/source;
   xsl:output method=xml encoding=ISO-8859-1 indent=yes
 doctype-system=doclist.dtd/
   xsl:param name=id/
   xsl:param name=product/
   xsl:param name=suppgroup/
   xsl:param name=version/
   xsl:param name=comment/

   xsl:template match=/
 source:write create=true
   source:sourcefile://poo.xml/source:source
   source:fragment
 xsl:apply-templates/
   /source:fragment
 /source:write
   /xsl:template

   xsl:template match=*
 xsl:choose
   xsl:when test=@id = $id
 xsl:choose
   xsl:when test=starts-with($id, 'p')
 xsl:element name=Product
   xsl:attribute name=ProductNamexsl:value-of
 select=$product//xsl:attribute
   xsl:attribute name=idxsl:value-of
 select=$id//xsl:attribute
   xsl:element name=Commentxsl:value-of
 select=$comment//xsl:element
   xsl:apply-templates/
 /xsl:element
   /xsl:when
   xsl:when test=starts-with($id, 's')
 xsl:element name=SupplementalGroup
   xsl:attribute name=GroupNamexsl:value-of
 select=$suppgroup//xsl:attribute
   xsl:attribute name=idxsl:value-of
 select=$id//xsl:attribute
   xsl:apply-templates/
 /xsl:element
   /xsl:when
   xsl:when test=starts-with($id, 'v')
 xsl:element name=Version
   xsl:attribute name=Numberxsl:value-of
 select=$version//xsl:attribute
   xsl:attribute name=idxsl:value-of
 select=$id//xsl:attribute
   xsl:apply-templates/
 /xsl:element
   /xsl:when
 /xsl:choose
   /xsl:when
   xsl:otherwise
 xsl:copy
   xsl:apply-templates select=@*/
   xsl:apply-templates/
 /xsl:copy
   /xsl:otherwise
 /xsl:choose
   /xsl:template

   xsl:template match=text()
 xsl:copy
   xsl:apply-templates select=@*/
   xsl:apply-templates/
 /xsl:copy
   /xsl:template

   xsl:template match=@*
 xsl:copy
   xsl:apply-templates select=@*/
   xsl:apply-templates/
 /xsl:copy
   /xsl:template

 /xsl:stylesheet

 Any help would be very much appreciated.

 Thanks,

 Anthony Davies.
 Documentation Engineer
 MSN: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]