Presentation is loading. Please wait.

Presentation is loading. Please wait.

 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,

Similar presentations


Presentation on theme: " XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,"— Presentation transcript:

1  XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure, store, and to send information  XML tags are not predefined. You must define your own tags  XML uses a DTD or an XML Schema to describe the data

2 XML was created to structure, store, and to send information An Example: Chuck Judy Reminder Don’t forget me this weekend! The above is just pure information wrapped in XML tags. Someone must write a piece of software to send, receive or display it.

3  XML can separate data from HTML  With XML, data is stored in separate XML files  XML is used to exchange data  XML and B2B. With XML, financial information can be exchanged over the Internet  XML can be used to share data  XML can be used to store data  XML can be used to create new languages All future applications will exchange their data in XML

4 Chuck Judy Reminder Don’t forget me this weekend!  The first line – the XML declaration – defines the XML version and the character encoding  The next line describes the root element  The next 4 lines describe 4 child elements of the root  The last line defines the end of the root element

5  All XML elements must have a closing tag ▪ The XML declaration is not a part of the XML document. It is not an XML element, and it should not have a closing tag  XML tags are case sensitive  XML elements must be properly nested  XML documents must have a root element  XML attribute values must be quoted  With XML, white space is preserved  The syntax for writing comments in XML is similar to HTML

6 XML (EXtensible Markup Language) Introduction to XML What is HTML What is XML XML Syntax Elements must have a closing tag Elements must be properly nested XML (Extensible Markup Language Introduction to XML What is HTML What is XML XML Syntax Elements must have a closing tag Elements must be properly nested

7  XML elements are related as parents and children  An XML element can have element content, mixed content, simple content, or empty content  An element can have attributes  XML documents often have a corresponding database, in which fields exist corresponding to elements in the XML document. A good practice is to use the naming rules of your database for the elements in the XML documents

8  Attributes are used to provide additional information, which is not relevant to the data, about elements  Try to avoid using attributes. Chuck Judy Reminder Don’t forget me this weekend! 10 30 2007 Chuck Judy Reminder Don’t forget me this weekend!

9  XML with correct syntax is Well Formed XML  XML validated against a DTD is Valid XML  A valid XML document is a Well Formed XML document, which also conforms to the rules of a DTD  XML DTD  A DTD defines the legal elements of an XML document  A DTD is used to define the document structure with a list of legal elements  XML Schema  An XML based alternative to DTD

10 WITH CSS  Examples WITH XSL  XSL (eXtensible Stylesheet Language) is far more sophisticated than CSS  Examples

11  The XML namespace attribute is placed in the start tag of an element and has the following syntax. The syntax is: xmlns:namespace-prefix="namespaceURI” where namespaceURI provides the namespace a unique name Apples Bananas African Coffee Table 80 120

12  Text inside a CDATA section will be ignored by the parser  A CDATA section starts with <![CDATA[ function matchwo(a,b) { if (a < b && a < 0) then { return 1 } else { return 0 } } ]]>

13  To let your XML parser understand foreign characters, you should save your XML documents as Unicode  Windows 2000 Notepad can save files as Unicode using “UTF-16” encoding  You will get error message  if your file was save as Unicode/UTF-16 but the encoding attribute specified a single-byte encoding like Windows- 1252, ISO-8859-1 or UTF-8  If your document was saved with single-byte encoding, but the encoding attribute specified a double-byte encoding like UTF-16

14 XML Editors will help you to write error-free XML documents, validate your XML against a DTD or a schema, and force you to stick to a valid XML structure.  XML Schema to define XML structures and data types  XSLT to transform XML data  SOAP to exchange XML data between applications  WSDL to describe web services  RDF to describe web resources  XPath and XQuery to access XML data  SMIL to define graphics Example: Altova XMLSpy


Download ppt " XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,"

Similar presentations


Ads by Google