Re: SourceWritingTransformer, namespaces problem with Cocoon 2.1

2003-04-01 Thread Murad Jura
Bruno Dumon wrote:
On Sat, 2003-03-01 at 17:52, Mark H wrote:

I'm trying to write an XSP to a file using SourceWritingTransformer but the
latest DOMStreamer (v2.1) with setNormalizeNamespacesOn to true adds a
namespace to every element rather than to the xsp:page element (so that the
logicsheets don't work),


This problem should be fixed now in cocoon-2.1

This is a test.

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


SourceWritingTransformer, namespaces problem with Cocoon 2.1

2003-03-01 Thread Mark H
I'm trying to write an XSP to a file using SourceWritingTransformer but the
latest DOMStreamer (v2.1) with setNormalizeNamespacesOn to true adds a
namespace to every element rather than to the xsp:page element (so that the
logicsheets don't work), when I setNormalizeNamespacesOn to false it outputs
no namespaces and my hack of adding namespaces in an xsl stylesheet doesn't
work:

xsl:attribute name=esql:esqlDummyAttr
namespace=http://apache.org/cocoon/SQL/v2/

I've also tried adding the namespaces in the xsp:page in the xsl stylesheet
but I'm not sure if SourceWritingTransformer is stripping them out or DOM
serializer is ignoring them:

xsl:template match=page
xsp:page xmlns:xsp=http://apache.org/xsp;
xmlns:esql=http://apache.org/cocoon/SQL/v2;...

Any ideas, namespaces in general seem to cause me a lot of headaches.


output:

xsp:page xmlns:xsp=http://apache.org/xsp;
content title=Students Home
esql:connection xmlns:esql=http://apache.org/cocoon/SQL/v2;
esql:pool
xmlns:esql=http://apache.org/cocoon/SQL/v2;dkitCareers/esql:pool
...

sitemap:

map:match pattern=createTemplate
map:act type=request
map:parameter name=parameters value=true/
!--gets the semi pseudo code from the db--
map:generate type=serverpages src=util/executeQuery.xsp
map:parameter name=datasourceName 
value={global:datasourceName}/
map:parameter name=xpath value=/structure{path}/
/map:generate
!--converts semi pseudo code into XSP--
map:transform src=util/createTemplate.xsl
map:parameter name=datasourceName 
value={global:datasourceName}/
map:parameter name=path value={path}/
/map:transform
!--wraps the proper tags around the XSP for the write-source
transformer--
map:transform src=util/createFile.xsl
map:parameter name=filename value=views{path}.xsp/
/map:transform
!--writes it to a file--
map:transform type=write-source/
map:serialize type=xml/
/map:act
/map:match



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



SourceWritingTransformer and redirect

2003-02-02 Thread Beat De Martin
Hi folks
Is it possible to use SourceWritingTransformer and then a redirect. Like
this:
...
map:transformer name=filewriter
src=org.apache.cocoon.transformation.SourceWritingTransformer/
...
map:match pattern=bestellunguebermittlung.html
map:act type=controller
  map:generate type=serverpages src=xml/bestellung_pdf.xml/
  map:transform src=xsl/bestellung_fo.xsl/
  map:transform type=filewriter
   map:parameter name=serializer value=fo2pdf/
  /map:transform
  map:transform src=xsl/lieferadresse.xsl/
  map:serialize type=xml/
  !-- this works but SourceWritingTransformer does NOT write the file --
  !-- map:redirect-to uri=realbestellunguebermittlung.html/--
/map:act
map:redirect-to uri=logout.html/
/map:match


With map:serialize type=xml/ it works, but when I use redirect, the file
is not written. The redirect itself works.
Any suggestions ?

Cheers
Beat De Martin

-- 
+++ GMX - Mail, Messaging  more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: SourceWritingTransformer and redirect

2003-02-02 Thread Beat De Martin
I guess a serializer is mandatory in a pipeline.
What I did now, I used a aggregation. One map:part just writes the files and
the other one prepares the html which I want to send to the client.

map:match pattern=bestellung
 map:generate type=serverpages src=xml/bestellung.xml/
  map:serialize type=xml/
/map:match
map:match pattern=bestellungmail
  map:generate type=serverpages src=xml/bestellung_pdf.xml/
  map:transform src=xsl/bestellung_fo.xsl/
  map:transform type=filewriter
   map:parameter name=serializer value=fo2pdf/
  /map:transform
map:serialize type=xml/
/map:match

map:match pattern=bestellunguebermittlung.html
 map:act type=controller
  map:aggregate element=page
   map:part src=cocoon:/bestellung strip-root=true/
   map:part src=cocoon:/bestellungmail strip-root=true/
 /map:aggregate
map:transform src=xsl/bestellunguebermittlung.xsl/
map:serialize type=html/
/map:act
map:redirect-to uri=logout.html/
/map:match




 Hi folks
 Is it possible to use SourceWritingTransformer and then a redirect. Like
 this:
 ...
 map:transformer name=filewriter
 src=org.apache.cocoon.transformation.SourceWritingTransformer/
 ...
 map:match pattern=bestellunguebermittlung.html
 map:act type=controller
   map:generate type=serverpages src=xml/bestellung_pdf.xml/
   map:transform src=xsl/bestellung_fo.xsl/
   map:transform type=filewriter
map:parameter name=serializer value=fo2pdf/
   /map:transform
   map:transform src=xsl/lieferadresse.xsl/
   map:serialize type=xml/
   !-- this works but SourceWritingTransformer does NOT write the file --
   !-- map:redirect-to uri=realbestellunguebermittlung.html/--
 /map:act
 map:redirect-to uri=logout.html/
 /map:match
 
 
 With map:serialize type=xml/ it works, but when I use redirect, the
 file
 is not written. The redirect itself works.
 Any suggestions ?
 
 Cheers
 Beat De Martin
 
 -- 
 +++ GMX - Mail, Messaging  more  http://www.gmx.net +++
 NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
 
 
 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.html
 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]
 

-- 
+++ GMX - Mail, Messaging  more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




SourceWritingTransformer: namespaces

2003-01-28 Thread Alex Romayev
Hi,

I'm need to use a namespace insite source:replace tag,
for example:

source:insert
  xmlns:source=http://apache.org/cocoon/source/1.0;
  xmlns:myns=http://foo.org/myns;
  source:path//source:path
  source:replacemyns:item/source:replace
  source:fragment.../source:fragmen
/source:insert

When I run this, I get:

javax.xml.transform.TransformerException: Prefix must
resolve to a namespace: myns.

Is it actually possible to use a namespace inside a
replace tag?

Thanks,
-Alex

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




use redirect with SourceWritingTransformer?

2002-12-18 Thread Timothy Larson
Is it possible to call a pipeline to use the SourceWritingTransformer
and still only send a simple map:redirect-to ... back to the client?

Tim



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




use SourceWritingTransformer with redirect?

2002-12-12 Thread Timothy Larson
What can I do in a Cocoon sitemap to send a redirect if
I also need to execute a pipeline to produce a side-effect?

Specifically, I am trying to respond to a POST by writing
a file to disk and redirecting back to the page that caused
the POST.  The redirect is to drop the POST information
so page refreshes will work normally without causing
additional POST's.

Here is the working pipeline that writes a file to disk:

  map:generate src=some-xml-file/
  map:transform src=some-xsl-file/
  map:transform type=SourceWritingTransformer/
  map:serialize/

Here is the working redirect:

  map:redirect-to uri=some-uri/

Anybody know how to combine them so they both happen
in response to the same request?

Thanks,
Tim



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




transforms allowed after SourceWritingTransformer?

2002-12-12 Thread Timothy Larson
Does Cocoon allow transforms after using the SourceWritingTransformer?

Example (note: xsl-file-B):
  map:generate src=some-xml-file/
  map:transform src=xsl-file-A/
  map:transform type=SourceWritingTransformer/
  map:transform src=xsl-file-B/
  map:serialize/

In Cocoon-2.0.4 (compiled with build installscratchpadwar) it produces this 
beautiful error message:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.: 
java.lang.NullPointerException
at 
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:223)
at 
org.apache.cocoon.components.source.SitemapSource.toSAX(SitemapSource.java:381)
at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:143)
at 
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:250)
at 
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:395)
...

