cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Cain" <>
Subject RE: do not quote!
Date Thu, 06 Jul 2000 08:57:16 GMT
Torsten Curdt,

> Hm... so there's no way of returning something that goes back into
> the XML parsing process?! :-(

I'm afraid not.

> Well, I want to add some child nodes to the current node
> and -if possible- let cocoon do the parsing job!
> But now I fear the parsing has already happened at that time...
> Right?!

I'm afraid so.

> Hm.. why should I pass the document object to my method?!
> What is the parameter of appendChild ?

If you are going to add a child node to an element, the node must be created
by the same document as the element, or else an exeption is thrown. So by
passing the document into your method, you can use the document to create a
node that can be added to xspCurrentNode.

> Any idea how I can include external xml data as fast
> as possible ?! (maybe passing a tree instead of a string
> and add a complete subtree instead of each child?!)

You can build an entire tree in your method and return the node to be added.
If your method produces an element, you can just appendChild() that to
xspCurrentNode. But, if you want to add multiple siblings all at once, then
you should use a DocumentFragment. Read up on it if you don't know about it.
It's quite useful.

Jay Cain
Lead Developer
eNetSouth, LLC

View raw message