Difference between html and xml slideshare

Presentation on theme: "What is XML? XML stands for EXtensible Markup Language"— Presentation transcript:

1 What is XML? XML stands for EXtensible Markup Language
XML is a markup language much like HTML XML was designed to describe data XML tags are not predefined in XML. You must define your own tags XML uses a Document Type Definition [DTD] or an XML Schema to describe the data XML with a DTD or XML Schema is designed to be self-descriptive

2 The main difference between XML and HTML
XML was designed to carry data. XML is not a replacement for HTML. XML and HTML were designed with different goals: XML was designed to describe data and to focus on what data is. HTML was designed to display data and to focus on how data looks. HTML is about displaying information, XML is about describing information.

3 XML does not DO anything
XML was not designed to DO anything. Maybe it is a little hard to understand, but XML does not DO anything. XML is created to structure, store, and to send information. The following example is a note to Michael from Dina, stored as XML: Michael Dina Reminder Don't forget me this weekend!

4 XML is free and extensible
XML tags are not predefined. You must "invent" your own tags. The tags used to markup HTML documents and the structure of HTML documents are predefined. The author of HTML documents can only use tags that are defined in the HTML standard [like

,

, etc.]. XML allows the author to define his own tags and his own document structure. The tags in the example above [like and ], are not defined in any XML standard. These tags are "invented" by the author of the XML document.

5 XML is a complement to HTML
XML is not a replacement for HTML. It is important to understand that XML is not a replacement for HTML. In future Web development it is most likely that XML will be used to describe the data, while HTML will be used to format and display the same data. My best description of XML is: XML is a cross-platform, software and hardware independent tool for transmitting information.

6 ?What is SGML SGML is the Standard Generalized Markup Language [ISO 8879:1985], the international standard for defining descriptions of the structure of different types of electronic document.

7 Aren't XML, SGML, and HTML all the same thing?
Not quite; SGML is the mother tongue, and has been used for describing thousands of different document types in many fields of human activity. XML is an abbreviated version of SGML, to make it easier for us to define our own document types, and to make it easier for programmers to write programs to handle them. HTML is just one of the SGML or XML applications, the one most frequently used in the Web.

8 How can XML be Used? It is important to understand that XML was designed to store, carry, and exchange data. XML was not designed to display data.

9 XML can Separate Data from HTML
With XML, your data is stored outside your HTML. When HTML is used to display data, the data is stored inside your HTML. With XML, data can be stored in separate XML files. This way you can concentrate on using HTML for data layout and display, and be sure that changes in the underlying data will not require any changes to your HTML. XML data can also be stored inside HTML pages as "Data Islands". You can still concentrate on using HTML only for formatting and displaying the data.

10 XML is used to Exchange Data
With XML, data can be exchanged between incompatible systems. In the real world, computer systems and databases contain data in incompatible formats. One of the most time-consuming challenges for developers has been to exchange data between such systems over the Internet. Converting the data to XML can greatly reduce this complexity and create data that can be read by many different types of applications.

11 XML and B2B With XML, financial information can be exchanged over the Internet. Expect to see a lot about XML and B2B [Business To Business] in the near future. XML is going to be the main language for exchanging financial information between businesses over the Internet. A lot of interesting B2B applications are under development.

12 XML can be used to Share Data
With XML, plain text files can be used to share data. Since XML data is stored in plain text format, XML provides a software- and hardware-independent way of sharing data. This makes it much easier to create data that different applications can work with. It also makes it easier to expand or upgrade a system to new operating systems, servers, applications, and new browsers.  

13 XML can be used to Store Data
With XML, plain text files can be used to store data. XML can also be used to store data in files or in databases. Applications can be written to store and retrieve information from the store, and generic applications can be used to display the data.

14 XML can make your Data more Useful
With XML, your data is available to more users. Since XML is independent of hardware, software and application, you can make your data available to other than only standard HTML browsers. Other clients and applications can access your XML files as data sources, like they are accessing databases. Your data can be made available to all kinds of "reading machines" [agents], and it is easier to make your data available for blind people, or people with other disabilities.

15 XML can be used to Create new Languages
XML is the mother of WAP and WML. The Wireless Markup Language [WML], used to markup Internet applications for handheld devices like mobile phones, is written in XML.

16 If Developers have Sense
If they DO have sense, all future applications will exchange their data in XML. The future might give us word processors, spreadsheet applications and databases that can read each other's data in a pure text format, without any conversion utilities in between. We can only pray that Microsoft and all the other software vendors will agree

17 XML Syntax The syntax rules of XML are very simple and very strict. The rules are very easy to learn, and very easy to use. Because of this, creating software that can read and manipulate XML is very easy to do.

18 An example XML document
XML documents use a self-describing and simple syntax. Michael Dina Reminder Don't forget me this weekend!

19 All XML elements must have a closing tag
With XML, it is illegal to omit the closing tag. In HTML some elements do not have to have a closing tag. The following code is legal in HTML:

This is a paragraph

This is another paragraph In XML all elements must have a closing tag, like this:

This is a paragraph

This is another paragraph

 

20 XML tags are case sensitive
Unlike HTML, XML tags are case sensitive. With XML, the tag is different from the tag . Opening and closing tags must therefore be written with the same case: This is incorrect This is correct

21 All XML elements must be properly nested
Improper nesting of tags makes no sense to XML. In HTML some elements can be improperly nested within each other like this: This text is bold and italic In XML all elements must be properly nested within each other like this: This text is bold and italic

