cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
Subject Manipulating the DOM in flowscript
Date Fri, 26 Nov 2004 12:45:56 GMT
Simple question; I need to extract/change data coming
from a Cform after it has been updated, but before
it is saved to file.  So, typically, it looks like this:

  var document = loadDocument(documentID);     
  form.load(document); 
  form.showForm("mypipe");
  form.save(document);

Now a call like:

  var keyNode = document.firstChild;

is valid, but a call like:
    var keyNode = document.firstChild.firstChild;
    if (keyNode != null) {
      document.insertBefore(keyNode,keyNode);
    }

gives an error for the insert operation.
org.w3c.dom.DOMException: NOT_FOUND_ERR: 
An attempt is made to reference a node in a context where it does not
exist.
(and simlar for other types of chnage operations, in fact)

So, how does one actually manipulate the document being 
returned  from the form?

Thanks
Derek

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


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


Mime
View raw message