0
私は以下のXMLファイルを解析する必要があります。person_type値が1の生徒のファーストネームを選択する必要があります。私は私のJavaプロジェクトでdom4jを使用しています。私はperson_typeの値に基づいてファーストネームを抽出するソリューションを見つけることができません。どんな助けもありがとう。条件に基づいてDom4jを使用してxmlを解析する
<?xml version="1.0"?>
<class>
<student>
<firstname>dinkar</firstname>
<lastname>kad</lastname>
<nickname>dinkar</nickname>
<marks>85</marks>
<person_types>
<person_type>1</person_type>
<person_description>POC</person_description>
</person_types>
</student>
<student>
<firstname>Vaneet</firstname>
<lastname>Gupta</lastname>
<nickname>vinni</nickname>
<marks>95</marks>
<person_types>
<person_type>1</person_type>
<person_description>Assistant</person_description>
</person_types>
</student>
<student>
<firstname>jasvir</firstname>
<lastname>singn</lastname>
<nickname>jazz</nickname>
<marks>90</marks>
<person_types>
<person_type>1</person_type>`
<person_description>Leader</person_description>
</person_types>
</student>
</class>
それをグーグル。何百もの解決策があります – efekctive
ありがとうございます... –