quarta-feira, 29 de abril de 2009

Xml - Clarion

Clarion code:
CC byte
Customer QUEUE !queue to storing imported data
LastName STRING(30)
Phone STRING(30)
END
NameMap QUEUE(MapQueue) !queue with name mapping information
END
code
!Import data from file Customer.xml to Customer QUEUE.
!Destination QUEUE contains only LastName, Phone fields so data only for these
!fields is imported
cc = FromXMLFile(Customer,’Customer.xml’)
if (CC)
!Export data from Customer QUEUE to a file with name mapping
! Loading name mapping information from NAMEMAP.XML
CC=FromXMLFile(NameMap,’NameMap.xml’)
IF(CC)
CC = ToXMLFile(Customer,’CustomerData.xml’,NameMap)
IF(NOT CC)
STOP(‘Exporting error’)
END
ELSE
STOP(‘NameMap.xml importing error’)
END
ELSE
STOP(‘Customer.xml importing error’)
END
The result file

Nenhum comentário:

Postar um comentário