cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject DOM Help
Date Tue, 27 Jun 2000 08:54:30 GMT
Dear All,

I am struggling with the DOM.

TextNodes, Hmmm

If I have this XML:


If I want to get the "content" String, what is the most efficient way of
doing it? I hope it is simpler than I think ...

What I understand is I get the "tag" node, then loop through it's children
to get the TextNode(s) inside, and there might be several because of line

Conversly, if I want to create the above XML, I create the "tag", then
create a TextNode inside, correct?

I hope I have got this all wrong, because this is rather nasty! :)

If I have this XML:

		paragraph one
		paragraph two

And I want to pass the whole contents (<p> heirarchy as well) to a String
to be put into a form field, then have the edited content put back as XML.

With a reference to the "tag" Node, what is the best way to read out and
write back in, keeping the inner tags intact.

I am waiting for my order of the XML Java book!

Thanks for any help in the meantime.

regards Jeremy

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <>     		 <>
    <phone:+44.[0].20.7737.6831>        <>

View raw message