Feb-23-2019, 11:30 AM
hi,
I'm pretty new in Python.
ddi xml files available in the microdata service of the International Labour Organization.I downloaded these to my computer.
I want to parse these xml files with python and export to csv or excel.
Since the sample content is too long, I didn't copy it here.
I'm giving the linkhttps://www.ilo.org/surveydata/index.php...g/ddi/1357
How can I parse all xml tags?
How can I parse all the features.
I had a lot of attempts, but I wasn't successful.
I wanted to use namespace but it didn't happen.
result none always
Variable is defined in the last section of the same variable for more than one category of code to combine them into a single cell is possible to print
Example:
<var ID="V210" name="educ" files="F3" dcml="0" intrvl="discrete">
<location StartPos="25" EndPos="25" width="1" RecSegNo="1"/>
<labl>
Respondent education level
</labl>
<valrng>
<range UNITS="REAL" min="1" max="5"/>
</valrng>
<sumStat type="vald">
1000
</sumStat>
<sumStat type="invd">
0
</sumStat>
<sumStat type="min">
1
</sumStat>
<sumStat type="max">
5
</sumStat>
<catgry>
<catValu>
1
</catValu>
<labl>
completed primary or less
</labl>
<catStat type="freq">
662
</catStat>
</catgry>
<catgry>
<catValu>
2
</catValu>
<labl>
secondary
</labl>
<catStat type="freq">
291
</catStat>
</catgry>
<catgry>
<catValu>
3
</catValu>
<labl>
completed tertiary or more
</labl>
<catStat type="freq">
46
</catStat>
</catgry>
<catgry>
<catValu>
4
</catValu>
<labl>
(dk)
</labl>
<catStat type="freq">
0
</catStat>
</catgry>
<catgry>
<catValu>
5
</catValu>
<labl>
(rf)
</labl>
<catStat type="freq">
1
</catStat>
</catgry>
<varFormat type="numeric" schema="other"/>
</var>
Thank you in advance for your help
I'm pretty new in Python.
ddi xml files available in the microdata service of the International Labour Organization.I downloaded these to my computer.
I want to parse these xml files with python and export to csv or excel.
Since the sample content is too long, I didn't copy it here.
I'm giving the linkhttps://www.ilo.org/surveydata/index.php...g/ddi/1357
How can I parse all xml tags?
How can I parse all the features.
I had a lot of attempts, but I wasn't successful.
I wanted to use namespace but it didn't happen.
result none always
Variable is defined in the last section of the same variable for more than one category of code to combine them into a single cell is possible to print
Example:
<var ID="V210" name="educ" files="F3" dcml="0" intrvl="discrete">
<location StartPos="25" EndPos="25" width="1" RecSegNo="1"/>
<labl>
Respondent education level
</labl>
<valrng>
<range UNITS="REAL" min="1" max="5"/>
</valrng>
<sumStat type="vald">
1000
</sumStat>
<sumStat type="invd">
0
</sumStat>
<sumStat type="min">
1
</sumStat>
<sumStat type="max">
5
</sumStat>
<catgry>
<catValu>
1
</catValu>
<labl>
completed primary or less
</labl>
<catStat type="freq">
662
</catStat>
</catgry>
<catgry>
<catValu>
2
</catValu>
<labl>
secondary
</labl>
<catStat type="freq">
291
</catStat>
</catgry>
<catgry>
<catValu>
3
</catValu>
<labl>
completed tertiary or more
</labl>
<catStat type="freq">
46
</catStat>
</catgry>
<catgry>
<catValu>
4
</catValu>
<labl>
(dk)
</labl>
<catStat type="freq">
0
</catStat>
</catgry>
<catgry>
<catValu>
5
</catValu>
<labl>
(rf)
</labl>
<catStat type="freq">
1
</catStat>
</catgry>
<varFormat type="numeric" schema="other"/>
</var>
Thank you in advance for your help