Chapter 9. XML and .NET

IN THIS CHAPTER

  • An Overview of XML

  • XML Classes in .NET

  • Extending SQL Server with SQLXML 3.0 and IIS

  • Using XML, XSLT, and SQLXML to Create a Report

Sometime in the recent, or not so recent, past you almost certainly have encountered some example or use of the eXtensible Markup Language (XML). In fact, installing either VS.NET or Common Language Runtime (CLR) exposes you to XML whether you know it or not. At one point, XML was touted as a "silver bullet" that would take care of all data-related issues regardless of platform or device. All this excitement created some unnecessary overhead for applications using XML in the beginning. Developers started wrapping everything they could in XML tags because it was "cool," regardless of the actual business case for or technical reasoning behind the use of XML. The power of XML is its use of metadata and structured elements to contain data. XML is not a programming language, as it contains no directives for application functionality. That makes it platform-independent.

Chances are that, if you have a firm understanding of HTML, figuring out how to use XML reliably and effectively isn't that much of a reach. For example, you can think of Namespaces in much the same way you would name an ActiveX.dll in Visual Basic. A Namespace, represented in an element with the prefix xmlns:, supplies a unique name for a container that provides functionality and/or data much the way a class name does in Visual Basic. In VB.NET, the approach has been simplified through use of an extensive set of classes to parse and manipulate XML. Consider any web.config file, for example. The file is XML-based versus the "legacy" format of an .INI file, and its data is accessible by similar simple methods. The main difference is that the web.config file is more extensible. Evidence of this difference is that the web.config file can be accessed and manipulated exactly the same way as any other XML document although the results may be quite different.

The case for using XML or any of its relatives Simple Object Access Protocol (SOAP), for example is neutrality. There will always be a case for creating an application that has logic that can be extended through the sharing of its data, rather than requiring that each application have unique coding to access centralized data.

In this chapter we concentrate on the use of XML for its true purpose of allowing data to "identify" itself to any application or human being. Throughout the chapter, we describe how XML is used in the real world and how the .NET platform uses it effectively. In Chapter 10 we present a more in-depth explanation of how to interact with databases and DataSets using the ADO classes.

Many books and resources devoted to XML are currently available. Therefore, instead of providing a comprehensive treatment of the topic, we focus on how XML is integrated with the .NET platform. If you're familiar with XML, you may want to skip ahead to the XML Classes in .NET section; otherwise, enjoy the refresher.



Database Access with Visual Basic. NET
Database Access with Visual Basic .NET (3rd Edition)
ISBN: 0672323435
EAN: 2147483647
Year: 2003
Pages: 97

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net