Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 43182 invoked from network); 9 Nov 2004 12:43:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Nov 2004 12:43:59 -0000 Received: (qmail 42372 invoked by uid 500); 9 Nov 2004 12:43:58 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 42223 invoked by uid 500); 9 Nov 2004 12:43:57 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 42209 invoked by uid 99); 9 Nov 2004 12:43:57 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 09 Nov 2004 04:43:55 -0800 Received: (qmail 43112 invoked by uid 65534); 9 Nov 2004 12:43:54 -0000 Date: 9 Nov 2004 12:43:54 -0000 Message-ID: <20041109124354.43110.qmail@minotaur.apache.org> From: sylvain@apache.org To: cvs@cocoon.apache.org Subject: svn commit: rev 57029 - cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/context X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: sylvain Date: Tue Nov 9 04:43:54 2004 New Revision: 57029 Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/context/RequestSessionContext.java Log: Quick workaround for request attributes whose name is not suitable for an XML element name Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/context/RequestSessionContext.java ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/context/RequestSessionContext.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/context/RequestSessionContext.java Tue Nov 9 04:43:54 2004 @@ -32,6 +32,7 @@ import org.apache.excalibur.source.SourceParameters; import org.apache.excalibur.xml.sax.SAXParser; import org.apache.excalibur.xml.xpath.XPathProcessor; +import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; import org.w3c.dom.Element; @@ -111,7 +112,7 @@ * - getAuthType() * * @author Carsten Ziegeler - * @version CVS $Id: RequestSessionContext.java,v 1.7 2004/03/19 14:16:55 cziegeler Exp $ + * @version CVS $Id$ */ public final class RequestSessionContext implements SessionContext { @@ -281,9 +282,15 @@ Enumeration all = this.request.getAttributeNames(); while (all.hasMoreElements() == true) { attrName = (String) all.nextElement(); - attr = doc.createElementNS(null, attrName); - attrElement.appendChild(attr); - DOMUtil.valueOf(attr, this.request.getAttribute(attrName)); + try { + attr = doc.createElementNS(null, attrName); + attrElement.appendChild(attr); + DOMUtil.valueOf(attr, this.request.getAttribute(attrName)); + } catch(DOMException de) { + // Some request attributes have names that are invalid as element names. + // Example : "FOM JavaScript GLOBAL SCOPE/file://my/path/to/flow/script.js" + System.err.println("Cannot create XML element with name '" + attrName + "' : " + de.getMessage()); + } } }