一个XML文档<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="/include/template.xsl"?>
<Topic>
<Issue>
<Keyword>rich_8</Keyword>
<Header>111</Header>
<OnlineTime>2005-12-22</OnlineTime>
<Time>2005-12-22 10:02:58</Time>
<HeaderImageFileName></HeaderImageFileName>
<Brief>111</Brief>
<BriefImageFileName></BriefImageFileName>
<BriefUrl></BriefUrl>
<Content><![CDATA[
111
]]></Content>
</Issue>
</Topic>在C#里怎么读出第二行href="/include/template.xsl"的值?谢谢各位高手!!
<?xml-stylesheet type="text/xsl" href="/include/template.xsl"?>
<Topic>
<Issue>
<Keyword>rich_8</Keyword>
<Header>111</Header>
<OnlineTime>2005-12-22</OnlineTime>
<Time>2005-12-22 10:02:58</Time>
<HeaderImageFileName></HeaderImageFileName>
<Brief>111</Brief>
<BriefImageFileName></BriefImageFileName>
<BriefUrl></BriefUrl>
<Content><![CDATA[
111
]]></Content>
</Issue>
</Topic>在C#里怎么读出第二行href="/include/template.xsl"的值?谢谢各位高手!!
doc.Load("yourxml.xml");XmlProcessingInstruction _xpi = (XmlProcessingInstruction)doc.ChildNodes[1];
//不能直接取到href,只能是type和href都取到,然后再处理这个字符串取到你的值
Console.WriteLine(_xpi.Data);