cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From holger.willenb...@armacell.com
Subject Re: Re: Getting XML data into Flowscript
Date Mon, 06 Feb 2006 20:53:29 GMT
Is loadDocument(String) a function that you implemented? I only got an 
error message.

Any hint appreciated

Regards
Holger

news <news@sea.gmane.org> schrieb am 06.02.2006 09:41:44:

> holger.willenborg@armacell.com wrote:
> > 
> > I am trying to extract data from a XML source (XML file or Cocoon 
> > pipeline) for use in  a flowscript (actually it's an XML file 
containing 
> > quiz questions and the correct answers. I need to extract the answers 
to 
> > test if the user selected the correct choice).
> > 
> > Any ideas?
> 
> Sure, you may use JXPath, like in:
> 
> importClass(Packages.org.apache.commons.jxpath.JXPathContext);
> 
> var collDoc= loadDocument("tmp/complete-" + locale +".wmcd");
> var collCtx=
> Packages.org.apache.commons.jxpath.JXPathContext.newContext(collDoc);
> var boundingBoxCtx= 
>    Packages.org.apache.commons.jxpath.JXPathContext.newContext(
>    collCtx, 
> 
collCtx.selectSingleNode("/collection/interface/General/Window/BoundingBox")
> );
> var srs= boundingBoxCtx.getValue("@SRS");
> 
> Regards,
> 
> --------------------
>     Luca Morandini
> www.lucamorandini.it
> --------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

Mime
View raw message