paper about xml

568 views
507 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
568
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

paper about xml

  1. 1. XML University of BenghaziFaculty of Information TechnologyDepartment of Graduate Studies The research paper titled XML XTENSIBLE MARKUP LANGUAGE 1
  2. 2. XML Table of Content1- Introduction …………………………………………………….. 32-What is befor xml ………………………………………………33-What is xml ……………………………………………………..…44-How can xml be used………………………………………....55-Xml document…………………………………………………....66-Xml document from a tree structure……………….….77-Xml elements……………………………………………………..88-Xml attributes………………………………………………..…..99-Xml syntax rules……………………….………………..……….910-Xml elements vs attributes…….……………….……….1011-Valid xml document…………………………………………1112-The difference between xml and html……………..1313-Xml is used to create new internet language……1514-Summary…………………………………………….…………..1615-REFERENCES…………………………………..……………….17 2
  3. 3. XMLINTRODUCTION WHAT IS BEFORE XML ?Binary files: A series of bits is identified by the application wasdesigned .We note that in the inability to read a file only by thethat feature binary files easily application for which they have madeunderstand binary codes by Computer .Text files : Text files are also similar binary files series of bits, butworking together with a standard manner, the only bad This type of file isthat we can not modify the text written the way we want .There are files that combines extensive interoperabilityInformation provided by text files in addition to effective and powerfulstorage capabilities provided by binary files (SGML)STANDARD GENERALIZED MARKUP LANGUAGE :A scripting language used to encode the data you need to a lot ofconsiderations for large data coding and as a result has become a verycomplicated language, but of the power comes complexity .HTML (Hyper Text Markup Language) : This language used to createweb pages and is not a programming language concept and shape knownin the other programming languages such as c language 3
  4. 4. XML What is XML ?stands for EXtensible Markup LanguageYou can fully control the formation XML document can form data the waywe wantEX: ORwas designed to carry data, not to display data :<note><to>Tove</to><from>Jani</from> small database<heading>Reminder</heading><body>Dont forget me this weekend!</body></note>is designed to be self-descriptiveis a W3C Recommendatio , February 10, 1998:XML became a W3C Recommendation on February 10, 1998 4
  5. 5. XML How Can XML be UsedXML Separates Data from HTML : If you need to display dynamicdata in your HTML document, it will take a lot of work to edit the HTMLeach time the data changes , With XML, data can be stored in separateXML files.XML Simplifies Data Sharing : In the real world, computer systemsand databases contain data in incompatible formats,XML data is stored inplain text format. This provides a software- and hardware-independentway of storing data, This makes it much easier to create data that can beshared by different applicationsXML Simplifies Data Transport: One of the most time-consumingchallenges for developers is to exchange data between incompatiblesystems over the Internet, Exchanging data as XML greatly reduces thiscomplexity, since the data can be read by different incompatibleapplicationsXML Simplifies Platform Changes : Upgrading to new systems(hardware or software platforms), is always time consuming. Largeamounts of data must be converted and incompatible data is often lost.XML data is stored in text format. This makes it easier to expand orupgrade to new operating systems, new applications, or new browsers,without losing dataXML Makes Your Data More Available : Different applicationscan access your data, not only in HTML pages, but also from XML datasources.With XML, your data can be available to all kinds of "reading machines"(Handheld computers, voice machines, news feeds, etc), 5
  6. 6. XML XML Document<?xml version="1.0" encoding="ISO-8859-1"?><note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Dont forget me this weekend! </body></note>The first line is the XML declaration. It defines the XML version (1.0) andthe encoding used (ISO-8859-1 = Latin-1/West European character set).The next line describes the root element of the document (like saying:"this document is a note")The next 4 lines describe 4 child elements of the root (to, from,heading, and body) 6
  7. 7. XML XML Documents Form a Tree StructureXML documents must contain a root element. This element is "theparent" of all other elements.The elements in an XML document form a document tree. The tree startsat the root and branches to the lowest level of the tree.<doc><parent> computer <em> 4 </em> arab </parent</doc> 7
  8. 8. XML XML ElementsAn XML document contains XML Elements.An element can contain:Other elements , Text , Attributes , MixEX :<bookstore> <book category="CHILDREN"> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> <book category="WEB"> <title>Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price> </book></bookstore>In the example above, <bookstore> and <book> have elementcontents, because they contain other elements. <book> also has anattribute (category="CHILDREN"). <title>, <author>, <year>, and<price> have text content because they contain textXML elements must follow these naming rules: Names can contain letters, numbers, and other characters 8
  9. 9. XML Names cannot start with a number or punctuation character Names cannot start with the letters xml (or XML, or Xml, etc) Names cannot contain spacesXML Attributesattributes provide additional information about elements<person gender="female"> XML Syntax RulesAll XML Elements Must Have a Closing Tag<p>this is paragraph ( illegal )<p>this is paragraph</p> ( legal )XML Tags are Case Sensitive .<Message>This is incorrect</message> ( illegal )<message>This is correct</message> ( legal )XML Elements Must be Properly Nested .<b><i>hello</b></i> (illegal)<b><i>hello</i></b> ( legal )Entity References :Some characters have a special meaning in XML.&lt; < less than&gt; > greater than&amp; & ampersand 9
  10. 10. XML&apos; apostrophe&quot; " quotation markWith XML, the white-space in a document is not truncatedWith XML, the white-space in a document is not truncatedComments in XML : <!-- This is a comment --> XML Elements vs. Attributes<person gender="female"> <firstname>Anna</firstname> <lastname>Smith</lastname></person><person> <gender>female</gender> <firstname>Anna</firstname> <lastname>Smith</lastname></person>IN THE FIRST EXAMPLE GENDER IS AN ATTRIBUTEIN THE LAST GENDER IS AN ELEMENT 10
  11. 11. XML Valid XML DocumentsXML DTD : The purpose of a DTD is to define what elements,attributes and entities is legal in an XML document.XML Schema : XML Schema is an XML basedalternative to DTD. EX : <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Dont forget me this weekend!</body> </note>DTD <!DOCTYPE note [ <!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> ]> 11
  12. 12. XMLSCHEMA <xs:element name="note"> <xs:complexType> <xs:sequence> <xs:element name="to" type="xs:string"/> <xs:element name="from" type="xs:string"/> <xs:element name="heading" type="xs:string"/> <xs:element name="body" type="xs:string"/> </xs:sequence> </xs:complexType></xs:element>CDATA:XML files contain data for use within computing applications. Whenapplications make use of XML data, they use XML parsing functions totraverse the contained tree structures, elements and attributes. XMLparsers can encounter problems when a section of content within an XMLfile contains particular characters. To avoid these problems, developerscan enclose certain parts of the content in an XML file within a CDATA(character data) section. 12
  13. 13. XML The Difference Between XML and HTMLXML is not a replacement for HTML.XML and HTML were designed with different goals:XML was designed to transport and store data, with focus on what data isHTML was designed to display data, with focus on how data looksHTML is about displaying information, while XML is about carryinginformation 13
  14. 14. XMLXPATH : (XML Path Language) is a query language forselecting nodes from an XML document. In addition, XPath may be usedto compute values (e.g., strings, numbers, or Boolean values) from thecontent of an XML document. XPath was defined by the World Wide WebConsortium (W3C)Xpointer , Xlink : XLink defines a standard way of creating hyperlinks in XML documents ,XPointer allows the hyperlinks to point to more specific parts (fragments)in the XML document.XSLT: (Extensible Stylesheet Language Transformations) is alanguage for transforming XML documents into other XMLdocuments,[1] or other objects such as HTML for web pages, plain text orinto XSL Formatting Objects which can then be convertedto PDF, PostScript and PNGDOM (DOCUMENT OBJECT MODEL): A DOM (Document ObjectModel) defines a standard way for accessing and manipulatingdocuments. 14
  15. 15. XML XML is Used to Create New Internet LanguagesXHTML :RELATION BETWEEN XML ANDHTML .WSDL : for describing available web services.WML : as markup languages for handheld devices.RSS : languages for news feeds.SMIL : for describing multimedia for the web. 15
  16. 16. XML summaryXMLXML can be used to exchange, share, and store data.XML documents form a tree structure that starts at "the root" and branches to "the leaves".XML has very simple syntax rules. XML with correct syntax is "Well Formed". Valid XML also validatesagainst a DTD.XSLT is used to transform XML into other formats like HTML.All modern browsers have a built-in XML parser that can read and manipulate XML.The DOM (Document Object Model) defines a standard way for accessing XML.The XMLHttpRequest object provides a way to communicate with a server after a web page has loaded.Text inside a CDATA section is ignored by the parser.XML DOM (Document Object Model)The XML DOM defines a standard way for accessing and manipulating XML documents.The XML DOM is platform and language independent and can be used by any programming languagelike Java, JavaScript, and VBScript.XSLT (XML Stylesheet Language Transformations)XSLT is the style sheet language for XML files.With XSLT you can transform XML documents into other formats, like XHTML.XML DTD (Document Type Definition)The purpose of a DTD is to define what elements, attributes and entities is legal in an XML document.With DTD, each of your XML files can carry a description of its own format with it.DTD can be used to verify that the data you receive, and your own data, is valid.XML Schema : XML Schema is an XML based alternative to DTD. 16
  17. 17. XMLUnlike DTD, XML Schemas has support for datatypes, and XML Schemause XML Syntax. 17
  18. 18. XML REFERENCESWEB SITES :HTTP://WWW.BOOSLA.COMHTTP://WWW.W3SCHOOLS.COMHTTP://WWW.C4ARAB.COMHTTP://KUTUB.INFO.COMhttp://wiki.answers.com 18

×