Tim



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




SourceWritingTransformer and sub-sitemap

2002-11-12 Thread Barbara Post
Hi,

I use SourceWritingTransformer 3 times, and the XML stream that is processed
by this transformer is produced by a sub-sitemap. So that my XML database
queries are gathered there.

The bug : my transformer wants to write in the ino folder, where is placed
the sub-sitemap. Not the folder of the main sitemap. I tried to understand
the transformer's code but it's a bit too hard for me :-(

So here are the info :
Cocoon CVS from 10/02 with JDK 1.3.1

Main sitemap snippet :

   !-- generates html body of email license
   and writes it on disk --
   map:match pattern=writehtmlbody
map:act type=request
 map:parameter name=parameters value=true/
 map:act type=auth-protect
  map:parameter name=handler value=baepphandler/
  map:generate src=cocoon://ino/licenseinfo/{../serialNumber}/
  map:transform src=xsl/writelicensehtmlbody.xsl/
  map:transform type=write-source
   map:parameter name=serializer value=html/
  /map:transform
  map:serialize type=xml/
 /map:act
/map:act
   /map:match

and in the same pipeline :

!-- mount tamino queries --
map:match pattern=ino/**
  map:mount check-reload=yes src=ino/ uri-prefix=ino//
/map:match

writelicensehtmlbody.xsl :

xsl:template match=/
 source:write
 !-- get one step above because current directory is ino [bug ??] --
source:source../licensekeys/xsl:value-of
select=//License_Info/SoftwareAG_License/Component/LicenseKey//htmlbody.h
tml/source:source
source:fragment
xsl:call-template name=htmlbody/
/source:fragment
   /source:write

You see that I have to add ../ to the source:source URI.
I wonder why the call to a sub-sitemap changes some cocoon environment
variable ?...
Is the map:mount misconfigured ?

Thanks a lot,

Barbara

PS : I am just doing cosmetics (to my project), this is why I reappear on
the list...


__
Modem offert : 150,92 euros remboursés sur le Pack eXtense de Wanadoo ! 
Haut débit à partir de 30 euros/mois : http://www.ifrance.com/_reloc/w


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: SourceWritingTransformer.

2002-10-15 Thread Alex Romayev

From what I understand, yes.  In 2.1
SourceWritingTransformer has been merged with
ex-sunrise InsertTransformer.

Alex
--- ROSSEL Olivier [EMAIL PROTECTED] wrote:
 I use old-style SWT:
 
 source:write src=...
  tree-to-be-written
   ...
  /tree-to-be-written
 /source
 
 It seems that there is a newer syntax (with a very
 interesting source:insert
 !! )
 but I can't get it to work in C2.0.3. It seems that
 the SWT I have still
 uses
 the old-style syntax.
 
 Is the new SWT only available in C2.1dev ?
 
 
 This e-mail is intended only for the above
 addressee. It may contain
 privileged information. If you are not the addressee
 you must not copy,
 distribute, disclose or use any of the information
 in it. If you have
 received it in error please delete it and
 immediately notify the sender.
 Security Notice: all e-mail, sent to or from this
 address, may be
 accessed by someone other than the recipient, for
 system management and
 security reasons. This access is controlled under
 Regulation of
 Investigatory Powers Act 2000, Lawful Business
 Practises.
 

-
 Please check that your question  has not already
 been answered in the
 FAQ before posting.
 http://xml.apache.org/cocoon/faq/index.html
 
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:  
 [EMAIL PROTECTED]
 


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




RE: SourceWritingTransformer.

2002-10-15 Thread ROSSEL Olivier

 From what I understand, yes.  In 2.1
 SourceWritingTransformer has been merged with
 ex-sunrise InsertTransformer.

No hope to see this feature in C2.0.4 ?
It would be a so neat feature!!!
This e-mail is intended only for the above addressee. It may contain
privileged information. If you are not the addressee you must not copy,
distribute, disclose or use any of the information in it. If you have
received it in error please delete it and immediately notify the sender.
Security Notice: all e-mail, sent to or from this address, may be
accessed by someone other than the recipient, for system management and
security reasons. This access is controlled under Regulation of
Investigatory Powers Act 2000, Lawful Business Practises.

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Why insert tag of SourceWritingTransformer doesn't work?

2002-09-25 Thread funing

Hi!
  Does anyone have tried SourceWritingTransformer?
I copy the sample code from http://xml.apache.org/cocoon/userdocs/transf
ormers/sourcewriting-transformer.html to my test1.xml and found that insert
tag doesn't work. Why?

This is test1.xml:
 mount/editor/tests/test1.xml 
 page
   titleSourceWritingTransformer Test Page 1/title
   content
   parabTest/b: Basic/para
   paraThis test should have written a file called result1.xml, in the 
same directory as this./para
   paraThe file's content should come from the xml below./para
   paraThe XML is:/para
   para
   pre
   source:write src=tests/result1.xml
   page
   titleSourceWritingTransformer Test Result 1/title
   content
   paraCongratulations!/para
   /content
   /page
   /source:write
   /pre
   /para
   
 source:write src=tests/result1.xml
 page
   titleSourceWritingTransformer Test Result 1/title
   content
   paraCongratulations!/para
   /content
 /page
 /source:write
 
 
source:insert src=tests/result1.xml
  source:pathpage/content/source:path  
  source:fragment
pThis paragraph gets empinserted/emp./p
pWith this one, at the end of the content./p
  /source:fragment
/source:insert
   
   source:insert
   source:pathpage/content/source:path  
   source:sourcetests/result1.xml/source:source
   source:fragment
  pThis paragraph gets empinserted/emp./p
  pWith this one, at the end of the content./p
   /source:fragment
   /source:insert
 
 
   paraHave a a href=../result/1look!/a/para
   /content
 /page
 


This is the result page:
 SourceWritingTransformer Test Page 1 
 Test: Basic
 
 This test should have written a file called result1.xml, in the same directory as 
this.
 
 The file's content should come from the xml below.
 
 The XML is:
..
..
..
 Result success 
 Source file:/D:/jakarta-tomcat-4.0.1/webapps/cocoon/mount/editor/tests/result1.xml 
 Action Existing file overwritten 
 Serializer my-xml-serializer 
 page/content 
 This paragraph gets inserted.
 
 With this one, at the end of the content.
 
 page/content tests/result1.xml 
 This paragraph gets inserted.
 
 With this one, at the end of the content.
 
 Have a look! 

-- 
funing [EMAIL PROTECTED]


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




SourceWritingTransformer

2002-09-04 Thread Barbara Post

Can it automatically create a folder on the HD (I define where I write in
source:source / tag) or does it only use existing folders ?

Thanks,

Barbar


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




problem with pdf and SourceWritingTransformer

2002-09-04 Thread Barbara Post

Hi again,

here is my sitemap piece :

   map:match pattern=writelicense
map:act type=request
 map:parameter name=parameters value=true/
  map:generate
src=cocoon://getlicense?serialNumber={../serialNumber}/
  map:transform src=xsl/writeandkeep.xsl/
 map:transform type=write-source
   map:parameter name=serializer value=xml/
  /map:transform
  map:transform src=xsl/writeandpdfcard.xsl/
  map:transform type=write-source
   map:parameter name=serializer value=fo2pdf/
  /map:transform
  map:serialize type=xml/
/map:act
   /map:match

Explaination : I get an xml file, by writeandkeep.xsl add the relevant
source:... / tags to be able to apply the transformer, and I keep the
licence content because I want to do a pdf with it. It works ok.

writeandpdfcard.xsl is supposed to do the pdf and write to the disk.

My problem : there is an exception because I want to write so in this last
stylesheet :

xsl:template match=/page/license
source:writelicensekeys/blah.pdf/source:write
source:fragment
 fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
  fo:layout-master-set
   fo:simple-page-master ...

...

/fo:root
/source:fragment

Fop 0.20.4 says :

[Fatal Error] pro1FF.xml:2:1: Content is not allowed in prolog.

[ERROR] Content is not allowed in prolog.

...post processing finished

Any idea how I can correctly use this transformer with pdf format ? Many
thanks !

Barbara


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




RE: Please help with SourceWritingTransformer

2002-07-12 Thread ROSSEL Olivier

 I seem to have done everything right and was testing out the
 SourceWritingTransformer and can't get it to write to a file. 
  I have the
 pipeline
 
 map:match pattern=test/*.xsp
   map:generate type =serverpages src=test/{1}.xsp/
   map:transform type=sql
   map:parameter name=use-connection value=dev_database/
   /map:transform
   map:transform src=test/metadata.xsl/
   map:transform type=xslt-with-parameters 
 src=test/source.xsl
   map:parameter name=page-title value={page-title}/
   /map:transform
   map:transform type=tofile2
   map:parameter name=serializer value=xml/
   /map:transform
   map:serialize type=xml/
/map:match
 
 
 I know that everything up to the second transformation works 
 (until the
 tofile2 trans which is the SWT).  The input to the SWT looks 
 like this:
 
 ?xml version=1.0 encoding=UTF-8 ?
source:write 
 xmlns:source=http://apache.org/cocoon/source/1.0; src=
context://my.xml
   KnowledgeObject xmlns:sql=http://apache.org/cocoon/SQL/2.0;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  ...stuff..
  /KnowledgeObject
     /source:write
Can you try with a src containing only the path and no context: at all?
I think it may be the problem.

Gurus will confirm, but I think that Writable source are URLs that can
written
to. context:// is a pseudo protocol, that is probably not handled correctly
bu the SWT. Try with a path, I think SWT will be happier.

Note for developpers: may be, the context:// could be considered a Writable
Source.

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Trouble with SourceWritingTransformer

2002-07-11 Thread Gerardo_Flores

I seem to have done everything right and was testing out the
SourceWritingTransformer and can't get it to write to a file.  I have the
pipeline

map:match pattern=test/*.xsp
  map:generate type =serverpages src=test/{1}.xsp/
  map:transform type=sql
  map:parameter name=use-connection value=dev_database/
  /map:transform
  map:transform src=test/metadata.xsl/
  map:transform type=xslt-with-parameters src=test/source.xsl
  map:parameter name=page-title value={page-title}/
  /map:transform
  map:transform type=tofile2
  map:parameter name=serializer value=xml/
  /map:transform
  map:serialize type=xml/
   /map:match

I know that everything up to the second transformation works (until the
tofile2 trans which is the SWT).  The input to the SWT looks like this:
?xml version=1.0 encoding=UTF-8 ?
   source:write xmlns:source=http://apache.org/cocoon/source/1.0; src=
   context://my.xml
  KnowledgeObject xmlns:sql=http://apache.org/cocoon/SQL/2.0;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 ...stuff..
     /KnowledgeObject
    /source:write

The error I get is:
?xml version=1.0 encoding=UTF-8 ?
source:write src=file:C:\jakarta-tomcat-3.2.4\webapps\cocoon\my.xml
action=none result=failed serializer=xml xmlns:source=
http://apache.org/cocoon/source/1.0;The src attribute doesn't resolve to a
writeable source and failed to cancel
/source:write

   not sure what I am doing wrong???  Could anyone enlighten me?  It seems
   as though the file:C:\jakarta-tomcat-3.2.4\webapps\cocoon\my.xml is
   badly formed, but this path gets generated by the SWT as what I hard
   coded into the xsl sheet is below:

?xml version=1.0 encoding=UTF-8?
xsl:transform xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version
=1.0
   xmlns:source=http://apache.org/cocoon/source/1.0;
xsl:output method=xml encoding=UTF-8 indent=yes/
xsl:strip-space elements=*/

xsl:template match=/
xsl:element name=source:write
xsl:attribute name=srccontext://my.xml/xsl:attribute
xsl:copy-of select=./
/xsl:element
/xsl:template
/xsl:transform

Am I using the SWT wrong?

-Gerardo

+-+
This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.
+-+


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Please help with SourceWritingTransformer

2002-07-11 Thread Gerardo_Flores


I seem to have done everything right and was testing out the
SourceWritingTransformer and can't get it to write to a file.  I have the
pipeline

map:match pattern=test/*.xsp
  map:generate type =serverpages src=test/{1}.xsp/
  map:transform type=sql
  map:parameter name=use-connection value=dev_database/
  /map:transform
  map:transform src=test/metadata.xsl/
  map:transform type=xslt-with-parameters src=test/source.xsl
  map:parameter name=page-title value={page-title}/
  /map:transform
  map:transform type=tofile2
  map:parameter name=serializer value=xml/
  /map:transform
  map:serialize type=xml/
   /map:match


I know that everything up to the second transformation works (until the
tofile2 trans which is the SWT).  The input to the SWT looks like this:

?xml version=1.0 encoding=UTF-8 ?
   source:write xmlns:source=http://apache.org/cocoon/source/1.0; src=
   context://my.xml
  KnowledgeObject xmlns:sql=http://apache.org/cocoon/SQL/2.0;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 ...stuff..
     /KnowledgeObject
    /source:write

The error I get is:
?xml version=1.0 encoding=UTF-8 ?
source:write src=file:C:\jakarta-tomcat-3.2.4\webapps\cocoon\my.xml
action=none result=failed serializer=xml xmlns:source=
http://apache.org/cocoon/source/1.0;The src attribute doesn't resolve to a
writeable source and failed to cancel
/source:write

   not sure what I am doing wrong???  Could anyone enlighten me?  It seems
   as though the file:C:\jakarta-tomcat-3.2.4\webapps\cocoon\my.xml is
   badly formed, but this path gets generated by the SWT as what I hard
   coded into the xsl sheet is below:


?xml version=1.0 encoding=UTF-8?
xsl:transform xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version
=1.0
   xmlns:source=http://apache.org/cocoon/source/1.0;
xsl:output method=xml encoding=UTF-8 indent=yes/
xsl:strip-space elements=*/

xsl:template match=/
xsl:element name=source:write
xsl:attribute name=srccontext://my.xml/xsl:attribute
xsl:copy-of select=./
/xsl:element
/xsl:template
/xsl:transform


Am I using the SWT wrong?  I'm a newbie to Cocoon and have tried everything
that I know how to do, so any help would be greatly appreciated!!

-Gerardo

+-+
This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.
+-+


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




SourceWritingTransformer sample (disregard previous post Serializer thatwrites to file)

2002-07-10 Thread Gerardo_Flores

Sorry, seems that I must have posted my previous question before (have had
way too many things on  my mind lately).  The best solution would seem to
be to use the SourceWritingTransformer to simply write my content to a
file.  To specify the file to write to, would I just have to write an xsl
sheet that encapsulated my xml content in a source:write tag and specify
the location with the source attribute?  If so, how do I make a parameter
or the request pipeline available to the xsl sheet and how do I use it?
Also, what if I don't want the final output sent over the wire.how
would I stop output from going to the requesting browser?  This is why I
thought I would have to write a serializer, but if I can stop output from
reaching the browser, this would also work.

thanks,

-gerardo

+-+
This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.
+-+


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




RE: SourceWritingTransformer sample (disregard previous post Serializer that writes to file)

2002-07-10 Thread Hunsberger, Peter

 Also, what if I don't want the final output sent over the wire.how
 would I stop output from going to the requesting browser?  

Writing a null (do nothing) serializer would be pretty easy... :-)

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




