Page 1 of 1

If you use TXmlDocument:FindFirst()

Posted: Thu Jan 21, 2010 1:14 am
by xProgrammer
Hi all

I just tracked down a problem with some code I wrote using TXmlDocument:FindFirst() function. The xml data looked like this:

<TABLE>
<TABLE-NAME>Whatever</TABLE-NAME>

FindFirst( "TABLE-NAME" ) was not nil but its cData property was nil whereas it should be "Whatever". It turned out that FindFirst( "TABLE-NAME" ) was returning the <TABLE> node, ie cName was "TABLE" and cData was nil.

Once I discovered that I tried SET EXACT ON which fixed the problem. This dependance on the setting of SET EXACT isn't in my xHarbour documentation. Maybe I can save someone some trouble by mentioning it in this forum.

xProgrammer

Re: If you use TXmlDocument:FindFirst()

Posted: Fri Jan 22, 2010 5:01 pm
by thefull
Use expresion regular;
FindFirstRegex( "^TABLE-NAME$" )

Regards