Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

XML Reader

Posted on October 15, 2013October 26, 2015 By David Kittell
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;

namespace XMLReader1
	{
	public partial class Form1 : Form
		{
		public Form1()
			{
			InitializeComponent();
			}

		private void Form1_Load(object sender, EventArgs e)
			{

			string xmlString = "04228911.xml";
			XmlDocument doc = new XmlDocument();
			doc.Load(@xmlString);

			//Create an XmlNamespaceManager for resolving namespaces.
			XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
			nsmgr.AddNamespace("O", "mti_ocrff31_schema.XML");

			//Select the node with the matching attribute value.
			XmlNode CPFField;
			XmlElement root = doc.DocumentElement;
			CPFField = root.SelectSingleNode("descendant::O:Zone[@O:Number='1']", nsmgr);


			OutputTextBlock.Text = CPFField.OuterXml;
			//OutputTextBlock.Text = CPFField.LastChild.InnerText.ToString();

			}
		}
	}

Originally Posted on October 15, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code CSharp

Post navigation

Previous post
Next post

Related Posts

PowerShell – Windows Active Directory – Compare User Groups

Posted on January 2, 2020

$user1 = "administrator" $user2 = "dkittell" # Left arrow means user1 has the permissions but user2 does not # Right arrow means user2 has the permissions but user1 does not diff(get-adprincipalgroupmembership -Identity $user1)(get-adprincipalgroupmembership -Identity $user2) -property ‘name’ All information on this site is shared with the intention to help. Before…

Read More

New Line

Posted on March 4, 2013March 10, 2016

Often we forget what code we need to use to create a new line (line break), hopefully this will help. n = CR (Carriage Return) Used as a new line character in Unix r = LF (Line Feed) Used as a new line character in Mac OS nr = CR…

Read More

Ektron Metrics – User Count By User Group

Posted on May 6, 2013October 26, 2015

Part of the Ektron Metrics Script, this query will help with metrics to give you an idea of how often your users login. SET NOCOUNT ON DECLARE @month INT ,@year INT ,@start_date DATETIME ,@end_date DATETIME SET @month = ( SELECT CASE WHEN MONTH(GETDATE()) = ‘1’ THEN ’12’ ELSE MONTH(GETDATE()) -…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes