データサイズが非常に大きい XML ファイルがあります。
XMLファイルには含まれています
<us-bibliographic-data-grant>
<publication-reference>
<document-id>
<country>US</country>
<doc-number>D0607176</doc-number>
<kind>S1</kind>
<date>20100105</date>
</document-id>
</publication-reference>
<application-reference appl-type="design">
<document-id>
<country>US</country>
<doc-number>29327507</doc-number>
<date>20081107</date>
</document-id>
</application-reference>
<invention-title id="d0e55">Doughnut product with six appendages</invention-title>
<applicants>
<applicant sequence="001" app-type="applicant-inventor" designation="us-only">
<addressbook>
<last-name>Peters</last-name>
<first-name>Brian Jeffery</first-name>
<address>
<street>7052 Moonlight Cir.</street>
<city>Huntington Beach</city>
<state>CA</state>
<postcode>92647</postcode>
<country>US</country>
</address>
</addressbook>
<nationality>
<country>omitted</country>
</nationality>
<residence>
<country>US</country>
</residence>
</applicant>
</applicants>
</us-bibliographic-data-grant>
このような出力を取得するにはどうすればよいですか
last-name,first-name,street,city,state,postcode,country
peters,brian jeffery, 7052 moonlight cir.,huntington beach,CA,92647
私は XML についてまったく経験がありません。助けてください この XML コードには、<addressbook>
. では、最初の行ですべての属性を取得するにはどうすればよいでしょうかapplicant
。次の行にはすべての値が入力されます。後でcsvファイルをsqlにインポートしたいので、これを行いたいです。