XML Delphi

Title: Accessing and Manipulating XML Data in Microsoft .NET Framework
Question: The Extensible Markup Language (XML) is a simple, flexible and portable markup language. It is the preferred standard of communication developed by the World Wide Web Consortium (W3C).
Answer:
The Extensible Markup Language (XML) is a simple, flexible and portable markup language. It is the preferred standard of communication developed by the World Wide Web Consortium (W3C). The XML data comprises of both human-readable data and descriptions of that data, and contains text-based XML files. An example of a well-formed XML document has been described as under:



SO100
John Trivolta
Science


SO101
Bruce Lee
Computer


An XML document is a well-formed text-based data and considered as a meta-language that can easily be edited and created with any text editor. Specific rules should be followed while writing XML document.
XML describes document structures using markup tags ''.The line "" is an XML declaration line which is optionalThis line denotes the XML specification of W3C, and uses the UTF-8 standard set of charactersThe line starting with '' string is called processing instruction that provides information to the application about the process of XML documentA well-formed XML document should contain a start tag and an end tag. For example, '' is a start tag that contains an end tag ''. Unlike HTML tags, XML tags are case-sensitive. For example, if a start tag is written as '', its corresponding end tag should be written as '', and not as '' or 'Unlike HTML, XML document has no predefined elements and attributes, but is specified according to the application or business requirements
An XML document contains an associated document type definition (DTD) or an XML schema. An XML schema describes the data and the relationship between the data within an XML document. Unlike an XML document, an XML schema describes the elements and attributes of an XML document including type information, and also validates XML documents.
The XML Document Object Model

The XML Document Object Model commonly known as XML DOM is a representation of XML document in memory. The DOM class does the work of reading, writing, and manipulating an XML document. An XML document is a tree-structured consisting of parent and child nodes. In the above example of XML document, is the parent node and is the immediate child node. When more than one nodes are at the same level or they have the same parent node is called as sibling. There are different node types in the XML DOM. They are as under:
DOM Node TypeDescriptionDocumentIt is also known as the document root that behaves like a container for all nodes.ElementRepresents the element nodes.AttributesRepresents the attributes of an element node.CommentRepresents the comment nodes.TextRepresents the text that belongs to a particular node.