我有一个具有这种结构的 xml 文件:
<a>
<b attribute="54" name="Bob" ... >
<c name="Foo" stuff="89" attr="First line
Second line" ... />
<c name="Bar" stuff="23" attr="Blahs" ... />
...
</b>
...
</a>
我想在 csv 文件中获取这些数据,如下所示:
b_attribute, b_name, ... , c1_name, c1_stuff, c1_attr ... , c2_name, c2_stuff, c2_attr ...
"54", "Bob", ..., "Foo", "89", "First line
Second line", ..., "Bar", "23", "Blahs", ...
一些标签的值可能包含 html 逗号和引号。