属性的内容得到了这份文件:命名空间节点 - 需要
<uniprot xmlns="http://uniprot.org/uniprot" xmlns:xsi="http://www.w3.org/2001/ XMLSchema-instance" xsi:schemaLocation="http://uniprot.org/uniprot http://www.uniprot.org/support/docs/uniprot.xsd">
<entry dataset="Swiss-Prot" created="1986-07-21" modified="2013-10-16" version="88">
<dbReference type="GO" id="GO:0006412">
<property type="term" value="P:translation"/>
<property type="evidence" value="IEA:InterPro"/>
</dbReference>
<dbReference type="HAMAP" id="MF_00294">
<property type="entry name" value="Ribosomal_L33"/>
<property type="match status" value="1"/>
</dbReference>
<dbReference type="InterPro" id="IPR001705">
<property type="entry name" value="Ribosomal_L33"/>
</dbReference>
现在,我使用这个抢节点的内部文本,它工作得很好...但是。 ..
XmlDocument XMLdoc = new XmlDocument();
XMLdoc.Load(Datapath);
XmlNamespaceManager nsmgr = new XmlNamespaceManager(XMLdoc.NameTable);
nsmgr.AddNamespace("ns", "http://uniprot.org/uniprot");
String NodeName = XMLdoc.SelectSingleNode("//ns:fullName", nsmgr).InnerText;
...我需要抓住的是否类型的内容是去还是不去,如果是,拿到确切的节点,即ID和值的以下数据的属性。一直在思考和搜索几个小时,我只是缺乏知识去任何地方。
当然是。我只删除了该文件的重要部分。这就是完整的样子:http://www.uniprot.org/uniprot/P30178.xml dbReference在那里有20次左右。我需要通过其属性挑选出dbReferene节点。如果type属性设置为“GO”(通常大约有3-10个包含“GO”),我需要该节点的其余部分和子节点。或者更确切地说:如果dbReference type ==“GO”获得该确切节点的dbReference id和子节点属性的value属性的内容。 – MeepMania