cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "GUILLAUME Gabriel FTRD/DIH/HDM REN" <gabriel.guilla...@rd.francetelecom.com>
Subject RE: SourceResolver in Selector?
Date Wed, 02 Jul 2003 06:41:16 GMT

Hi,
I have developped a matcher that use a SourceResolver as follows 
1) My class implements the import org.apache.avalon.framework.component.Composable interface
2) I get the ComponentManager as follows
    /** The component manager instance */
    protected org.apache.avalon.framework.component.ComponentManager manager_;
	
    /**
     * Set the current <code>ComponentManager</code> instance used by this
     * <code>Composable</code>.
     */
    public void compose(org.apache.avalon.framework.component.ComponentManager aManager) throws
ComponentException 
	{
        manager_=aManager;
    	}
3) Then in the configure method (from the Configurable interface), I access to the (URLFactory)SourceResolver
via the component manager as follows

		String config_url="foo.xml";
		URLFactory url_factory = null;
            Source config_source = null;
            try 
		{
                url_factory = (URLFactory)this.manager_.lookup(URLFactory.ROLE);
                URLFactorySourceResolver urlResolver = new URLFactorySourceResolver(url_factory,
this.manager_);
                config_source = urlResolver.resolve(config_url);
			...
            } 
		catch (Exception e) 
		{
                throw new ConfigurationException("Cannot load configuration from " + config_url,
e);
            } 
		finally 
		{
                this.manager_.release(url_factory);
                if (config_source != null) {
                    config_source.recycle();
            }


Does it address your problem ?
Gabriel


-----Message d'origine-----
De : Paul Bowler [mailto:paulbowler@www.aventix.co.uk]
Envoyé : mardi 1 juillet 2003 16:25
À : cocoon-users@xml.apache.org
Objet : SourceResolver in Selector?


Anyone know how to resolve a URI within a selector?

No SourceResolver is passed to it, unlike a Transformer, and I'm trying to gain access to
a local XML file with no 
luck.

Thanks,

Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message