DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15431>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15431

[i18n] making XMLResourceBundle cocoon-izable

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|Blocker                     |Enhancement



------- Additional Comments From [EMAIL PROTECTED]  2002-12-17 08:45 -------
I used the diff tool for my first time and just followed the steps outlined
at the cocoon how-to. Anyway my enhancements take place at the method between
the Begin/ End Cocoonize:

    /**
     * Load the DOM tree, based on the file name.
     *
     * @param fileName          name of the XML source file
     * @return the DOM tree
     * @exception IOException   if an IO error occurs while reading the file
     * @exception ParserConfigurationException if no parser is configured
     * @exception SAXException  if an error occurs while parsing the file
     */
    protected synchronized Document loadResourceBundle(String fileName)
        throws IOException, ParserConfigurationException, SAXException {

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        // Begin Cocoonize
        // FIXME: Is this the best way to check the format?!
        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 );
        }
        // End Cocoonize
        return builder.parse(fileName);
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to