22 All XML documents must have a root tag
The first tag in an XML document is the root tag. All XML documents must contain a single tag pair to define the root element. All other elements must be nested within the root element. All elements can have sub elements [children]. Sub elements must be correctly nested within their parent element: .....

23 Attribute values must always be quoted
With XML, it is illegal to omit quotation marks around attribute values. XML elements can have attributes in name/value pairs just like in HTML. In XML the attribute value must always be quoted. Michael Dina Reminder Don't forget me this weekend!

24 With XML, White Space is Preserved
With XML, the white space in your document is not truncated. This is unlike HTML. With HTML, a sentence like this: Hello              my name is Michael, will be displayed like this: Hello my name is Michael, because HTML strips off the white space.

25 With XML, CR / LF is Converted to LF
With XML, a new line is always stored as LF. Do you know what a typewriter is?. Well, a typewriter is a type of mechanical device they used in the previous century :-] After you have typed one line of text on a typewriter, you have to manually return the printing carriage to the left margin position and manually feed the paper up one line.  In Windows applications, a new line in the text is normally stored as a pair of CR LF [carriage return, line feed] characters. In Unix applications, a new line is normally stored as a LF character. Some applications use only a CR character to store a new line.

26 Comments in XML The syntax for writing comments in XML is similar to that of HTML.

27 XML Elements XML documents can be extended to carry more information.
XML Elements have simple naming rules. XML Elements have Relationships. Elements are related as parents and children. Elements can have different content types.

28 XML Element Naming XML elements must follow these naming rules:
Names can contain letters, numbers, and other characters. Names must not start with a number or punctuation character . Names must not start with the letters xml [or XML or Xml ..] . Names cannot contain spaces

29 XML Attributes XML elements can have attributes in the start tag, just like HTML. Attributes are used to provide additional information about elements. Data can be stored in child elements or in attributes.

30 Use of Elements vs. Attributes
Data can be stored in child elements or in attributes. Take a look at these examples: Dina Mitelman female In the first example sex is an attribute. In the last, sex is a child element. Both examples provide the same information.

31 Avoid using attributes?
Here are some of the problems using attributes: Attributes cannot contain multiple values [child elements can] Attributes are not easily expandable [for future changes] Attributes cannot describe structures [child elements can] Attributes are more difficult to manipulate by program code Attribute values are not easy to test against a DTD

32 XML Validation XML with correct syntax is ” Well Formed” XML.
XML validated against a DTD is “Valid” XML. A "Valid" XML document also conforms to a DTD.

33 What is an XML DTD ? DTD stands for Document Type Definition.
DTD is a formal model for defining the role of each element. It formally defines the relationship between the various elements that form the documents. The purpose of a Document Type Definition is to define the legal building blocks of an XML document.

34 XML DTD It defines the document structure with a list
of legal elements. An XML DTD allows computers to check that each component of document occurs in a valid place within the document. For example it allows computers to check that users do not accidentally enter a third level of heading without first having a second level heading, etc.

35 XML DTD The DTD can be Internal or external.
An internal DTD refers to a case where the XML document has the DTD inline. Where as an external DTD is one where the document instance is separated from the formal definition of elements.

36 XML Schema  XSchema is an XML based alternative to DTD.

37 XML Schema has Support for Data Types
One of the greatest strength of XML Schemas is the support for data types. With the support for data types: It is easier to describe permissible document content It is easier to validate the correctness of data It is easier to work with data from a database It is easier to define data facets [restrictions on data] It is easier to define data patterns [data formats] It is easier to convert data between different data types

38 XML Schemas use XML Syntax
Another great strength about XML Schemas is that they are written in XML. Because XML Schemas are written in XML: You don't have to learn another language You can use your XML editor to edit your Schema files You can use your XML parser to parse your Schema files You can manipulate your Schema with the XML DOM You can transform your Schema with XSLT

39 XML Schemas Secure Data Communication
When data is sent from a sender to a receiver it is essential that both parts have the same "expectations" about the content. With XML Schemas, the sender can describe the data in a way that the receiver will understand.

40 XML applications B2B EDI Journal publishing Database development

41 XML future Given the direction in which it is growing and the level of support that XML has received the XML appears to be the future of Web publishing.

42 XML in future Web development
XML is going to be everywhere. It has been amazing to see how quickly the XML standard has been developed, and how quickly a large number of software vendors have adopted the standard. We strongly believe that XML will be as important to the future of the Web as HTML has been to the foundation of the Web, and that XML will be the most common tool for all data manipulation and data transmission.

What is the difference between HTML and XML?

The key difference between HTML and XML is that HTML displays data and describes the structure of a webpage, whereas XML stores and transfers data. XML is a standard language which can define other computer languages, but HTML is a predefined language with its own implications.

What is the use of XML write any two difference between XML and HTML?

HTML and XML are related to each other, where HTML displays data and describes the structure of a webpage, whereas XML stores and transfers data. HTML is a simple predefined language, while XML is a standard language that defines other languages.

What is the main difference between HTML and XML Brainly?

1. HTML was designed to display data with focus on how data looks while XML was designed to be a software and hardware independent tool used to transport and store data, with focus on what data is. 2. HTML is a markup language itself while XML provides a framework for defining markup languages.

What is the difference between XML and HTML in terms of data sharing?

XML is used to exchange the data between the platforms. HTML is a predefined markup language and has a limited capability. XML is a text-based markup language that has a self-describing structure and can effectively define another markup language.

Bài mới nhất

Chủ Đề