cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <je...@media.demon.co.uk>
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:

<tag>
	content
</tag>

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
feeds?

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:

<tag>
	<p>
		paragraph one
	</p><p>
		paragraph two
	</p>
</tag>

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

   <mailto:sharkbait@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pager:jermq@sms.genie.co.uk>

Mime
View raw message