Beginning XML with C Sharp. 2008. From Novice to Pro

Free Download

Authors:

Edition: 1

Series: Expert's Voice in .NET

ISBN: 9781430209973, 1430209976

Size: 17 MB (17546061 bytes)

Pages: 540/540

File format:

Language:

Publishing Year:

Category:

Bipin Joshi9781430209973, 1430209976

Beginning XML with C# 2008 focuses on XML and how it is used within .NET 3.5. As you’d expect of a modern application framework, .NET 3.5 has extensive support for XML in everything from data access to configuration, from raw parsing to code documentation. This book demystifies all of this. It explains the basics of XML as well as the namespaces and objects you need to know in order to work efficiently with XML. You will see clear, practical examples that illustrate best practices in action. With this book, you’ll learn everything you need to know from the basics of reading and writing XML data to using the DOM, from LINQ and SQL Server integration to SOAP and web services.
What you’ll learn
– The basics of XML in .NET 3.5
– Validating and transforming XML
– Using XML with LINQ
– Integrating with ADO.NET, SQL Server, and WCF
– Configuring the .NET Framework with XML
Who is this book for?
Developers wanting to use XML in the .NET Framework
About the Apress Beginning Series
The Beginning series from Apress is the right choice to get the information you need to land that crucial entry–level job. These books will teach you a standard and important technology from the ground up because they are explicitly designed to take you from “novice to professional.” You’ll start your journey by seeing what you need to know—but without needless theory and filler. You’ll build your skill set by learning how to put together real–world projects step by step. So whether your goal is your next career challenge or a new learning opportunity, the Beginning series from Apress will take you there—it is your trusted guide through unfamiliar territory!

