Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 26147 invoked from network); 30 Mar 2008 18:35:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Mar 2008 18:35:03 -0000 Received: (qmail 11325 invoked by uid 500); 30 Mar 2008 18:34:57 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 11260 invoked by uid 500); 30 Mar 2008 18:34:56 -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 11249 invoked by uid 99); 30 Mar 2008 18:34:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Mar 2008 11:34:56 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of joerg.heinicke@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 30 Mar 2008 18:34:15 +0000 Received: (qmail invoked by alias); 30 Mar 2008 18:34:24 -0000 Received: from c-76-116-243-84.hsd1.pa.comcast.net (EHLO c-76-116-243-84.hsd1.pa.comcast.net) [76.116.243.84] by mail.gmx.net (mp006) with SMTP; 30 Mar 2008 20:34:24 +0200 X-Authenticated: #3483660 X-Provags-ID: V01U2FsdGVkX196slIaz8p6qrcdyTzuS+WBBmp/pkExlThUwiiSVV OMIwbcDEBJPdRq Message-ID: <47EFDD2C.809@gmx.de> Date: Sun, 30 Mar 2008 14:34:20 -0400 From: Joerg Heinicke User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/20080201 SeaMonkey/1.1.8 MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Character escaping problem with custom generator References: <16379318.post@talk.nabble.com> <47EF48F5.6070501@gmx.de> <16384597.post@talk.nabble.com> In-Reply-To: <16384597.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org On 30.03.2008 13:32, shai200 wrote: > Are you referring to org.apache.cocoon.core.xml.impl.JaxpSAXParser ? Its interface org.apache.cocoon.core.xml.SAXParser. But I see that's the code that has actually changed with 2.2, there is no longer a ROLE. Instead it now uses the getClass().getName() directly: (SAXParser) this.manager.lookup(SAXParser.class.getName()); Following FileGenerator sample it's also possible to set it up using Spring (injecting the parser). For the FileGenerator it looks like (Taken from cocoon-core-generators.xml.) > I don't use a ServiceManager, but what if I instantiate the parser every > time? Will performance be low? And if I were to use the ServiceManager, > where would I store it? On the application level? Originally I recommended to extend ServiceableGenerator. There it is already available (field name is manager). > Also, should I still startDocument and endDocument like so? > > contentHandler.startDocument(); > contentHandler.startElement("", "content", "content", emptyAttr); > parser.parse(is, contentHandler); > contentHandler.endElement("","content","content"); > contentHandler.endDocument(); > > Or should I just ignore starting and ending the document, manually put the > tag in my original xhtml String and jst parse the monster? Except for the startDocument() and endDocument() calls this does not really matter. For the document calls I'm not quite sure if parsing a string generates them - and if it does and you already have them if that's causing a problem. I would just try it out. Joerg --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org