[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-cocoon-users
Subject:    Re: reading xml from pipeline into a flow script
From:       Simon Price <simon.price () bristol ! ac ! uk>
Date:       2003-06-30 14:33:18
[Download RAW message or body]

Thanks. I was glad of any solution at midnight on saturday, but I'll 
watch to see how the fom evolves as you advise. Thanks.

Simon

Reinhard Pötz wrote:
> This will work but not with the upcoming Flow Object Model. You won't
> have access to the environment any more. If you are interested in the
> FOM you find a reference here:
> http://wiki.cocoondev.org/Wiki.jsp?page=FOM (be aware that this is a
> working document and may change!!!)
> 
> So currently the easiest way is
> {
> ...
>      var uri = "cocoon://blablabla";
> 	var resolver = cocoon.componentManager.lookup(
> Packages.org.apache.cocoon.environment.SourceResolver.ROLE );
> 	var srce = resolver.resolveURI( uri );
> 	cocoon.componentManager.release( resolver );
> 	var dom =
> Packages.org.apache.cocoon.components.source.SourceUtil.toDOM( srce );
> ...
> }
> 
> which will probably change with FOM to
> 
> {
> ...
>      var uri = "cocoon://blablabla";
> 	var resolver = cocoon.getComponent(
> Packages.org.apache.cocoon.environment.SourceResolver.ROLE );
> 	var srce = resolver.resolveURI( uri );
> 	// release of the component (not defined yet
> 	var dom =
> Packages.org.apache.cocoon.components.source.SourceUtil.toDOM( srce );
> ...
> }
> 
> Hope this helps!
> 
> Reinhard
> 
> 
> 
> 
>>-----Original Message-----
>>From: Frank Taffelt [mailto:frank.taffelt@interface-business.de] 
>>Sent: Monday, June 30, 2003 9:34 AM
>>To: cocoon-users@xml.apache.org
>>Subject: Re: reading xml from pipeline into a flow script
>>
>>
>>you can use this snippet:
>>
>>function getString(src) {
>>    try {
>>         var is =  
>>cocoon.environment.resolveURI(src).getInputStream();
>>         return 
>>Packages.org.apache.cocoon.components.language.markup.xsp.XSPU
>>til.getContent
>>s(is);
>>    }
>>    catch(ex) {
>>        print("ex:" + ex);
>>    }
>>    return null;
>>
>>
>>}
>>
>>
>>---------------------------------------------------------------------
>>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
> 
> 


-- 

-------------------------------------------------------------------
Simon Price
Institute for Learning and Research Technology
University of Bristol
8-10 Berkeley Square
Bristol BS8 1HH
United Kingdom

Direct: +44 (0)7071 226 720
Office: +44 (0)117 928 7193
Fax: +44 (0)117 928 7112
Simon.Price@bristol.ac.uk
http://www.ilrt.bristol.ac.uk


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic