CSharp examples for System.Xml:XML Node
Follow Path from XmlNode
using System.Xml; using System.Text; using System.Collections.Generic; using System;// ww w .j a va 2s . c o m public class Main{ public static XmlElement FollowPath(XmlNode source, params string[] tagNames) { XmlElement p = GetFirstChild(source, tagNames[0]); for (int i = 1; p != null && i < tagNames.Length; i++) p = GetFirstChild(p, tagNames[i]); return p; } }