cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Hoskens">
Subject [woody & apples]Simple repeater binding
Date Wed, 14 Jan 2004 08:22:41 GMT

I'm trying to use a simple repeater in my binding with an xml document. When saving my document
I get the following error:

Exception trying to create xpath.... Factory is not set on the JXPathContext - cannot create
path: ....

I did a bit of sniffing and found a reply on a chain of mails that stated: (mail from  Sylvain
in reply to Timothy Larson )

   Actually, there's currently no use of this class in Cocoon samples, but I use it on my
projects. Here's how: in the flow, I don't load/save the DOM directly, but through a JXPathContext
as follows;

 var doc = readDocument(url);
 var bindingCtx = createBindingContext(doc);
  And here's the createBindingContext function:

  function createBindingContext(document) {
  // Create a JXPath context on the document.
  var xpathContext =;
  // Set it to lenient
  // Add the necessary factory create elements and attributes as needed on non-existing paths
  return xpathContext;

But I don't get how to do the same (as stated in the previous flowscript) in Apples. Where
do I create the context and how do I add it? The form stuff in Apples is somewhat different
than the flowscript, and hence I get a bit lost (not many docs on Apples, so always looking
through the api). I use Apples because of the more complex flow I have. (eg locking of files,
checking on timestamps, selecting pipelines based on datasource attributes...) I'm hoping
that I'm in the right direction with my choice of flow...(any comments on why to choose flowscript
or another flow would be interesting here;-)



View raw message