Web development for storing data
Chapter 1 Introduction
XML is important to known especially in web development for storing data and transport data. Many people thought that XML and HTML is same but actually it is not and XML is for storing and transport data while HTML is use for display data. In this study, I will do research on XML and provide some useful information about XML.
In this seminar, 1st I will explain about usage of XML. Then I will briefly explain the history of XML, for example like sources and versions of XML. Besides that, I also include the key concept and components of XML, example like Tag, element, Attribute and declaration of XML. After that, I will explain about how does XML Work, how to develop XML, XML schema and some error handling of XML. In this part, I will provide some example of coding so can understand better.
Besides that, I also will do some comparison of different XML for Example like compare LINQ to XML with other XML technologies. I will also explain the advantages and disadvantages of XML. I will do a research on what is the importance of XML, example like XML for web service, XML as data and the future usage of XML.
Chapter 2 Definition
XML stands for extensible markup language used for the description and delivery of marked-up electronic text over the web. The purpose of design XML is used for transport and store data. Actually, XML is not a replacement for HTML, because both of them are designed for different purpose. XML is designed to carry and store data; XML is focus on what the data is and it is not designed for display data. While HTML is designed for display data, its focus on how the data looks. So the main different between both of them are XML is about carrying data and HTML is about displaying data.
Extensible Markup Languages (XML) history begins with the development of Standard Generalised Markup Language (SGML) by Charles Goldfarb, along with Ed Mosher and Ray Lorie in the 1970s while working at IBM. In the year of 1970s, SGML was used to create vocabularies which could be mark up the documents with structural tags. Hyper Text Markup Language (HTML) is one of the most useful applications of SGML until now. However, HTML is more about presentation technology and it is unsuitable for carry and store data. Since HTML is unsuitable for data store and data interchange, so XML was created to support platform and architecture independent data interchange.
2.1 History of XML
XML was compiled by an eleven member working group and 150 members interest group. "A record of design decisions and their rationales was compiled by Michael Sperberg-McQueen on December 4, 1997." (View on October 2009, Available from http://en.wikipedia.org/wiki/XML). Designing of XML continued work in 1997, and the W3C recommended XML 1.0 on February 10, 1998.
Actually, XML is comes from SGML. The difference is that the document character is in Unicode format, and it has a fixed delimiter set. "Other sources include text Encoding initiative (TEI), HTML, Extended Reference Concrete Syntax (ERCS). The first version of XML was defined in 1998." (View on October 2009, Available from http://www.totalxml.net/sources-versions.php)
2.2 XML Specification
I had do some research and found that there are some Official XML specification provided by Stylus Studio that can let us gain more knowledge about XML. These are some example of XML specification that can help us in further study about XML. (Viewed on October 2009, Available from http://www.stylusstudio.com/).
- XML Namespaces
XML is a simple, very flexible text format derived from SGML. XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere. XML 1.1 updates XML so that it no longer depends on the specific Unicode version. It also adds checking of normalization, and follows the Unicode line ending rules more closely.
XML namespaces provide a way to distinguish between elements that use the same local name but are in fact different. Besides that it also can avoid name clashes. Tag names within a namespace must be unique.
XSLT is use to transform XML documents into other XML documents, for example transform to HTML for display purpose. Besides that, XSL includes an XML vocabulary for specifying the format of data. The transformation is achieved by associating patterns with templates.
It is syntax for defining parts of XML document. The main purpose of XPath is use path expression to find specific pieces of information in XML documents. It is a major element of XSLT.
Chapter 3 XML key concepts and components
- (Unicode) Character
- Markup and Content
XML is able to accept most of the legal Unicode. Almost all of the XML documents are created using string character.
XML processor takes the XML document and DTD then processes the information so that it can be used by application to request the information. The processor is a software module that reads the XML document to find out the structure and content of the XML document. The structure and content can be derived by the processor because XML documents contain self-explanatory data. The processor is a bridge between the XML document and the application that we using. The processor is usually works in the service of application.
XML applications is a software that using XML technologies for example like XPath, XSLT , XML Schema and etc to process and modify data. There are some examples of XML applications:
a. Web Collections
Web Collections are meta-data syntax. Web collections are usually used for scheduling, content labeling, distributed authoring, and etc.
b. E-business applications
XML also very useful in e-business application for example implementation of XML can be used for information interchange, business-to-consumer transactions, and business-to-business transactions.
c. Simple Object Access Protocol (SOAP)
A protocol that is object based and used for information exchange in a decentralized and distributed environment.
XML documents are created from characters that divided into two type, markup and content. All markup either open with the character "<" and close with a ">", or begin with the character "&" and end with a ";". If the text that is not markup, that mean the text is the content.
XML Tags is the beginning and ending of an element. XML tag is a markup construct that open with "<" and close with ">", for example like
Actually, elements are used to describe the data in an XML document so that the data becomes easy to understand. It holds data and other elements or empty. The characters between the open and closing tags are the element's content. It also can contain markup or include other elements which are name as child elements. Example of a simple element,
Attributes are used to specify the content of an element for example specify additional information about the element. An attribute of an element usually use within the opening tag. For example like
XML software uses the declaration to determine how to deal with the subsequent XML content. XML documents may begin its declaration with a prologue, and some information about themselves, for example
The first and second lines are the XML declaration. There are four elements in this example, which are book, img, title and author. Besides that, img have two attributes which are src and alt. The root element is book. (Viewed on October 2009, Available from http://en.wikipedia.org/wiki/XML#Related_specifications)
Chapter 4 Uses and how XML works
The uses and design goals of XML are:
- XML was designed for usable over the Internet.
- XML was designed to structure, transport and store data.(exchange information between computers)
- XML shall support a wide variety of applications.
- XML documents should be easy to understand and reasonably clear.
- The design of XML shall be formal and concise.
- XML documents shall be easy to create.
4.1 How XML works
XML is very useful in web development, it usually make the works like share and store data easier to perform. (Viewed on October 2009, Available from http://www.stylusstudio.com/w3c/xml11/sec-origin-goals.htm#sec-origin-goals)
- Separates the data from HTML
- Makes data easy for sharing
- Makes data easy for transport
- Can easily support any platform
- Makes data more available
If we want to display dynamic data in HTML, we will have to modify the HTML each times the data changes. XML can store the data in separated XML files. So we no need to do any changes to HTML, and HTML can concentrate on its part which is about the layout display.
XML provides a software- and hardware-independent way of storing data because the data is stored in plain text format. So XML data is easy to created and can used and shared by different application easily.
With XML, data can be easily exchanged between two different systems. XML data can be read by many different incompatible applications, so XML really make the data easier to exchange between two different systems.
It is very time consuming if we had to upgrading our systems because we need to convert large number of data and the data might be lost. Xml data is in plain text format so this makes it easier to expand to new environment such as new operating systems, new applications, new browsers and etc.
XML data can be more available and useful because XML data is independent. XML allow different applications to access the data. XML data is available for all kinds of reading machines, for example, computers, voice machines, cell phone, and etc.
4.2 Schemas and Validation
Technically, a schema is an abstract collection of metadata, consisting of a set of schema components: chiefly element and attribute declarations and complex and simple type definitions.
XML processors are classified as valid or non-valid are depend on the validity of XML document. We can check the XML document to see whether it is valid or not. A valid XML document must be well-formed. The well-formed requirement should be simple. It is quite difficult to make an XML document leap from well-formed to valid.
To be valid, the XML document must be validated. A document cannot be validated unless a Document Type Definition (DTD), internal or external, is referenced for the XML processor. If the XML documents need to be valid, it must follow all the rules in the DTD. (Viewed on November 2009, Available from http://en.wikipedia.org/wiki/XML#Schemas_and_validation)
DTD (Document Type Definition)
DTD is an example of schema, which is the oldest schema language for XML. DTD does not support newer features of XML, besides that, DTD are lack of expressiveness and readability, for example, DTD only support simple datatypes. Although DTD is an oldest schema language, but DTD still using in many applications.
XML Schema is one of several XML schema languages. It was the first separate schema language for XML to achieve recommendation status by the W3C. Besides that, XML schema is also a newer schema language which is the successor of DTD. XML Schema Definition (XSDs) can describe XML language better than DTD.
4.3 XML syntax and errors handling
- The syntax rules of XML are easy to find out because it is logic and simple.
Chapter 5 Comparisons of different XML
Many people thought that XML document and HTML document are same, but actually both of them are not same. Although XML is a markup language almost same as HTML but XML is not a replacement for HTML. Both of them also designed for different purpose, so we have to know the different between them.
5.1 LINQ to XML
XML has been widely use for design data in many context. For example, XML is basically using on the web configuration files, in Microsoft Office Word files, and in related databases.
LINQ to XML provide the in-memory XML programming interface that can let users to work with XML by using the .NET Framework programming languages. LINQ to XML uses the latest .NET Framework language capabilities and is similar to an updated Document Object Model (DOM) XML programming interface. The LINQ family of technologies provides a consistent query experience for objects (LINQ to Objects), relational databases (LINQ to SQL), and XML (LINQ to XML).
Itis almost same as the Document Object Model (DOM) that brings the XML document into memory. We can modify the document and save it to a file or serialize it and send it over the Internet. Actually, LINQ to XML is different from DOM because LINQ to XML provides a new object model that iseasier to work with and have some advantages about language improvements. (Viewed on November 2009, Available from http://msdn.microsoft.com/en-us/library/bb387098.aspx)
The advantage of LINQ to XML:
- Its integration with Language-Integrated Query (LINQ) and enables us to write queries on the XML document to retrieve the collections likes elements and attributes. (most important)
- Ability to use query as parameters to XElement and XAttribute object constructors enables a functional construction to creating XML trees. Besides that, it also helps developers to transform XML trees to another more easily.
5.2 Comparisons of LINQ to XML with other XML Technologies
In this part, I will do some comparison about LINQ to XML with other XML technologies such as XSLT and XmlReader.
5.3 Advantages of Disadvantages of XML
Advantages of XML:
- It is human-readable and machine-readable format.
- XML is an extendable language, which means we can define our own tags, or use the tags that created by other peoples.
- Searching the data in XML document is easy and efficient.
- It is self-documenting format; it can describe the structure and field names as well as specific values.
- XML can work on any platform.
- XML is system independent so when the data is being exchanged between two systems by using XML, data will not be lost.
- XML is fully compatible with applications such as JAVA, and it can be combined with other application.
(Viewed on November 2009, Available from http://www.exforsys.com/tutorials/xml/xml-advantages.html)
XML is good but there also will have some drawbacks.
Disadvantages of XML:
- The biggest drawback of XML is lack of application processing. There are no browsers yet which can support XML. So if need to read by browser, XML is still need to depend on HTML. XML have to convert to HTML before they are deployed.
- XML is a verbose language, so it totally depends on who is writing it. This will bring some problems to other user.
- XML namespaces are problematic to use and namespace support can be difficult to correctly implement in an XML parser.
- Expressing overlapping (non-hierarchical) node relationships requires extra effort.
(Viewed on November 2009, Available from http://www.exforsys.com/tutorials/xml/xml-disadvantages.html)
Chapter 6 The important of XML?
One of the problems is because HTML, the markup language used on the Web, which is good at displaying information in different fonts and colors, etc., but it isn't good at describing the structure of information. On the other hand, XML is very good at describing the structure of information, storing data, and exchange data. So XML is needed in this case.
Nowadays, the relational database systems are no longer work independently in process data. For example, most of the traditional databases can't handle video, audio or some complex data, but XML databases can support these kinds of data without any problems.
The other reasons why XML is important are XML is more simplicity which mean that XML documents is more readable for human and also machine. Because of this reason, those developers or programmers can easily understand and create their XML documents. Besides that, XML parsers are also simple to build.
The next reason is because XML is extensibility. XML allow developers to create their own DTDs, effectively creating 'extensible' tag sets that can be used for multiple applications. Besides that, XML itself is being extended with several additional standards that add styles, linking, and referencing ability to the core XML set of capabilities.
Other than that, XML is also interoperability because it can be used on wide variety of platforms and interpreted with a wide variety of tools. XML support multilingual documents and Unicode standards. This is important for electronic business applications. (Viewed on November 2009, Available from http://www.qandr.org/quentin/writings/xmlimportance.html)
Chapter 7 Critical Evaluation
Evaluation 7.1 XML and HTML
Material: XML is not a replacement for HTML.
From: http://www.w3schools.com/XML/xml_whatis.asp [Accessed: 11/11/2009]
Based on the website that I research, I found that there is a statement said that "XML is not a replacement for HTML". In my opinion, I agree with this statement because XML is creating for different purpose and not same as HTML, so XML can't be replacing HTML. HTML is designed for display information purpose while XML is designed for store, describe and exchange data. XML is content-driven and the markup tag is self-defined. While HTML is format-driven and the markup symbols are predefined, the structure of them is different, so XML is not a replacement for HTML. Nowadays, XHTML is a combination of XML and HTML. XHTML was developed to make HTML more extensible and increase interoperability with other data formats.
Evaluation 7.2 Future of XML
Material: The future of XML is still unclear because of conflicting views of XML users.
From: http://www.totalxml.net/future-of-xml.php [Accessed 11/11/2009]
Based on the research I do, I had found 1 website about Future of XML and there is a statement said that "The future of XML is still unclear because of conflicting views of XML users." In my opinion, I think that XML really useful in this few years. XML really help in storing information, for example, XML is possible to manage large quantities of information that can't fit in relational database tables. Besides that, XML also can describe the data very well and also simplified information exchange across language barriers.
Nowadays, the specification is growing and become more complex, so XML is no longer simple. Besides that, it also takes longer time to develop XML tools. So in my opinion, I think that XML should be upgrade to new version so that it can have a good result about improvement in quality although the specifications have increase. Besides that, the web application is continue growing and upgraded, so XML is based in web application, it will also grow as well in the future.