以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DOM/SAX/XPath 』  (http://bbs.xml.org.cn/list.asp?boardid=11)
----  请教一个问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=11&rootid=&id=56464)


--  作者:aksean
--  发布时间:12/6/2007 5:17:00 PM

--  请教一个问题
有如下XML
<PlayerData  pageNum = 478>
  <Player>
    <PlayerID>532</PlayerID>
    <FirstName>Francesc</FirstName>
    <LastName>Fabregas</LastName>
    <CNName>法布雷加斯</CNName>
    <PlayerNumber>4</PlayerNumber>
    <Position>中场</Position>
    <TeamID>1</TeamID>
    <TeamName>阿森纳</TeamName>
    <TeamLogo>s_Arsenal.gif</TeamLogo>
    <PlayerScoringSum>176.00</PlayerScoringSum>
    <PlayerScoringSunRate>0</PlayerScoringSunRate>
    <Goals>4</Goals>
    <Assists>6</Assists>
    <Saves>0</Saves>
    <Goalsconcededs>6</Goalsconcededs>
    <PlayedMinutes>790</PlayedMinutes>
    <YellowCards>2</YellowCards>
    <RedCards>0</RedCards>
    <MVP>30</MVP>
    <MVPCount>6</MVPCount>
    <MainPlayedCount>9</MainPlayedCount>
    <BenchPlayedCount>0</BenchPlayedCount>
    <OwnedCount>0</OwnedCount>
    <PenaltiesSaveds>0</PenaltiesSaveds>
    <PenaltiesMisseds>0</PenaltiesMisseds>
    <OriginalValue>22.12</OriginalValue>
    <PlayerValue>23.00</PlayerValue>
    <RowIndex>1</RowIndex>
  </Player>
  <Player>
    <PlayerID>745</PlayerID>
    <FirstName>Blumer</FirstName>
    <LastName>Elano</LastName>
    <CNName>埃兰诺</CNName>
    <PlayerNumber>11</PlayerNumber>
    <Position>中场</Position>
    <TeamID>7</TeamID>
    <TeamName>曼城</TeamName>
    <TeamLogo>s_ManCity.gif</TeamLogo>
    <PlayerScoringSum>176.00</PlayerScoringSum>
    <PlayerScoringSunRate>0</PlayerScoringSunRate>
    <Goals>4</Goals>
    <Assists>5</Assists>
    <Saves>0</Saves>
    <Goalsconcededs>5</Goalsconcededs>
    <PlayedMinutes>816</PlayedMinutes>
    <YellowCards>1</YellowCards>
    <RedCards>0</RedCards>
    <MVP>22</MVP>
    <MVPCount>4</MVPCount>
    <MainPlayedCount>10</MainPlayedCount>
    <BenchPlayedCount>0</BenchPlayedCount>
    <OwnedCount>0</OwnedCount>
    <PenaltiesSaveds>0</PenaltiesSaveds>
    <PenaltiesMisseds>0</PenaltiesMisseds>
    <OriginalValue>14.36</OriginalValue>
    <PlayerValue>16.16</PlayerValue>
    <RowIndex>2</RowIndex>
  </Player>
</PlayerData>

selectNodes方法取所有player下的节点如何取, pageNum又如何取得呢?
pageNum是用SetAttribute方法添加进去的.


--  作者:Qr
--  发布时间:12/7/2007 6:16:00 PM

--  
selectNodes("*")
getAttribute("pageNum")

具体看MSXML DOM帮忙文档。


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
50.781ms