Le 3 juin 04, � 09:50, Derek Hohls a �crit :
Bertrand
Is there a concrete example in the Cocoon samples (or the Wiki) that "fleshes out" this approach in a little more detail?
Maybe not, but here are some code excerpts:
import org.apache.excalibur.xml.dom.DOMParser; import org.w3c.dom.Document; import org.xml.sax.InputSource;
ServiceManager manager; (obtained via Serviceable or something)
public Document stringToDOM(String input) throws Exception {
Document result = null;
DOMParser parser = null;
try {
parser = (DOMParser)manager.lookup(DOMParser.ROLE);
result = parser.parseDocument(new InputSource(new StringReader(input)));
} finally {
manager.release(parser);
}
return result;
}
You could also do it directly from Flowscript by using cocoon.createComponent to do the lookup.
-Bertrand
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
