+ All Categories
Home > Technology > Session 4

Session 4

Date post: 06-Jul-2015
Category:
Upload: pradeep-sripada
View: 212 times
Download: 1 times
Share this document with a friend
Popular Tags:
29
Session 4 Working with XML
Transcript
Page 1: Session 4

Session 4

Working with XML

Page 2: Session 4

Working with XML\ 2 of 29

Session Objectives Work with XML Work with XML using the DOM Discuss the Service Control Manager Create a Windows Service program Create a Service Configuration program

Page 3: Session 4

Working with XML\ 3 of 29

Introduction (1) XML forms an integral part of

computing Acts as a universal glue Binds together varied formats of

database to connect and exchange data C# applications can utilize and benefit

from XML

Page 4: Session 4

Working with XML\ 4 of 29

Introduction (2) The System.XML namespace handles

XML in .NET XMLReader & XMLWriter classes are

used to read and write XML documents XML Document Object Model

implementation in .NET

Page 5: Session 4

Working with XML\ 5 of 29

Introduction (3) Validating XML documents using the

XMLValidatingReader class Creating XML files from an ADO.NET

record set

Page 6: Session 4

Working with XML\ 6 of 29

System.XML namespace This namespace contains a number of

classes that help us process XML documents

XMLReader

XMLWriter

XMLTextReader

XMLTextWriter

XMLDocument

Page 7: Session 4

Working with XML\ 7 of 29

Writing an XML file (1) Example 1

Contd....

Page 8: Session 4

Working with XML\ 8 of 29

Writing an XML file (2)

Contd....

Page 9: Session 4

Working with XML\ 9 of 29

Output in an XML file Output -

Page 10: Session 4

Working with XML\ 10 of 29

Reading an XML file Example 2 -

Page 11: Session 4

Working with XML\ 11 of 29

Reading an XML file Output -

Page 12: Session 4

Working with XML\ 12 of 29

Validation Type property The XMLValidatingReader includes a

ValidationType property which is set to the type of validation that needs to be done

Page 13: Session 4

Working with XML\ 13 of 29

DTD file for XML Example 3

Page 14: Session 4

Working with XML\ 14 of 29

Validating XML data (1) Example 4

Contd....

Page 15: Session 4

Working with XML\ 15 of 29

Validating XML data (2) Example 4

Contd…

Page 16: Session 4

Working with XML\ 16 of 29

Validating XML data Output -

Page 17: Session 4

Working with XML\ 17 of 29

DOM in .NET (1) Example 4 -

Page 18: Session 4

Working with XML\ 18 of 29

DOM in .NET (2) Output -

Page 19: Session 4

Working with XML\ 19 of 29

Adding data to an XML document (1) Example 5

Contd....

Page 20: Session 4

Working with XML\ 20 of 29

Adding data to an XML document (2)

Contd....

Page 21: Session 4

Working with XML\ 21 of 29

Contents of Phone.XML Output -

Page 22: Session 4

Working with XML\ 22 of 29

Modifying data in an XML document (1) Example 6

Contd....

Page 23: Session 4

Working with XML\ 23 of 29

Modifying data in an XML document (2)

Contd…

Page 24: Session 4

Working with XML\ 24 of 29

Modifying data in an XML document

Output -

Page 25: Session 4

Working with XML\ 25 of 29

Phone.XML modified Output -

Page 26: Session 4

Working with XML\ 26 of 29

Writing an ADO.NET dataset to an XML file Example 7 -

Page 27: Session 4

Working with XML\ 27 of 29

MyProducts.XML Output -

Page 28: Session 4

Working with XML\ 28 of 29

Creating an ADO.NET dataset from an XML file (1) Example 8 -

Page 29: Session 4

Working with XML\ 29 of 29

Creating an ADO.NET dataset

from an XML file (2) Output -


Recommended