Please note, the XMLDBTransformer does the same (it stores data in the XML:DB database, but that's the only difference). This way you can process the output of the transformer (XMLDBTransformers outputs a tag with success/failure and a generated key) by another transformer to transform it to HTML. With the serializer approach this is not possible.
If you want to write a FileWriterTransformer or something you can get ideas from the XMLDBTransformer. HTH, Michael. > -----Original Message----- > From: Bert Van Kets [mailto:[EMAIL PROTECTED]] > Sent: vrijdag 15 februari 2002 9:11 > To: [EMAIL PROTECTED] > Subject: RE: writing xml to file - Solution > > > I like the idea of the serialiser. I will be using it a lot > since I'm > creating a framework to let people access the content of the > site through a > browser. Please do send me the code. Thanks. > I just have to figure out how to send through the exact > filename. Since > this has to be a local path on the server I'm no really sure > how to get > it. Any ideas? > Bert > > >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 > > > --------------------------------------------------------------------- > 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]>