get data from an XML file

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

get data from an XML file

#1 Post by PedroAlex »

Hello gentlemens

Could someone share some example of how to open a xml file and read the xml tags and get data from that tags,
or
refer some technique to find the best way to do it.

Very thanks in advance.

best regards.
Pedro.
Pedro Alexandre

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: get data from an XML file

#2 Post by skiman »

Hi,

I'm using the free Chilkat activeX component.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: get data from an XML file

#3 Post by rdonnay »

Look at the samples in \exp19\samples\xml.

I use the DC_Xml2ObjectTree() and DC_XmlNode() functions.
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 231
Joined: Tue Feb 09, 2010 3:06 am

Re: get data from an XML file

#4 Post by PedroAlex »

Chris and Roger.
Thanks for feedback.

DC_Xml2ObjectTree and Dc_XmlNode is working for me .

here is a small sample just for share...

oTree := DC_Xml2ObjectTree( FileXML ) // FileXML is the source file XML
aDataSet := oTree:findNode( 'DataSet' ) // 'Dataset' is the root node
aTable := aDataSet:findNode( 'Table',.t. ) // 'Table' is the subnode

for i :=1 to len(aTable)
oNome := aTable:findNode('NOME')
cNome := oNome:content
oTel := aTable:findNode('TELEFONE')
cTel := oTel:content
oNif := aTable:findNode('NIF')
cNif := oNif:content
NEXT

Best Regards
Pedro
Pedro Alexandre

Post Reply