1 / 106

XML

XML. XML. XML stands for E X tensible M arkup L anguage. XML. XML stands for E X tensible M arkup L anguage XML is a markup language much like HTML. XML. XML stands for E X tensible M arkup L anguage XML is a markup language much like HTML XML was designed to describe data.

jalene
Download Presentation

XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML

  2. XML • XML stands for EXtensible Markup Language

  3. XML • XML stands for EXtensible Markup Language • XML is a markup language much like HTML

  4. XML • XML stands for EXtensible Markup Language • XML is a markup language much like HTML • XML was designed to describe data

  5. 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. You must define your own tags

  6. 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. You must define your own tags • XML uses a Document Type Definition (DTD) or an XML Schema to describe the data

  7. 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. 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

  8. 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. 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 • XML is a W3C Recommendation

  9. XML • XML does not DO anything

  10. XML • XML does not DO anything • XML is free and extensible

  11. XML • XML does not DO anything • XML is free and extensible • XML is a complement to HTML

  12. XML • XML does not DO anything • XML is free and extensible • XML is a complement to HTML • XML is future Web development

  13. XML • XML does not DO anything • XML is free and extensible • XML is a complement to HTML • XML is future Web development • XML is going to be everywhere.

  14. XML vs. HTML HTML is about displaying information XML is about describing information. HTML was designed to display data and to focus on how data looks. XML was designed to describe data and to focus on what data is.

  15. How can XML be Used XML can Separate Data from HTML

  16. How can XML be Used XML can Separate Data from HTML XML is used to Exchange Data

  17. How can XML be Used XML can Separate Data from HTML XML is used to Exchange Data XML can be used to Share Data

  18. How can XML be Used XML can Separate Data from HTML XML is used to Exchange Data XML can be used to Share Data XML can be used to Store Data

  19. How can XML be Used XML can Separate Data from HTML XML is used to Exchange Data XML can be used to Share Data XML can be used to Store Data XML can make your Data more Useful

  20. How can XML be Used XML can Separate Data from HTML XML is used to Exchange Data XML can be used to Share Data XML can be used to Store Data XML can make your Data more Useful XML can be used to Create new Languages

  21. XML Components Comment Declaration Root Element Element Nested Element (child element) Template Data Empty Element Attribute

  22. Comment <!-- Email XML Document --> … … … …

  23. Declaration <?xml version="1.0" encoding="ISO-8859-1"?> encoding=" UTF-7” encoding=" UTF-8”

  24. Root Element <?xml version="1.0" encoding="ISO-8859-1"?> <note> </note>

  25. Nested Elements <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to></to> <from></from> <heading></heading> <body></body> </note>

  26. Template Data <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Waqas</to> <from>Nadeem</from> <heading>Meeting Reminder</heading> <body>Don’t forget me this weekend</body> </note>

  27. Empty Element <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Waqas</to> <from>Nadeem</from> <heading>Meeting Reminder</heading> <body>Don't forget me this weekend!</body> <send /> </note> <send /> or <send></send> both are valid

  28. Attribute <?xml version="1.0" encoding="ISO-8859-1"?> <note id=“1101”date=“20-12-2006”> <to>Waqas</to> <from>Nadeem</from> <heading>Meeting Reminder</heading> <body>Don't forget me this weekend!</body> <send /> </note>

  29. All XML Components <?xml version="1.0" encoding="ISO-8859-1"?> <!-- Sample XML Document --> <note id=“112”> <to>Waqas</to> <from>Nadeem</from> <heading>Meeting Reminder</heading> <body>Don't forget me this weekend!</body> <send /> </note>

  30. Well Formed XML Documents

  31. Well-Formed Document Rules All XML elements must have a closing tag.

  32. Well-Formed Document Rules All XML elements must have a closing tag XML tags are case sensitive

  33. Well-Formed Document Rules All XML elements must have a closing tag XML tags are case sensitive All XML elements must be properly nested

  34. Well-Formed Document Rules All XML elements must have a closing tag XML tags are case sensitive All XML elements must be properly nested All XML documents must have a root element

  35. Well-Formed Document Rules All XML elements must have a closing tag XML tags are case sensitive All XML elements must be properly nested All XML documents must have a root element Attribute values must always be quoted

  36. Well-Formed Document Rules All XML elements must have a closing tag XML tags are case sensitive All XML elements must be properly nested All XML documents must have a root element Attribute values must always be quoted Attributes can not be duplicated in one element.

  37. Exercise Create a well-formed XML document describing the mobile phone specification which is send by one mobile phone manufacture to different phone dealers. You need to describe the following information with every mobile. mobile-code brand-name model color price

  38. Solution <?xml version="1.0" encoding="UTF-8"?> <mobiles> <mobile> <mobile-code>11-258-745</mobile-code> <brand-name>Nokia</brand-name> <model>6630</model> <color>silver</color> <price>299.99</price> </mobile> <mobile> <mobile-code>11-365-125</mobile-code> <brand-name>Samsung</brand-name> <model>D500</model> <color>black</color> <price>499.99</price> </mobile> </mobiles>

  39. XML Transformation

  40. XML Transformation XML does not use predefined tags and the meaning of these tags are not well understood.

  41. XML Transformation XML does not use predefined tags and the meaning of these tags are not well understood. A <table> element could mean an HTML table, a piece of furniture, or something else - and a browser does not know how to display it.

  42. XML Transformation XML does not use predefined tags and the meaning of these tags are not well understood. A <table> element could mean an HTML table, a piece of furniture, or something else - and a browser does not know how to display it. We can transform XML files into other formats like HTML, Text, XML, DOC, PDF

  43. XML Transformation • XML does not use predefined tags and the meaning of these tags are not well understood. • A <table> element could mean an HTML table, a piece of furniture, or something else - and a browser does not know how to display it. • We can transform XML files into other formats like HTML, Text, XML, DOC, PDF • We use following technologies for transformation • CSS • XSL / XSLT • XSLT-FO

  44. CSS Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of a document written in a markup languages. Its most common application is to style web pages written in HTML, XHTML or XML

  45. CSS Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of a document written in a markup languages. Its most common application is to style web pages written in HTML, XHTML or XML CSS define how to display HTML elements

  46. CSS Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of a document written in a markup languages. Its most common application is to style web pages written in HTML, XHTML or XML CSS define how to display HTML elements Styles are normally stored in Style Sheets

  47. CSS Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of a document written in a markup languages. Its most common application is to style web pages written in HTML, XHTML or XML CSS define how to display HTML elements Styles are normally stored in Style Sheets Styles were added to HTML 4.0

  48. CSS Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of a document written in a markup languages. Its most common application is to style web pages written in HTML, XHTML or XML CSS define how to display HTML elements Styles are normally stored in Style Sheets Styles were added to HTML 4.0 External Style Sheets are stored in CSS files

  49. CSS Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of a document written in a markup languages. Its most common application is to style web pages written in HTML, XHTML or XML CSS define how to display HTML elements Styles are normally stored in Style Sheets Styles were added to HTML 4.0 External Style Sheets are stored in CSS files External Style Sheets can save you a lot of work

  50. catalog.xml <?xml version="1.0" encoding="UTF-8"?> <catalog> <cd> <title>Titanic</title> <country>Pakistan</country> <company>Columbia Pictures</company> <price>100</price> <year>2000</year> </cd> <cd> <title>Jurassic Park</title> <country>United Kingdom</country> <company>Paramount Pictures</company> <price>100</price> <year>2002</year> </cd> </catalog>

More Related