从c#中的父节点读取子节点

时间:2017-02-21 05:04:01

标签: c# xml

在父参数下,我将子参数设为“Fruit”和“TransactionID”。我想读取“Fruit”和“TransactionID”的值。

xml代码:

import tkinter as tk
import numpy as np
import time
import functools

import matplotlib
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure

main = tk.Tk()
container = tk.Frame(main)
container.pack(side="top", fill="both", expand = True)
container.grid_rowconfigure(0, weight=1)
container.grid_columnconfigure(0, weight=1)

f = Figure(figsize=(5,5), dpi=100)
a = f.add_subplot(111)
canvas = FigureCanvasTkAgg(f, master=main)
canvas.show()
canvas.get_tk_widget().pack(side=tk.BOTTOM, fill=tk.BOTH, expand=True)

def update(a, canvas):
        data = np.genfromtxt('test.csv', delimiter=',', names=['x', 'y'])
        a.clear()
        a.plot(data['x'], data['y'], color='r', label='the data')


        canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=True)

        print ("update")
        main.after(5000, functools.partial(update, a)(canvas))

main.after(5000, functools.partial(update, a)(canvas))
main.mainloop()

1 个答案:

答案 0 :(得分:0)

这对我有用。

XmlNamespaceManager nsmgr = new XmlNamespaceManager(xDoc.NameTable);
nsmgr.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");
var parentNodes = xDoc.SelectNodes("//soap:DataReq/soap:Extensions/soap:Extension/soap:Parameters", nsmgr);