[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]