I have looked in the
mailing lists, to no avail, please forgive me if these questions have been
answered already....
I have upgraded
Cocoon 1.8.2 to Cocoon 2.0.2. Here's my setup:
Cocoon
2.0.2
Weblogic
6.0sp2
Solaris 2.6
(Sparc)
I have successfully
installed C2, all the samples work, etc. but I am having a problem getting my
logicsheets to work. I am having 2 separate problems:
Problem 1:
Transition from DOM to SAX
In my logicsheets I
have a number of places where I dynamically insert an XML document, then use the
DOM API to access values of specific nodes. I have come to realize that since C2
uses SAX, I can no longer do this. Here's an example:
String name = "Joe";
NodeList ca =
document.getElementsByTagName( "employee" );
if ( ca
!= null ) {
Element element = null;
String myAttr = "";
int
length = ca.getLength();
for (int j = 0; j
< length; j++) {
element = (Element)
ca.item(j);
myAttr = element.getAttribute( "name" );
if (
!myAttr.equals( name ) )
continue;
myValue = element.getAttribute( "value" );
break;
}
}
So if I have the
following XML fragment:
<employee
name="John" value="23"/>
<employee
name="Jack" value="34"/>
<employee
name="Joe" value="45"/>
<employee
name="Joanne" value="56"/>
<employee
name="Jimmy" value="67"/>
I want the value
"45". How would I do this with SAX?
Problem 2: request
and response using C2 specific implementation, rather than
javax.servlet.http.HttpRequest and
javax.servlet.http.HttpResponse
I use some EJB's
which have methods that take the built-in XSP variables 'request' and 'response'
as params. It does not work now. Is there a way to cast
org.apache.cocoon.environment.Request as javax.servlet.http.HttpRequest (and
likewise for Response), or is there a better way to do it? I would like to avoid
having to modify the EJBs, which at this point would be a Hurculean
task.
Sorry if these don't
seem to be Cocoon 2 questions, but I was thinking maybe some of you have similar
problems.
Thanks in
advance...
William
Bagby.
