cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: svn commit: rev 57029 - cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/context
Date Tue, 09 Nov 2004 18:06:54 GMT
On 09.11.2004 13:43, sylvain@apache.org wrote:

> 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

> @@ -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());

System.err ??

Joerg

Mime
View raw message