XML Reader

Post Reply
User avatar
modicr
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia
Contact:

XML Reader

Post by modicr »

Hello!

Is there an XML reader for Harbour/FWH available?
Maybe something like PHP XMLReader pull parser:

http://www.ibm.com/developerworks/libra ... ngphp.html

Thanks, Roman
© I'm not patented!
User avatar
frose
Posts: 327
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Gütersloh
Contact:

Re: XML Reader

Post by frose »

Roman,

I'm using TXmlDocument() to read from a XML file.

From the documentation:
Description
The TXmlDocument() class provides objects for reading and creating XML files. XML stands for eXtensible Markup Language which is similar to HTML, but designed to describe data rather to display it. To learn more about XML itself, the internet provides very good free online tutorials. The website http://www.w3schools.com is is a good place to quickly learn the basics on XML.
A TXmlDocument object maintains an entire XML document and builds from it a tree of TXmlNode() objects which contain the actual XML data. The first XML node is stored in the :oRoot instance variable, which is the root node of the XML tree. Beginning with the root node, an XML document can be traversed or searched for particular data. The classes TXmlIteratorScan() and TXmlIteratorRegEx() are available to find a particular XML node, based on its tag name, attribute or data it contains.
But it's an extension for xHarbour not for Harbour :(
User avatar
IBTC
Posts: 103
Joined: Sat Oct 18, 2008 8:13 pm
Location: Stuttgart, Germany
Contact:

Re: XML Reader

Post by IBTC »

frose wrote:I'm using TXmlDocument() to read from a XML file.
me too.
frose wrote:But it's an extension for xHarbour not for Harbour :(
It is also available for Harbour. You only have to include xhb.lib, see also e.g. contrib/xhb/tests/xml1.prg
Best Regards,
Ruediger Alich

---
HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Re: XML Reader

Post by xProgrammer »

Hi Roman

I use TXml_Document class a lot in my Harbour code and have found it to be very good. Make sure you also check out the TXML_Iter* classes. It's really quite powerful and easy to use.

Regards
Doug
User avatar
modicr
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia
Contact:

Re: XML Reader

Post by modicr »

Hello!

I have installed xHarbour 1.21 from http://free.xharbour.com/free.xHarbour. ... loads.html
but there is no xhb.lib. There are only rtl.lib, rtlmt.lib, harbour.lib and many others ...

Regards, Roman
© I'm not patented!
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Re: XML Reader

Post by xProgrammer »

Hi Roman

My understanding is that as you are using xHarbour rather than Harbour you wouldn't have and wouldn't need xhb.lib because it is a Harbour library to provide Harbour users with xHarbour compatability.

Regards
Doug
User avatar
modicr
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia
Contact:

Re: XML Reader

Post by modicr »

Aha, now I understand ... I use "Harbour 1.0.1dev Intl. (Rev. 9361)" and there is no xhb.lib inside it. So I thought that xhb.lib is part of xHarbour so I've installed it. But the truth is that I must use newer harbour. What is the latest that is compatible with FWH 9.01?

Thanks, Roman
© I'm not patented!
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Re: XML Reader

Post by xProgrammer »

Hi Roman

I am using Harbour 2.0.0 (which most definitely has the xhb library) but I am using it under 64 bit Linux so I can't answer your latest question in any detail. But I am sure Antonio can.

Regards
Doug
Post Reply