4
我是XML新手,所以我希望得到您的幫助。 我有以下XML:如何獲取不同值的節點XML
<?xml version="1.0" encoding="UTF-8"?>
<Students> -<Student Id="001">
<Name>Peter</Name>
<LastName>Kohen</LastName> -<Courses> -<Course Id="01">
<Name>C#</Name>
</Course> -<Course Id="02">
<Name>Java</Name>
</Course>
</Courses>
</Student> -<Student Id="002">
<Name>Nick</Name>
<LastName>Nikes</LastName> -<Courses> -<Course Id="02">
<Name>Java</Name>
</Course> -<Course Id="03">
<Name>Oracle</Name>
</Course>
</Courses>
</Student> -<Student Id="003">
<Name>Rafi</Name>
<LastName>rafifa</LastName> -<Courses> -<Course Id="02">
<Name>Java</Name>
</Course> -<Course Id="03">
<Name>Oracle</Name>
</Course>
</Courses>
</Student> -<Student Id="004">
<Name>Yosi</Name>
<LastName>Koen</LastName> -<Courses> -<Course Id="04">
<Name>SQL</Name>
</Course> -<Course Id="03">
<Name>Oracle</Name>
</Course>
</Courses>
</Student>
</Students>
我需要知道兩件事情:
- 所有課程
- 有多少學生每門課程的學習化。
嗨,你用什麼編程語言? – Napsteur
您可以將XML作爲XML代碼發佈(縮進以獲取代碼標籤)。此外,你應該說明你想用什麼來獲取你的數據,我假設XPath是因爲你的標籤。如果是這樣,請說明。另外,你到現在爲止嘗試過什麼? –