cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: Reading XML data from flowscript
Date Thu, 08 Jul 2004 08:20:41 GMT
Derek Hohls wrote:

> Is there is a simple function in flow script that 
> will allow me to:
> - access a specified XML file (say, passed as a 
> request/sitemap parameter)
you can get DOM from supplied uri via this code:

> 	var resolver = null;
> 	var source = null;
> 	try {
> 		resolver = cocoon.getComponent( SourceResolver.ROLE );
> 		source = resolver.resolveURI( yourURI ); 
> 		var document = SourceUtil.toDOM( source );
> 		
 >		// process your document here
> 	} finally { 
> 		if ( resolver != null ) { 
> 			if ( source != null )  
> 				resolver.release( source );
> 			cocoon.releaseComponent( resolver );
> 		}
> 	}

> - read in one or nodes from the file and store
> these as flowscript variables.
use XPathApi
http://xml.apache.org/xalan-j/apidocs/org/apache/xpath/XPathAPI.html

> 
> Thanks
> Derek
> 


-- 
Leszek Gawron                                      lgawron@mobilebox.pl
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65


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


Mime
View raw message