Understading XML: Part 1
Markup Language is a simple and flexible language in the text format. Nowadays
it is widely used to exchange a large variety of data over the internet. XML
plays a very significant role with respect to .NET Framework 3.5.
Framework 3.5 provides us with a namespace named System.Xml , which includes classes as a convinient
data storage medium to store data used in our applications in the form of XML
(ActiveX Data Object) is a primary tool used for data access and mor data access and sed ject)_on
.5 anipulation in many programming languages supported
by .NET Framework 3.5. ADO.Net uses xml as a medium of transferring data
between applications and it provides some powerful features to read and write
xml documents.The DOM (Document Object Model) is a plateform- independent
interface, which allows programs and script to access and update the content
and structure of documents dynamically. We implement the DOM with the help XmlDoculement the DOM with the help of teform independent ment class.
can serialize and deserilize objects using the System.xml.Serialization namespace.
Support for XML
in .NET Framework 3.5
is a data description language (DDL) developed by World Wide Web Consortium
is used by ADO.Net as a format to store and transfer data. W3C has developed
some standards, which make XML a powerful and strong language. The set of w3c
standards by .NET Framework 3.5 are as follows:
1.0 (www.w3.org/TR/1998/REC-xml-19980210) with Document Type
Namespaces (www.w3.org/TR/REC-xml-names) for both stream-level and
Level 1 Core (www.w3.org/
Level 2 Core (www.w3.org/
TR / REC-DOM-Level-2-Core/)
.NET Framework 3.5 provides a namespace known as System.Xml, which contains classes that are used to process XML.
Read important classes contained in the System.Xml namespace:
introduction of DOM, Simple Application Programming Interface (API) for XML
(SAX) was used to access information stored in XML documents. In the SAX model,
we had only the XmlReader and XMLWriter classes to work with XML data.XmlReader-based
classes are used to stream the XML data for processing in a fast-forward and
rady-only manner. Memory requirements for the SAX model are not too high as it
is for a streaming model. The SAX model however dose not provide navigation
flexibility and read or write capabilities that are available in DOM.
classes are used to generate XML documents.The XmlReader and XmlWriter classes
are abstract classes. We can use classes derived form these abstract classes to
work wth XML in our application Classes derived formt eh XMLReader abstract
class are as follows:
either with a stream-based object or with Textreader/TextWriter objects from the System.IO namespace.
2. XmlNodeReader-Uses XmlNode class as its source instead of a stream
3. XmlValidatingReader-Adds DTD
and schema validation and hence offers data validation
The XmlTextWriter class is a
class that is derived from the XmlWriter abstract class. Similar to the
class, this class also works either with a
stream-based object or with the
objects from the System.IO namespace.
Now, let's look at some of these classes in detail.
class is used to read XML data in a fast,
forward-only, and non-cached manner. It works in the same manner as the SAX
model does. However, there are few differences between the two. One of these
differences is the type of model they use to read data from an XML
document. The SAX model uses a push model to read XML data, while the XmlReader class uses a pull model for this purpose.
There are a few disadvantages associated with the push model. One
disadvantage is that, in this model, data is pushed out to the application and
the developer of the application needs to be ready to receive it. Another
disadvantage is that all the data pushed out to the application
needs to be processed by the application, whether it is required or not. On the
other hand, in the pull model data is pulled into the application that is
requesting it. Also in the pull model you do not need to process all the data sent to the
application. You can select the data that you want and process only that data
Continue Next Part.