Approach 1:
Why don't you modify the existing Xml serializer to write it to the
disk and return a OK or a failure message?
You have the handle to the output stream anyways...
Haven't tried it but do let us know..
Approach 2:
I have created a new Transformer (AbstractStringTransformer ,
StringTransformer is an implementation of AbstractStringTransformer),
which basically captures the XML as a String and invokes a method where
you would embed ur custom logic
//SiteMap entries
//Transformer defn
<map:transformer name="str-trans"
src="com.accordia.display.transformation.StringTransformer"/>
//pattern match entry in pipeline
<map:match pattern="str-trans">
<map:generate src="docs/samples/xml/samples.xml">
<map:parameter name="xml-root" value="samples"/>
</map:generate>
<map:transform type="str-trans" />
<map:serialize type="html"/> <!-- not xml serializer -->
</map:match>
public String process(String element, String xmlData) {
}
You can get access to your context, request (Since this is a
transformer) and write code in this method to store the XML file and
return a message (OK or failure)
If U like the approach, do let me know
I will send U the source code ....
Cheers,
Chiths
-----Original Message-----
From: Erik Stunkat [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 6:05 AM
To: [EMAIL PROTECTED]
Subject: Re: writing xml to file
Hi Bert,
I�m really interested in editing xml files in a browser - I tried to use
Chiba for that but I couldn�t get it in the way I want it.
Why not use XSL and fp:write: to write XML docs? I�m not sure whether it
works with Cocoon 2
cu
erik
---------------------------------------------------------------------
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]>