0

このドキュメントを取得しました:

<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;

... の属性を取得し、型のコンテンツが GO かどうかを取得する必要があります。そうであれば、その正確なノードの次のデータ、つまり ID と値を取得します。これについて数時間考えてグーグルで調べていましたが、どこにでも行くための知識が不足しています。

4

2 に答える 2

0

実際に私は問題を解決することができました:

            XmlNodeList Testi = XMLdoc.SelectNodes("//ns:dbReference", nsmgr);
            foreach (XmlNode xn in Testi)
            {
                if (xn.Attributes["type"].Value == "GO") 
                {
                    String Testilator = xn.Attributes["id"].Value;
                    String Testilator2 = xn.FirstChild.Attributes["value"].Value;

                }
            }
于 2013-11-03T16:40:55.033 に答える