Luc,

 

As far as I know R:base can take care of a XML-file which is based upon
tables / columns. I have implemented it years ago.

But this kind of file - which is quite normal for an XML file -probably
needs another aproach.

 

First of all, take care of the UTF-8 format. Normally I convert it on
beforehand to Win-1252 .

Then, have a look at the complete XML structure (XSD scheme). If I am right
there are detailrows in your file, could there more than one detailrow in a
file?

 

My first thought is:

Convert the file to win1252

Load the file into a (temp) table

Create a procedure, which loads the data row by row, extract the needed data
from the file and put them into the right table.

In this way you are perfectly in control, but it will take some time to
develop the procedure.

 

However, as you might know, there are many roads which lead to Rome.

Pobably there is a better and shorter solution

 

Tony

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Luc
Delcoigne
Sent: dinsdag 8 oktober 2013 11:53
To: RBASE-L Mailing List
Subject: [RBASE-L] - re: reading/importing xml file

 

HI, 

 

After I managed to succesfully write data from R:base to a XML-file, now I
have to do the opposite: reading a XML-file and importing the data in
R:Base.

 

The xml-file looks like this :

 


<?xml version="1.0" encoding="UTF-8"?>
-<SingleInsurabilityResponse Version="01" TestFlag="false"
Synchronous="true" SenderReference="00007073293112"
ReceiverReference="99978679251" MessageName="M801900" 

Duplicate="false" xmlns="urn:be:cin:mycarenet:1.0:carenet:types">

-<CareReceiverDetail>

<Inss>60082918963</Inss>

<FirstName>LUC</FirstName>

<LastName>DELCOIGNE</LastName>

<Birthday>1960-08-29</Birthday>

<Sex>male</Sex>

</CareReceiverDetail>

-<InsurabilityResponseDetail>

-<Payment>

<PaymentByIo>false</PaymentByIo>

<SpecialSocialCategory>false</SpecialSocialCategory>

</Payment>

-<InsurabilityList Truncated="false">

-<InsurabilityItem>

<RegNrWithMut>9000736950883</RegNrWithMut>

<Mutuality>407</Mutuality>

-<Period>

<PeriodStart>2013-10-06</PeriodStart>

<PeriodEnd>2013-10-06</PeriodEnd>

</Period>

<CT1>410</CT1>

<CT2>460</CT2>

<InsurabilityDate>2013-10-07</InsurabilityDate>

</InsurabilityItem>

</InsurabilityList>

</InsurabilityResponseDetail>

-<InsurabilityRequestDetail>

<InsurabilityRequestType>information</InsurabilityRequestType>

-<Period>

<PeriodStart>2013-10-06</PeriodStart>

<PeriodEnd>2013-10-06</PeriodEnd>

</Period>

<InsurabilityContactType>ambulatory_care</InsurabilityContactType>

</InsurabilityRequestDetail>

</SingleInsurabilityResponse>

 

Any ideas how I could do this in the most elegant way ?

 

Thanks a lot !!

 

Luc Delcoigne

Reply via email to