Presentation on theme: "XML stands for Extensible Markup Language."— Presentation transcript:
1 XML stands for Extensible Markup Language. Week-8 (Lecture-1)XML:XML stands for Extensible Markup Language.XML was designed to store and transport data.XML was designed to be both human- and machine-readable.Ex.XML Code Example:<note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>HTML CODE Example:<html><head> <title> test page </title></head><body><h1> hello </h1><b> how are you </b><p> new paragraph </p></body></html>
2 The Difference between XML and HTML Week-8 (Lecture-1)The Difference between XML and HTMLXML was designed to carry data - with focus on what data isHTML was designed to display data - with focus on how data looksXML tags are not predefined like HTML tags areXML Does Not Use Predefined Tags:The XML language has no predefined tags.The tags <to> and <from> are not defined in any XML standard.These tags are "invented" by the author of the XML document.HTML works with predefined tags like <p>, <h1>, <table>, etc.With XML, the author must define both the tags and the document structure.
4 XML documents are formed as element trees. Week-8 (Lecture-1)XML Tree StructureXML documents are formed as element trees.An XML tree starts at a root element and branches from the root to child elements.All elements can have sub elements (child elements)Ex.<root> <child> <subchild>.....</subchild> </child> </root>
5 The syntax for writing comments in XML is similar to that of HTML. Week-8 (Lecture-1)Comments in XMLThe syntax for writing comments in XML is similar to that of HTML.<!-- This is a comment -->Two dashes in the middle of a comment are not allowed.Ex.<!-- This is a -- comment -->
6 Week-8 (Lecture-2)XML Elements vs. Attributes: Take a look at these examples: Ex-1 Ex-2
7 XPath is a syntax for defining parts of an XML document Week-8 (Lecture-2)XML and XPath:(XPath (the XML Path language) is a language for finding information in an XML document.)XPath is a syntax for defining parts of an XML documentXPath uses path expressions to navigate in XML documentsXPath contains a library of standard functionsXPath is a major element in XSLTXPath is also used in XQuery, XPointer and XLink
To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.