On Mon, 31 Oct 2005, Tony Maro wrote:
> Alexander Todorov wrote: > > ><document> > >.... > > <message>Hello word</message> > >.... > ></document> > > > >I did : > > > >ShowMessage(Document.FindNode('message').NodeValue) > >but it returns an empty string. Showing NodeName returns 'message'. > >How to get the contents of the <message> tag ???? Is it working ? > > > > > The real problem is that the computer recognized that it is NOT a true > "Hello World" message (word, not world) and it refused to display due to > the typo ;-) just kidding. > > As I recall, there's another child node in the object heiarchy when you > have text between the tags. It's a "#text" subnode to the "message" > node. Someone with more experience in that can expound. This is correct. The name of the node is '#text', it's NodeValue property contains the actual text. MsgNode:=Document.FindNode('message'); If MsgNode.FirstChild<>Nil then MsgText:=MsgNode.FirstChild.NodeValue; Should do more or less what you expect. Michael. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel