Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. parse xml

parse xml

Scheduled Pinned Locked Moved Java
csharpwpflinqxml
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MaheshSharma
    wrote on last edited by
    #1

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Xml; using System.IO; using System.Xml.Linq; namespace SearchApp { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public string _dir; public string _searchCriteria; /// <summary> /// validatate directory /// </summary> public string DirName { get { return _dir; } set { _dir = value; if (String.IsNullOrEmpty(value)) { throw new Exception("Directory is mandatory."); } } } /// <summary> /// validate search criteria /// </summary> public string SearchCriteria { get { return _searchCriteria; } set { _searchCriteria = value; if (String.IsNullOrEmpty(value)) { throw new Exception("Search Criteria is mandatory."); } } } private List<object> dataGridRows = new List<object>(); public MainWindow() { InitializeComponent(); DataContext = this; } private void Label_Loaded(object sender, RoutedEventArgs e) { } /// <summary> /// another way by which we can parse xml recursively /// </summary> /// <param name="element"></param> /// <param name="depth"></param> void ProcessXml(XElement element, int depth) { if (!element.HasElements) { } else { depth++; foreach (XElement child in element.Elements()) { ProcessXml(child, depth); } depth--; } } /// <summary>

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups