If you use TXmlDocument:FindFirst()

If you use TXmlDocument:FindFirst()

Postby xProgrammer » Thu Jan 21, 2010 1: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
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Re: If you use TXmlDocument:FindFirst()

Postby thefull » Fri Jan 22, 2010 5:01 pm

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

Regards
Saludos
Rafa Carmona ( rafa.thefullARROBAgmail.com___quitalineas__)
User avatar
thefull
 
Posts: 729
Joined: Fri Oct 07, 2005 7:42 am
Location: Barcelona


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 19 guests