XML 要素(タグ)の内容が空白のときの構造体読み込み
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
XMLで、それぞれのみタグで、内容が空白になっているところがあります。xmlreadで読み込むこんだあと、構造体で、タグの内容を正しく読み込みむことができません。
以下の、XMLの太字・アンダーバーだと、 <ChNameJp></ChNameJp>になっていると、ChNameEnが空白として、構造体で読み込まれます。本来は、ChNameJPは"[]"、ChNameEnは、"Banana"で読み込みたいですが、
ChNameJPは"[]"、ChNameEnは、"[]"となってしまいます。対応を、ご教授いただけると幸いです。
<fruits Min="3">
<Ch No="1">
<No>1</No>
<UnitComment>青森</UnitComment>
<Protect>False</Protect>
<ChNameJp>りんご</ChNameJp>
<ChNameEn>Apple</ChNameEn>
<Comment>red</Comment>
</Ch>
<Ch No="2">
<No>2</No>
<UnitComment>秋田</UnitComment>
<Protect>False</Protect>
<ChNameJp></ChNameJp>
<ChNameEn>Banana</ChNameEn>
<Comment>黄</Comment>
</Ch>
<Ch No="3">
<No>3</No>
<UnitComment>山梨</UnitComment>
<Protect>False</Protect>
<ChNameJp>もも</ChNameJp>
<ChNameEn>Peach</ChNameEn>
<Comment>Peach</Comment>
</Ch>
</fruits>
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur 構造化データと XML ドキュメント dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!