Session 4 Working with XML
Session Objectives <ul><li>Work with XML  </li></ul><ul><li>Work with XML using the DOM </li></ul><ul><li>Discuss the Serv...
Introduction (1) <ul><li>XML forms an integral part of computing </li></ul><ul><li>Acts as a universal glue </li></ul><ul>...
Introduction (2) <ul><li>The System.XML namespace handles XML in .NET </li></ul><ul><li>XMLReader & XMLWriter classes are ...
Introduction (3) <ul><li>Validating XML documents using the XMLValidatingReader class </li></ul><ul><li>Creating XML files...
System.XML namespace <ul><li>This namespace contains a number of classes that help us process XML documents </li></ul><ul>...
Writing an XML file (1) <ul><li>Example 1 </li></ul>Contd....
  Writing an XML file (2) Contd....
Output in an XML file <ul><li>Output - </li></ul>
Reading an XML file <ul><li>Example 2 - </li></ul>
Reading an XML file <ul><li>Output - </li></ul>
Validation Type property <ul><li>The XMLValidatingReader includes a ValidationType property which is set to the type of va...
DTD file for XML <ul><li>Example 3 </li></ul>
Validating XML data (1) <ul><li>Example 4 </li></ul>Contd....
Validating XML data (2)  <ul><li>Example 4 </li></ul>Contd…
Validating XML data <ul><li>Output - </li></ul>
DOM in .NET (1) <ul><li>Example 4 - </li></ul>
DOM in .NET (2) <ul><li>Output - </li></ul>
Adding data to an XML    document (1) <ul><li>Example 5 </li></ul>Contd....
Adding data to an XML    document (2) Contd....
Contents of Phone.XML <ul><li>Output - </li></ul>
Modifying data in an XML    document (1) <ul><li>Example 6 </li></ul>Contd....
Modifying data in an XML  document (2) Contd…
Modifying data in an XML    document <ul><li>Output - </li></ul>
Phone.XML modified <ul><li>Output - </li></ul>
Writing an ADO.NET dataset    to an XML file <ul><li>Example 7 - </li></ul>
MyProducts.XML <ul><li>Output - </li></ul>
Creating an ADO.NET dataset    from an XML file (1) <ul><li>Example 8 - </li></ul>
Creating an ADO.NET dataset    from an XML file (2) <ul><li>Output - </li></ul>
Upcoming SlideShare
Loading in …5
×

Session 4

349 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
349
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Session 4

  1. 1. Session 4 Working with XML
  2. 2. Session Objectives <ul><li>Work with XML </li></ul><ul><li>Work with XML using the DOM </li></ul><ul><li>Discuss the Service Control Manager </li></ul><ul><li>Create a Windows Service program </li></ul><ul><li>Create a Service Configuration program </li></ul>
  3. 3. Introduction (1) <ul><li>XML forms an integral part of computing </li></ul><ul><li>Acts as a universal glue </li></ul><ul><li>Binds together varied formats of database to connect and exchange data </li></ul><ul><li>C# applications can utilize and benefit from XML </li></ul>
  4. 4. Introduction (2) <ul><li>The System.XML namespace handles XML in .NET </li></ul><ul><li>XMLReader & XMLWriter classes are used to read and write XML documents </li></ul><ul><li>XML Document Object Model implementation in .NET </li></ul>
  5. 5. Introduction (3) <ul><li>Validating XML documents using the XMLValidatingReader class </li></ul><ul><li>Creating XML files from an ADO.NET record set </li></ul>
  6. 6. System.XML namespace <ul><li>This namespace contains a number of classes that help us process XML documents </li></ul><ul><li>XMLReader </li></ul><ul><li> XMLWriter </li></ul><ul><li> XMLTextReader </li></ul><ul><li> XMLTextWriter </li></ul><ul><li> XMLDocument </li></ul>
  7. 7. Writing an XML file (1) <ul><li>Example 1 </li></ul>Contd....
  8. 8. Writing an XML file (2) Contd....
  9. 9. Output in an XML file <ul><li>Output - </li></ul>
  10. 10. Reading an XML file <ul><li>Example 2 - </li></ul>
  11. 11. Reading an XML file <ul><li>Output - </li></ul>
  12. 12. Validation Type property <ul><li>The XMLValidatingReader includes a ValidationType property which is set to the type of validation that needs to be done </li></ul>
  13. 13. DTD file for XML <ul><li>Example 3 </li></ul>
  14. 14. Validating XML data (1) <ul><li>Example 4 </li></ul>Contd....
  15. 15. Validating XML data (2) <ul><li>Example 4 </li></ul>Contd…
  16. 16. Validating XML data <ul><li>Output - </li></ul>
  17. 17. DOM in .NET (1) <ul><li>Example 4 - </li></ul>
  18. 18. DOM in .NET (2) <ul><li>Output - </li></ul>
  19. 19. Adding data to an XML document (1) <ul><li>Example 5 </li></ul>Contd....
  20. 20. Adding data to an XML document (2) Contd....
  21. 21. Contents of Phone.XML <ul><li>Output - </li></ul>
  22. 22. Modifying data in an XML document (1) <ul><li>Example 6 </li></ul>Contd....
  23. 23. Modifying data in an XML document (2) Contd…
  24. 24. Modifying data in an XML document <ul><li>Output - </li></ul>
  25. 25. Phone.XML modified <ul><li>Output - </li></ul>
  26. 26. Writing an ADO.NET dataset to an XML file <ul><li>Example 7 - </li></ul>
  27. 27. MyProducts.XML <ul><li>Output - </li></ul>
  28. 28. Creating an ADO.NET dataset from an XML file (1) <ul><li>Example 8 - </li></ul>
  29. 29. Creating an ADO.NET dataset from an XML file (2) <ul><li>Output - </li></ul>

×