[UPDATE] SourceWritingTransformer Samples

2002-07-03 Thread Jeremy Quinn

Dear All,

The SourceWritingTransformer in HEAD has just been updated 
(along with the samples and tests in scratchpad).

There were two main tags in SWT, source:write and source:insert, 
each of them was configured in a completely different way, this 
update has unified the two tags so that they both follow the 
same scheme:

source:write
source:sourcepath/to/source/source:source
source:fragmentthing to=write//source:fragment
/source:write

source:insert
source:pathwhere/to/insert/source:path
source:sourcepath/to/source/source:source
source:fragmentthing to=write//source:fragment
/source:insert

This means that you will need to change your projects if you are 
using the source:write tag in your work, as this change is 
backwards incompatible. Sorry for any inconvenience.

Other changes were made:

both tags now output a report on their activities
both tags buffer the fragment to a DOM, before writing


Known Problems:

Namespaces are not handled correctly! (NS declaration not 
written to Source)
source:reinsert/ tag not acting correctly.


Expect more sample editors in slash-edit/ in the near future.



regards Jeremy


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




SourceWritingTransformer error

2002-05-28 Thread Olivier Rossel

Can anyone try this HOWTO and tell me if he/she gets the abnormal 
behaviour described here:

http://www.mail-archive.com/cocoon-dev%40xml.apache.org/msg16998.html

I would like to know if this bug is known and has been corrected.

PS: it is something that is in the scratchpad (I think). If you do not 
know what it is, you don't care.


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: SourceWritingTransformer : Cannot get 'xml' serializer

2002-03-27 Thread Matthieu Benéteau

Sorry for being long, I'm just beginning my day.
( 09:40 AM in France :)

I have simply replaced FileWritingTransformer with
SourceWritingTransformer in the sitemap :

1.  map:transformer name=tofile
logger=sitemap.transformer.tofile

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

2.  map:match pattern=project/test-write
  map:generate src=test/test-write.xml/
  map:transform type=tofile/
  map:serialize type=xml/
/map:match

3. Inside test-write.xml :

?xml version=1.0 encoding=iso-8859-1?
product xmlns:source=http://apache.org/cocoon/source/1.0;
   functionBlockList
  functionBlock.../functionBlock

  source:write src=test/result-write.xml
functionBlock content /functionBlock
  /source:write

  functionBlock.../functionBlock
  functionBlock.../functionBlock
   /functionBlockList
/product

This used to work with FileWritingTransformer.

Here is my XML serializer declaration :

  map:serializer name=xmlmime-type=text/xml
logger=sitemap.serializer.xml
  src=org.apache.cocoon.serialization.XMLSerializer
  pool-max=32 pool-min=16 pool-grow=4
encodingiso-8859-1/encoding
  /map:serializer


Thanks,
Matthieu


 -Message d'origine-
 De : Jeremy Quinn [mailto:[EMAIL PROTECTED]]
 Envoyé : mardi 26 mars 2002 18:43
 Objet : Re: SourceWritingTransformer : Cannot get 'xml' serializer


 At 6:18 pm +0100 26/3/02, Matthieu Benéteau wrote:
 Hi,
 
 I've just installed Cocoon 2.0.2 on Tomcat 4.0.1, and it works
 perfectly :).
 But I've encountered a problem using the scratchpad's
 SourceWritingTransformer.
 
 I used to use revision 1.6 of the old FileWritingTransformer.
 I've just changed xfwt into source and tested it, and I've
 received the
 following error :
 
action: none
result: failed
error message : could not get a ContentHandler and failed to cancel

 May I see the setup you used?

 1. Declaration of SourceWritingTransformer in the SiteMap
 2. Usage of the SourceWritingTransformer in the SiteMap
 3. The actual tag you generate to trigger SourceWritingTransformer

 Here are the 2 exceptions of the sitemap.log :
 
 WARN(2002-03-26) 17:40.48:760
 [sitemap.transformer.tofile](/myproject/request)
 HttpProcessor[8080][0]/SourceWritingTransformer: failed, could not get a
 ContentHandler
 org.apache.cocoon.ProcessingException: Cannot get 'xml' serializer

 Do you have a serializer set up called 'xml', maybe you removed
 the default
 from the main sitemap?


 Thanks in advance,
 Matthieu

 Thanks for trying this out.

 regards Jeremy
 --
___

Jeremy Quinn   Karma Divers
webSpace Design
 HyperMedia Research Centre

mailto:[EMAIL PROTECTED]
http://www.media.demon.co.uk
   phone:+44.[0].20.7737.6831 pager:[EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: SourceWritingTransformer : Cannot get 'xml' serializer

2002-03-27 Thread Jeremy Quinn

At 9:55 am +0100 27/3/02, Matthieu Benéteau wrote:
1.  map:transformer name=tofile
logger=sitemap.transformer.tofile

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


the serialize parameter is wrong, try this:

map:transformer name=tofile logger=sitemap.transformer.tofile

src=org.apache.cocoon.transformation.SourceWritingTransformer
-- serializerxml/serializer
/map:transformer

Why there is this different syntax for setting up, I am not sure.

Hope this helps

regards Jeremy
--
   ___

   Jeremy Quinn   Karma Divers
   webSpace Design
HyperMedia Research Centre

   mailto:[EMAIL PROTECTED]http://www.media.demon.co.uk
   phone:+44.[0].20.7737.6831 pager:[EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: SourceWritingTransformer : Cannot get 'xml' serializer

2002-03-27 Thread Matthieu Benéteau

It's working !  :)
Thanks a lot.

Matthieu


 -Message d'origine-
 De : Jeremy Quinn [mailto:[EMAIL PROTECTED]]
 Envoyé : mercredi 27 mars 2002 11:26
 Objet : RE: SourceWritingTransformer : Cannot get 'xml' serializer


 At 9:55 am +0100 27/3/02, Matthieu Benéteau wrote:
 1.  map:transformer name=tofile
 logger=sitemap.transformer.tofile
 
 src=org.apache.cocoon.transformation.SourceWritingTransformer
   map:parameter name=serializer  value=xml/
 /map:transformer


 the serialize parameter is wrong, try this:

   map:transformer name=tofile logger=sitemap.transformer.tofile

 src=org.apache.cocoon.transformation.SourceWritingTransformer
 --   serializerxml/serializer
   /map:transformer

 Why there is this different syntax for setting up, I am not sure.

 Hope this helps

 regards Jeremy
 --
___

Jeremy Quinn   Karma Divers
webSpace Design
 HyperMedia Research Centre

mailto:[EMAIL PROTECTED]
http://www.media.demon.co.uk
   phone:+44.[0].20.7737.6831 pager:[EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




SourceWritingTransformer : Cannot get 'xml' serializer

2002-03-26 Thread Matthieu Benéteau

Hi,

I've just installed Cocoon 2.0.2 on Tomcat 4.0.1, and it works perfectly :).
But I've encountered a problem using the scratchpad's
SourceWritingTransformer.

I used to use revision 1.6 of the old FileWritingTransformer.
I've just changed xfwt into source and tested it, and I've received the
following error :

   action: none
   result: failed
   error message : could not get a ContentHandler and failed to cancel


Here are the 2 exceptions of the sitemap.log :

WARN(2002-03-26) 17:40.48:760
[sitemap.transformer.tofile](/myproject/request)
HttpProcessor[8080][0]/SourceWritingTransformer: failed, could not get a
ContentHandler
org.apache.cocoon.ProcessingException: Cannot get 'xml' serializer
at
org.apache.cocoon.components.source.AbstractStreamWriteableSource.getContent
Handler(AbstractStreamWriteableSource.java:168)
at
org.apache.cocoon.transformation.SourceWritingTransformer.startElement(Sourc
eWritingTransformer.java:293)
at
org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.j
ava:858)
[...]

WARN(2002-03-26) 17:40.48:810
[sitemap.transformer.tofile](/myproject/request)
HttpProcessor[8080][0]/SourceWritingTransformer: failed to cancel:
file:/D:/path/to/myfile.xml
java.lang.IllegalArgumentException: The handler is not associated to this
source
at
org.apache.cocoon.components.source.AbstractStreamWriteableSource.cancel(Abs
tractStreamWriteableSource.java:137)
at
org.apache.cocoon.transformation.SourceWritingTransformer.startElement(Sourc
eWritingTransformer.java:299)
at
org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.j
ava:858)
[...]


Does anyone know what mistake I've made ?


Thanks in advance,
Matthieu


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




Re: SourceWritingTransformer : Cannot get 'xml' serializer

2002-03-26 Thread Jeremy Quinn

At 6:18 pm +0100 26/3/02, Matthieu Benéteau wrote:
Hi,

I've just installed Cocoon 2.0.2 on Tomcat 4.0.1, and it works perfectly :).
But I've encountered a problem using the scratchpad's
SourceWritingTransformer.

I used to use revision 1.6 of the old FileWritingTransformer.
I've just changed xfwt into source and tested it, and I've received the
following error :

   action: none
   result: failed
   error message : could not get a ContentHandler and failed to cancel

May I see the setup you used?

1. Declaration of SourceWritingTransformer in the SiteMap
2. Usage of the SourceWritingTransformer in the SiteMap
3. The actual tag you generate to trigger SourceWritingTransformer

Here are the 2 exceptions of the sitemap.log :

WARN(2002-03-26) 17:40.48:760
[sitemap.transformer.tofile](/myproject/request)
HttpProcessor[8080][0]/SourceWritingTransformer: failed, could not get a
ContentHandler
org.apache.cocoon.ProcessingException: Cannot get 'xml' serializer

Do you have a serializer set up called 'xml', maybe you removed the default
from the main sitemap?


Thanks in advance,
Matthieu

Thanks for trying this out.

regards Jeremy
--
   ___

   Jeremy Quinn   Karma Divers
   webSpace Design
HyperMedia Research Centre

   mailto:[EMAIL PROTECTED]http://www.media.demon.co.uk
   phone:+44.[0].20.7737.6831 pager:[EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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