Table of contents :
Contents at a Glance……Page 3
Contents……Page 4
About the Author……Page 12
About the Technical Reviewer……Page 13
Acknowledgments……Page 14
Structure of This Book……Page 15
Contacting the Author……Page 16
What Is XML?……Page 17
XML Is Extensible……Page 18
XML-Driven Applications……Page 19
Rules of XML Grammar……Page 21
Attribute Values Must Be Enclosed in Quotes……Page 22
Parsing XML Documents……Page 23
XSLT……Page 24
XPath……Page 25
The .NET Framework……Page 26
Assemblies and Namespaces……Page 27
System.Xml.Linq Namespace……Page 28
The LINQ-Based Parsing Model of the .NET Framework……Page 29
.NET Configuration Files……Page 30
ASP.NET Server Controls……Page 32
XML Serialization……Page 33
Web Services……Page 34
XML Documentation……Page 35
Creating Windows Applications……Page 37
Creating Class Libraries……Page 41
Summary……Page 44
Using the DOM Parser……Page 45
Knowing When to Use DOM……Page 47
A Sample XML Document……Page 48
Opening an Existing XML Document for Parsing……Page 49
Navigating Through an XML Document……Page 51
Looking for Specific Elements and Nodes……Page 52
Retrieving Specific Elements Using the GetElementByTagName() Method……Page 53
Retrieving Specific Elements Using the GetElementById() Method……Page 54
Selecting Specific Nodes Using the SelectNodes() Method……Page 57
Selecting a Single Specific Node Using the SelectSingleNode() Method……Page 59
Modifying XML Documents……Page 60
Navigating Between Various Nodes……Page 62
Modifying Existing Content……Page 63
Deleting Existing Content……Page 64
Adding New Content……Page 65
Using Helper Methods……Page 67
Dealing with White Space……Page 68
Dealing with Namespaces……Page 71
Understanding Events of the XmlDocument Class……Page 73
Summary……Page 76
What Are XML Readers and Writers?……Page 77
The XmlValidatingReader Class……Page 78
Opening XML Documents……Page 79
Reading Attributes, Elements, and Values……Page 81
Improving Performance by Using Name Tables……Page 84
The ReadSubTree() Method……Page 85
The ReadToFollowing() Method……Page 86
The Skip() Method……Page 87
Moving Between Attributes……Page 88
The ReadInnerXml() Method……Page 89
Writing XML Documents……Page 90
Exporting Columns As Elements……Page 94
Specifying Character Encoding……Page 95
Formatting the Output……Page 96
Including Namespace Support……Page 99
Dealing with Nontextual Data……Page 101
Serializing Data……Page 102
Unserializing Data……Page 103
Summary……Page 105
Overview of XPath……Page 106
Axis……Page 107
Putting It All Together……Page 108
XPath Functions……Page 109
Creating XPathNavigator……Page 110
Navigating an XML Document by Using XPathNavigator……Page 112
Selecting Nodes……Page 115
Selecting Single Nodes……Page 117
Selecting Children, Ancestors, and Descendants……Page 118
Navigating Between Attributes……Page 119
Retrieving Inner and Outer XML……Page 120
Getting an XmlReader from XPathNavigator……Page 122
Getting an XmlWriter from XPathNavigator……Page 125
Editing XML Documents with the XPathNavigator Class……Page 127
Adding Nodes……Page 129
Modifying Nodes……Page 130
Saving Changes……Page 132
Summary……Page 133
Providing Structure for XML Documents……Page 134
The Structure of Employees.xml……Page 135
Creating the DTD……Page 136
Creating the XSD Schema……Page 138
Creating an XSD Schema Manually……Page 139
Creating the XSD Schema in Visual Studio Designer……Page 141
Creating the Schema from a Database Table……Page 144
Creating the Schema by Using the XML Schema Definition Tool……Page 147
The Core SOM Classes……Page 152
Creating an XSD Schema Using the SOM……Page 153
Creating the Schema……Page 156
Creating a Simple Type for Phone Numbers……Page 157
Creating a Complex Type That Represents an Employee……Page 158
Creating the Root Element……Page 159
Saving the Schema……Page 160
Inline DTD……Page 161
External DTD……Page 162
External Schema……Page 163
Adding Frequently Used Schemas to the Schema Cache……Page 164
Using the XmlReader Class to Validate XML Documents……Page 165
Using XmlDocument to Validate XML Documents Being Loaded……Page 168
Summary……Page 171
Overview of XSLT……Page 173
Applying Templates by Using ……Page 177
Branching by Using ……Page 179
Branching by Using and ……Page 180
Transforming Elements and Attributes……Page 182
The XslCompiledTransform Class……Page 185
Performing Transformations by Using XslCompiledTransform……Page 186
Passing Arguments to a Transformation……Page 188
Using Script Blocks in an XSLT Style Sheet……Page 191
Using Extension Objects……Page 195
Compiling XSLT Style Sheets……Page 196
Summary……Page 198
Connected Data Access……Page 199
Disconnected Data Access……Page 200
SQL Server Data Provider……Page 201
The Assemblies and Namespaces Involved……Page 202
DataReader (SqlDataReader and OleDbDataReader)……Page 203
Using the ExecuteXmlReader() Method……Page 204
Understanding DataSet……Page 207
Understanding DataAdapter……Page 209
Filling a DataSet……Page 211
Accessing Data from DataSet……Page 212
Adding New Rows……Page 213
Deleting a Row……Page 214
Using DataRow States……Page 215
Saving the Changes to the Database……Page 216
Saving DataSet Contents As XML……Page 218
Saving Only the Schema……Page 222
Reading XML Data into DataSet……Page 224
Reading XML Fragments……Page 226
Generating Menus Dynamically Based On an XML File……Page 227
Reading Only the Schema Information……Page 230
Creating a Typed DataSet……Page 232
Using Visual Studio to Create a Typed DataSet……Page 233
Using the xsd.exe Tool to Create a Typed DataSet……Page 237
Using the XmlDataDocument Class……Page 238
Converting Between DataRow and XmlElement……Page 240
Summary……Page 242
XML Serialization……Page 243
Classes Involved in the Serialization Process……Page 244
Serializing and Deserializing Objects by Using XML Format……Page 245
Handling Events Raised During Deserialization……Page 249
Serializing and Deserializing Complex Types……Page 251
Serialization and Inheritance……Page 260
Customizing the Serialized XML……Page 263
Changing Array and Array Element Names……Page 268
Serializing Data in SOAP Format……Page 269
Customizing SOAP Serialization……Page 273
Summary……Page 276
What Are Web Services?……Page 277
Creating and Consuming Web Services……Page 278
Creating a Web Service……Page 279
Creating Overloaded Web Methods……Page 284
Buffering the Web Method Response……Page 285
Enabling Session State for Web Methods……Page 286
Setting a Description for a Web Method……Page 287
Returning a DataSet from a Web Method……Page 288
Returning Custom Objects from a Web Method……Page 289
Creating a Proxy for a Web Service……Page 291
Creating a Form That Consumes a Web Method……Page 293
Storing Values in a Web Service Session……Page 294
Calling a Web Method Asynchronously……Page 295
Understanding SOAP……Page 297
Using SOAP Headers……Page 298
Understanding the WSDL Document……Page 303
The Type Definitions……Page 306
A Summary of WSDL……Page 307
Summary……Page 308
Using XML Extensions to the SELECT Statement……Page 309
The FOR XML Clause……Page 310
The AUTO Mode……Page 311
Returning the Schema of the XML……Page 312
The PATH Mode……Page 313
The EXPLICIT Mode……Page 314
Using OPENXML……Page 318
Using SQLXML Features……Page 320
Executing SELECT Queries……Page 321
Executing Parameterized SELECT Queries……Page 323
Filling a DataSet……Page 325
Updating a DataSet by Using SqlXmlAdapter……Page 326
Applying XSLT Templates……Page 328
Writing Template Queries……Page 331
Updating Data with DiffGrams……Page 332
Creating a Table with an XML Column……Page 335
Inserting, Modifying, and Deleting XML Data……Page 336
Methods of the XML Data Type……Page 337
Using the value() Method……Page 338
XML Data Modification Language (XML DML)……Page 339
Native Web Services……Page 340
Creating an HTTP Endpoint……Page 341
Consuming the Native Web Service……Page 343
Summary……Page 345
Understanding Remoting……Page 346
Remoting Architecture……Page 347
Channels and Formatters……Page 348
Remoting Assemblies and Namespaces……Page 349
Creating the Remote Server……Page 350
Creating an Application That Publishes the EmployeeServer……Page 354
Creating the Client Application……Page 356
Using XML in ASP.NET……Page 359
Server Control Markup……Page 360
The XML Data Source Control……Page 370
Applying Transformations……Page 373
Binding an XML Data Source to a Menu Control……Page 376
Working with Site Maps……Page 378
Using a SiteMapPath Control……Page 381
Using the XML Control……Page 382
Using the .NET Framework Configuration System……Page 385
Structure of the web.config File……Page 386
Storing and Retrieving Application Configuration Settings……Page 387
Storing and Retrieving Database Connection Strings……Page 389
The ASP.NET Provider Model……Page 391
AspNetSqlProvider……Page 392
Using Membership, Roles, and Profile Services……Page 393
Displaying Custom Error Pages……Page 404
Creating a Class Library……Page 407
Documenting the Summary and Remarks……Page 408
Documenting Method Parameters and Return Values……Page 409
Specifying Links to Other Members……Page 410
Generating XML Documentation from Comments……Page 411
Generating .CHM Documentation from XML Documentation……Page 412
Summary……Page 415
Creating Services by Using Windows Communication Foundation……Page 416
Creating and Consuming a WCF Service……Page 417
Creating the Service……Page 418
Hosting the Service……Page 422
Consuming the Service……Page 425
Testing the Host and Client……Page 428
Hosting a WCF Service in IIS……Page 429
Using XmlSerializer Instead of XmlFormatter……Page 431
Summary……Page 432
Overview of LINQ Technology……Page 433
Working with LINQ Queries……Page 434
Grouping Data Using LINQ……Page 437
Sorting Data Using LINQ……Page 438
Selecting Data Using LINQ……Page 439
Visual Construction of XML Trees……Page 440
When to Use LINQ to XML……Page 441
Opening an Existing XML Document for Parsing……Page 442
Navigating Through an XML Tree……Page 444
Retrieving Specific Elements Using the Descendents() Method……Page 446
Searching on the Basis of Attribute Values……Page 448
Loading the XML Document……Page 450
Navigating Between Various Nodes……Page 451
Adding New Content……Page 452
Deleting Existing Content……Page 453
Displaying Employee Details……Page 454
Events of the XElement Class……Page 455
Dealing with White Space……Page 457
Dealing with Namespaces……Page 459
Specifying Namespaces While Constructing Elements……Page 460
Validating XML Documents……Page 462
Changing the Shape of an XML Tree……Page 464
Projecting a New Type……Page 466
Summary……Page 468
Creating a Custom Implementation of XmlReader……Page 469
Inheriting from XmlReader……Page 470
Creating a TableReader Class……Page 471
Declaring Class-Level Variables……Page 475
Closing the Reader……Page 476
Navigating Between the Attributes……Page 477
Advancing the Reader……Page 478
Reading Values……Page 479
Using the TableReader Class……Page 480
Creating a Custom XmlWriter……Page 482
Inheriting from XmlWriter……Page 483
Creating the RssWriter Class……Page 484
Defining Enumerations for RSS-Specific Tags……Page 485
Writing Elements……Page 486
Writing Attributes……Page 488
Writing Data……Page 489
Writing an XML Declaration……Page 490
Consuming the RssWriter Class……Page 491
Summary……Page 492
Creating the Database……Page 493
Creating the SqlHelper Class……Page 495
Specifying the Connection String in web.config……Page 497
Retrieving the List of Products……Page 498
Updating Items in the Shopping Cart……Page 499
Retrieving Shopping Cart Items……Page 500
Placing Orders……Page 501
Adding the Web Reference……Page 503
Displaying the Product Catalog……Page 504
Creating the Shopping Cart Page……Page 507
Testing the Website……Page 512
Web Service Developer’s Center……Page 515
Unknown……Page 0
SQLXML programming……Page 516
Index……Page 517

Reviews

There are no reviews yet.

Be the first to review “Beginning XML with C Sharp. 2008. From Novice to Pro”
Shopping Cart
Scroll to Top