Title: Re: Manipulating the DOM in flowscript

Hi guys,
I wrote a simple wiki page about creating and editing xml documents
using flow:
http://wiki.apache.org/cocoon/FlowBasedXMLEditor

I attached a little flowscript file which exposes most of the DOM api
calls in flow. It might be a little vague as it was written for an
application with a specific purpose and is in no way generic enough but
it will give you some clues about manipulating DOM objects in flow.

Regards,
Tony

Brent Johnson wrote:

> > I think what is fundamentally wrong is your comprehansion of DOM. What
> > you're trying to do:
> >
> >  >      document.insertBefore(keyNode,keyNode);
> >
> > makes absolutely no sense to me, and probably to DOM. What does it mean
> > "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:
>
> <person>
> <name>Brent Johnson</name>
> <occupation>Web Developer</occupation>
> </person>
>
> 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:
>
> <person>
> <id>4</id>
> <name>Brent Johnson</name>
> <occupation>Web Developer</occupation>
> </person>
>
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

---------------------------------------------------------------------
This email is from Civica Pty Limited and it, together with any attachments, is confidential to the intended recipient(s) and the contents may be legally privileged or contain proprietary and private information. It is intended solely for the person to whom it is addressed. If you are not an intended recipient, you may not review, copy or distribute this email. If received in error, please notify the sender and delete the message from your system immediately.

Any views or opinions expressed in this email and any files transmitted with it are those of the author only and may not necessarily reflect the views of Civica and do not create any legally binding rights or obligations whatsoever. Unless otherwise pre-agreed by exchange of hard copy documents signed by duly authorised representatives, contracts may not be concluded on behalf of Civica by email.

Please note that neither Civica nor the sender accepts any responsibility for any viruses and it is your responsibility to scan the email and the attachments (if any). All email received and sent by Civica may be monitored to protect the business interests of Civica.

---------------------------------------------------------------------

Reply via email to