cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <...@onclave.com>
Subject [C1] Xerces 1 bug affects Cocoon...
Date Thu, 12 Apr 2001 20:36:31 GMT
I sent the following to the xerces-j-dev list but am concerned that any
update wouldn't work with C1. Is anyone using Xerces 1.3.X with C1? How
could this change get incorporated into Xerces and then into Cocoon (e.g.
does anyone here have commit privileges on Xerces too)?

Per.


Snippet..................................

In class ElementImpl, in the function normalize(), the following code can
throw an exception if a null node value returned.

   ...
   // If kid is empty, remove it
   if ( kid.getNodeValue().length()==0 )
      removeChild( kid );
   ...

Not sure what the proper change is:

   if (null != kid.getNodeValue() && kid.getNodeValue().length() == 0)
      removeChild( kid );

is probably correct but perhaps not, I don't know the DOM well enough to
say.

[Cocoon note: The normalize() code is called from xsp-java.xsl as the last
step before generating the page's data model.]

The bug can be reproduced by creating a node as follows:

    property = document.createElement("test");
    property.appendChild(document.createTextNode(null));
    element.appendChild(property);

Specifically, any number of functions in XSPRequestLibrary.java will cause
the exception. For example, if a form is posted using method GET, the
content type is null and XSPRequestLibrary.getContentType() produces an
'invalid' node. Or, if cookies are set incorrectly, the following in Cocoon
causes an exception:

XSPCookieLibrary.getDomain()....

    property = document.createElement("cookie:domain");
    property.appendChild(document.createTextNode(cookie.getDomain()));
    element.appendChild(property);


Thoughts?
Per Kreipke


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message