cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
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:26:40 GMT
Joerg Heinicke wrote:

> 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 ??


Yeah, I know, that's ugly. But RequestContext has no logger, and I 
needed that to be fixed quickly. Writing to System.err ensures we (and 
Carsten :-) ) see the message so that we do not forget that something 
has to be done there.

Now I'm open to any better solution!

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message