Created
September 10, 2013 18:15
-
-
Save gscattolin/6513329 to your computer and use it in GitHub Desktop.
Read XML using Linq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
using Pdf_Rendering; | |
using System.IO; | |
using System.Reflection; | |
using System.Xml.Linq; | |
XNamespace namespacexml= "http://www.heidelberg.com"; | |
if (Path.GetExtension(fn).ToLower() != ".xml") { Console.WriteLine("Input file not a pdf file"); return false; } | |
if (!File.Exists(fn)) { Console.WriteLine("Input file does not exist"); return false; } | |
XDocument doc = XDocument.Load(fn); | |
IEnumerable<XElement> st = doc.Descendants( namespacexml+ name_descendandts); | |
foreach (XElement el in st) | |
{ | |
Console.WriteLine("El=" + el.ToString()); | |
} | |
return true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment