cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject Re: Manipulating the DOM in flowscript
Date Tue, 30 Nov 2004 06:18:22 GMT

Thanks for the clarification on the syntax; as I did point
out in the post where I stated the problem - that was 
just an *example* of something I had tried; not all the 
other attempts were in that format or with that specific 
DOM call or syntax....  but nothing I tried would work - 
hence I  assumed the problem might be with the way that 
the DOM calls (in general) work inside flow or with how 
I was  attempting to tackle manipulation of forms data
(and I don't think that was an unreasonable assumption;
yes, I did read some guidelines on working with DOM in
Javascript - obviously I botched the specifics in the case
that was posted).  I have already posted elsewhere that
while this may have turned out not to be a *pure* Cocoon 
problem, at the time I encountered it, I think it did classify
as such because I was uncertain as to what the cause was 
(for example, we also often answer simple XSLT questions).  

My 0.5c

>>> 2004/11/29 08:36:17 PM >>>
> I think what is fundamentally wrong is your comprehansion of DOM.
> you're trying to do:
>  >      document.insertBefore(keyNode,keyNode);
> makes absolutely no sense to me, and probably to DOM. What does it
> "to insert a node before itself"???

Yes - you'd never use the same node as arguments to insertBefore.  If
I understand the API you would use insertBefore like this:

<name>Brent Johnson</name>
<occupation>Web Developer</occupation>

if "newChild" is a reference to a node with child nodes like
"<id>4</id>" and refChild is a reference to the "<name>" node then a
call to:

document.insertBefore(newChild, refChild);

Would have a result of something like:

<name>Brent Johnson</name>
<occupation>Web Developer</occupation>

I've never used it.. but that seems to be what the DOM API says.  Per
the API:
"Inserts the node newChild before the existing child node refChild. If
refChild is null, insert newChild at the end of the list of children.

Hope that helps... and I agree that this isnt a Cocoon problem and you
should probably read the DOM Java API a little closer before posting a
Java Exception to this mailing list.  Just my 2 cents.

- Brent

To unsubscribe, e-mail: 
For additional commands, e-mail: 

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:
For additional commands, e-mail:

View raw message