If you use TXmlDocument:FindFirst()

Post Reply
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

If you use TXmlDocument:FindFirst()

Post 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
User avatar
thefull
Posts: 720
Joined: Fri Oct 07, 2005 7:42 am
Location: Barcelona
Contact:

Re: If you use TXmlDocument:FindFirst()

Post by thefull »

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

Regards
Saludos
Rafa Carmona ( rafa.thefullARROBAgmail.com___quitalineas__)
Post Reply