Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 16447 invoked from network); 1 Mar 2007 14:38:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Mar 2007 14:38:04 -0000 Received: (qmail 18300 invoked by uid 500); 1 Mar 2007 14:38:06 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 18232 invoked by uid 500); 1 Mar 2007 14:38:06 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 18221 invoked by uid 99); 1 Mar 2007 14:38:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2007 06:38:06 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Jeffrey.A.Schmitz@boeing.com designates 130.76.32.69 as permitted sender) Received: from [130.76.32.69] (HELO blv-smtpout-01.ns.cs.boeing.com) (130.76.32.69) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Mar 2007 06:37:53 -0800 Received: from slb-av-01.boeing.com (slb-av-01.boeing.com [129.172.13.4]) by blv-smtpout-01.ns.cs.boeing.com (8.13.6/8.13.6/TEST_SMTPIN) with ESMTP id l21EbWUJ023311 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 1 Mar 2007 06:37:33 -0800 (PST) Received: from slb-av-01.boeing.com (localhost [127.0.0.1]) by slb-av-01.boeing.com (8.13.6/8.13.6/DOWNSTREAM_RELAY) with ESMTP id l21EbWZE021832 for ; Thu, 1 Mar 2007 06:37:32 -0800 (PST) Received: from xch-mwbh-02.mw.nos.boeing.com (xch-mwbh-02.mw.nos.boeing.com [130.247.200.9]) by slb-av-01.boeing.com (8.13.6/8.13.6/UPSTREAM_RELAY) with ESMTP id l21EbUA6021786 for ; Thu, 1 Mar 2007 06:37:31 -0800 (PST) Received: from XCH-MW-4V2.mw.nos.boeing.com ([130.247.200.20]) by xch-mwbh-02.mw.nos.boeing.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 1 Mar 2007 08:37:29 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Subject: RE: Custom Transformer Date: Thu, 1 Mar 2007 08:37:29 -0600 Message-ID: <542256E3D10C3C4B81D78ABD2DBDB20EF06D3D@XCH-MW-4V2.mw.nos.boeing.com> In-Reply-To: <45E6E316.1090606@tuffmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Custom Transformer Thread-Index: AcdcDft0gaP1aDe8RSy0qJD2WPZrZgAAA06w References: <542256E3D10C3C4B81D78ABD2DBDB20EF06D35@XCH-MW-4V2.mw.nos.boeing.com> <45E59FB5.2070905@lojjic.net> <542256E3D10C3C4B81D78ABD2DBDB20EF06D3B@XCH-MW-4V2.mw.nos.boeing.com> <45E6E316.1090606@tuffmail.com> From: "Schmitz, Jeffrey A" To: X-OriginalArrivalTime: 01 Mar 2007 14:37:29.0938 (UTC) FILETIME=[23DE3B20:01C75C0F] X-Virus-Checked: Checked by ClamAV on apache.org OK (you asked for it), basically I have some xml that needs to be = massaged first by a simple xslt before being fed into my transformer, = and then once my transformer is done, I need to result to be massaged = again with another xslt. My transformer relies on some predefined and specific transformer = libraries that I have no control over, so the xml has to be massaged to = fit into the format required by these libraries. If I can just build a = string with the incoming xml (from the first xslt), I can then feed this = string of xml into the custom transform libraries (as long as the xml = contained in the string is structured correctly). So basically, here is = what I need my custom tranformer to do: 1. Accept SAX events and build a string of the incoming xml 2. Perform transform on the received xml string 3. Output the resulting xml in the form of more Sax events for the next = tranformer/serializer in line. i.e. something like this: String message =3D doMyCustomTransform(incomingXMLString); =20 //Create a reader for turning a string into an InputSource XMLReader xmlreader =3D XMLReaderFactory.createXMLReader(); //Set the content handler into the XMLReader class. xmlreader.setContentHandler(contentHandler); //Now feed the source into the xml reader, which will turn around = and //invoke the proper handlers in the contentHandler based on the //string.=20 InputSource source =3D new InputSource(new StringReader(message)); xmlreader.parse(source); I've pretty much got steps 2 and 3 worked out. I just need the step 1 = part. Need anymore details? Thanks, Jeff=20 -----Original Message----- From: Grzegorz Kossakowski [mailto:grek@tuffmail.com]=20 Sent: Thursday, March 01, 2007 8:29 AM To: users@cocoon.apache.org Subject: Re: Custom Transformer Schmitz, Jeffrey A napisa=B3(a): > Is there a simple implementation of a Custom Transformer using=20 > AbstractSAXTransformer anywhere? Would love to see just a Hello World = > program, but can't seem to find one. > =20 The most simple transformer I can think of is = StripNamespacesTransformer[1]. It would be much better if you could come up with some details of your = own transformer you want to write so we could give you some clues. [1] https://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/a= pache/cocoon/transformation/StripNameSpacesTransformer.java?view=3Dmarkup= -- Grzegorz Kossakowski --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org