Monday

C# source to find XML tag recursively


 [TestFixture]
public class test
{
[Test]
public void XPathTest()
XmlDocument doc = new XmlDocument();
doc.Load(@"c:\LinqObjects.xsd");

foreach (XmlNode node in doc.DocumentElement.ChildNodes)
{
ProcesNode(node, doc.DocumentElement.Name);
}
}



private void ProcesNode(XmlNode node, string parentPath)
{
if (!node.HasChildNodes || ((node.ChildNodes.Count == 1) && (node.FirstChild is System.Xml.XmlText)))
{
if (node.Name == "Parameter")
{
//System.Diagnostics.Debug.WriteLine(parentPath + "/" + node.Name);
}
}
else
{
foreach (XmlNode child in node.ChildNodes)
{
ProcesNode(child, parentPath + "/" + node.Name);
}
}
}
}

more...

No comments:

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...