You can do it like this:
Source source = null;
SourceResolver resolver = null;
try {
resolver = (SourceResolver) manager.lookup(
SourceResolver.ROLE );
source = resolver.resolveURI( fileName );
return builder.parse( new InputSource(
source.getInputStream() ));
}
catch (Exception x) {
logger.warn("XMLREsourceBundle: No excalibur-source " +
fileName,
x);
}
finally {
resolver.release( source );
manager.release( resolver );
}
Take a look at the ResourceExistsAction or latest (from CVS)
XMLResourceBundle for details.
Konstantin
From: "Chintalapaty, Sreedhar " <[EMAIL PROTECTED]>
Hi,
Can some one point me to an example of how we can access an xml file on the
file system from a custom Action?
TIA,
Sreedhar
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>