FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour If you use TXmlDocument:FindFirst()
Posts: 464
Joined: Tue May 16, 2006 07:47 AM
If you use TXmlDocument:FindFirst()
Posted: Thu Jan 21, 2010 01:14 AM

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

Posts: 731
Joined: Fri Oct 07, 2005 07:42 AM
Re: If you use TXmlDocument:FindFirst()
Posted: Fri Jan 22, 2010 05:01 PM

Use expresion regular;
FindFirstRegex( "^TABLE-NAME$" )

Regards

Saludos

Rafa Carmona ( rafa.thefullARROBAgmail.com___quitalineas__)

Continue the discussion