我有以下xml:
<?xml version="1.0" encoding="UTF-8"?>
<video contenttype="asf" fileextension=".wmv" hascontent="no" lang="en-GB" length="430" pid="45202118763477" sid="">
<lastmodified timestamp="1366113600000">
Tue, 16 Apr 2013 12:00:00 +0000
</lastmodified>
<links/>
<keywords/>
<slides/>
<copyright>
Copyright owned by original broadcaster
</copyright>
<title>
BBC News
</title>
<comment>
The latest news updates from around the world.
</comment>
<author>
BBC World Sv_
</author>
<email/>
<captioning/>
<extendeddata>
<data name="keepOriginal">
0
</data>
<data name="keepTranscoded">
0
</data>
<data name="realStartTime">
1366113604
</data>
<data name="scheduledStartTime">
1366113600
</data>
<data name="broadcastLength">
360
</data>
<data name="broadcastChannel">
BBC World Sv_
</data>
<data name="paddingUsed">
0
</data>
<data name="transcodingSpec"/>
<data name="transcoding">
succeeded
</data>
<data name="transcodingProfile">
-b 2.35M -a 128k --debug --primary-format mp4 --podcast "-l 270 -b 400 -R 48 -B 64" --keep-files true
</data>
<data name="transcoderDetails">
ver 1.58.2.5, 2013-04-16 13:08:08 up 42 days, 12:00, 0 users, load average: 0.35, 0.13, 0.07, OS20031 212.70.71.204
</data>
<data name="originalFilename">
/var/lib/etvd/mpegts/BBC World Sv_/BBC News (16-Apr-2013 13.00).emcast
</data>
<data name="originalRecordingTime">
created 2013-04-16 , last modified 2013-04-16 : recording lasted 0s
</data>
<data name="primaryFormat">
mp4
</data>
<data name="doXml">
True
</data>
<data name="doFiles">
True
</data>
</extendeddata>
<categories>
<category name="em:podcast">
mp4
</category>
</categories>
</video>
使用 XDocument,我可以进入<extendeddata>
返回所有数据节点和值的精细的后代,但是我如何根据数据属性的名称专门获取一个值?因此,例如,我想进入一个特定的元素,例如:<data-name="realStartTime">1366113604</data>
1366113604 作为我想退出的值。
干杯