cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <>
Subject Re: Parsing Source into DOM in Flow
Date Sun, 07 Dec 2003 12:00:21 GMT
Upayavira wrote:
> Maybe my last question was too specific.
> I'm trying to parse the contents of a source into a DOM in Flowscript, 
> but am getting all sorts of errors. Can anyone provide a better way than 
> this (which doesn't work)?
> var resolver = 
> cocoon.getComponent(; 
> var source = resolver.resolveURI("blah.xml");
> var builder = 
> Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder();

I think I have observed that you cannot use the returned result of a 
java method call ( newInstance() ) as a java object in flow ( 
.newDocumentBuilder() ).

The workaround I have found is to separate the calls:

var builderFactory = 

var builder = builderFactory.newDocumentBuilder();

I don't know if this is a bug or not, don't know if it's only when 
calling with Packages or not.  I also have not carefully confirmed this.

Finally, don't we have a convenience component to do this?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message