XML中如何通过属性获得对应节点中的内容

<?xml version="1.0" encoding="UTF-8"?>

<students>

<class id="st58">

<student>Jack1</student>

<student>Jack2</student>

<student>Jack3</student>

<student>Jack4</student>

</class>

<class id="st59">

<student>Tom1</student>

<student>Tom2</student>

<student>Tom3</student>

<student>Tom4</student>

</class>

<class id="st60">

<student>Mack1</student>

<student>Mack2</student>

<student>Mack3</student>

<student>Mack4</student>

</class>

</students>


如上:用DOM解析XML的时候,怎么用相应的id属性得到对应的student节点

HelloWord3
浏览 1296回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java