3
我需要類似的結構解析XML,解析問題嵌套的標籤
<document>
<questions>
<question_id>1</question_id>
<cluster_id>1</cluster_id>
<question_name>question</question_name>
<question_hint>sample hint</question_hint>
<question_type>1</question_type>
<answers>
<option>answer</option>
<correct_answer>0</correct_answer>
<option>answer2</option>
<option>answer3</option>
<option>answer4</option>
</answers>
</questions>
<questions>
<question_id>2</question_id>
<cluster_id>1</cluster_id>
<question_name>Question 2</question_name>
<question_hint>sample hint</question_hint>
<question_type>1</question_type>
<answers>
<option>answer 1 for question 1</option>
<option>answer 2 for question 1</option>
<option>answer 2 for question 1</option>
<option>answer 2 for question 1</option>
<correct_answer>3</correct_answer>
</answers>
</questions></document>
我無法解析嵌套的標籤以獲得結構像 問題名稱: 正確答案: 方案一: 方案二: 方案三: 選項四:我用薩克斯到parse..but無法檢索的值作爲像上述結構 值..