Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Tools for Memory: Semantic Content (XML) Mahesh Chaudhari School of Computing and Informatics Department of Computer Science and Engineering Arizona.

Similar presentations


Presentation on theme: "1 Tools for Memory: Semantic Content (XML) Mahesh Chaudhari School of Computing and Informatics Department of Computer Science and Engineering Arizona."— Presentation transcript:

1 1 Tools for Memory: Semantic Content (XML) Mahesh Chaudhari School of Computing and Informatics Department of Computer Science and Engineering Arizona State University

2 2 Outline  World Wide Web (WWW) and HTML  Migration towards XML  What is XML?  XML supporting Technologies  Languages based on XML specifications  Conclusion

3 3 World Wide Web (WWW) and HTML  Giant network of computers.  Part of day to day activities.  Emails, chat, video, news.  Most important Browsing or surfing the Net.  HTML (Hyper-Text Markup Language)  common language for Internet.

4 4 Why HTML?  Easy to understand, learn and use.  Quick and fancy way of presentation.  Fixed set of instructions in the form of elements (tags) and attributes.  e.g.,,, etc.  Standard for sharing information over Internet.  Understandable by all the Internet browsers.  Text Based browsers e.g. Lynx, HyperTerminal, etc.  Graphical browsers e.g. IE, Firefox, Netscape Navigator, etc.

5 5 Structure of HTML Document. course course 123 databases S. Urban 3  Root of the Document  Cover Page of the Document  Main Content of the Document  Draws a Table with course Information in rows and columns. Header Contents

6 6 Tree Structure for HTML

7 7 Why not HTML?  Fixed set of elements vs. User-defined HTML: S. Urban XML: S. Urban  Similarly with the attributes.  Cannot exchange information between different applications, organizations, etc.  Cannot provide more meaning to the data (semantics to the data).

8 8 Internet/Network Hospital School Company Personal Records Student/Person University School Records University Records Health Records Employment Records Virtual Organization Sharing Information Understanding what is being sent/received

9 9 Can XML be THE Solution?

10 10 eXtensible Markup Language (XML)  Similar to HTML (consists of elements, attributes and DATA).  Allows definition of user-defined elements and attributes ( tag is allowed).  More meaning to the data (adds semantics to the data).  Extensively used for data exchange.  Understood by most of the Internet browsers. More Strict, Powerful and Rich than HTML.

11 11 Structure of XML Document 123 databases S. Urban 3 124 software engineering J. Urban 3  Root  Main Content of the Document User-defined elements give more meaning to the data

12 12 Is XML Strict? course course 123 databases S. Urban 3 Allowed in HTML 123 databases S. Urban 3 For every starting element XML should always have ending element ! HTML XML ? 123 databases S. Urban 3 Not allowed in XML Allowed in XML

13 13 This text is bold and italics. but this text is only italics. Is XML more strict than that? This text is bold and italics. but this text is only italics. All the elements in XML document should be properly nested ! course This text is bold and italics. but this text is only italics. Allowed in HTML HTML XML Not allowed in XML Allowed in XML

14 14 Key Features of XML  User-defined tags/elements possible.  Document has only one root element.  Document must be well-formed.  Every start tag should have end tag.  Tags must be properly nested.  Tags in XML are case sensitive and may not contain white space.  Tags must start with a letter or underscore, and may contain letters, digits, period (. ), underscore( _ ) or hyphen ( - )  Tags cannot begin with the letters "xml" - reserved  Tags should have semantic meaning.  Start tags may have attributes.

15 15 Elements  Elements  Always consist of start_tag, data (optional), and end_tag.  E.g. 123 or  Attributes  Provide metadata information or additional information for the element and occur only once inside the element.  E.g.

16 16 Special Attributes in XML  ID and IDREF  ID: unique value in the whole document.  IDREF: reference the unique ID values in the document. e.g. S. Urban P. Dasgupta … …

17 17 Data-centric XML  Regular, defined structure.  Ordering of tags immaterial.  Used for machine reading.  E.g. Course information or Instructor Information.

18 18 Data-centric XML E.g. Course Information 123 databases S. Urban 3 124 software engineering J. Urban 3

19 19 Document-centric XML  Less regular structure.  Ordering of tags important.  Mostly used for human consumption.  E.g. Product description, Book Information, Library Catalogs.

20 20 The Turkey Wrench from Full Fabrication Labs, Inc. is like a monkey wrench, but not as big. The turkey wrench, which comes in both right- and left- handed versions (skyhook optional), is made of the finest stainless steel. The Readi-grip rubberized handle quickly adapts to your hands, even in the greasiest situations. Adjustment is possible through a variety of custom dials. You can: Order your own turkey wrench Read more about wrenches Download the catalog The turkey wrench costs just $19.99 and, if you order now, comes with a hand-crafted shrimp hammer as a bonus gift. Document-centric XML E.g. Product Description

21 21 XML a Jigsaw Puzzle  Supporting Technologies  Give meaning to the elements.  Data types for every element.  Traversing, querying mechanism.  Support in other programming languages.  Presentation like HTML. XML XSD DTD DOM CSS XSLT XPATH SAX XQUERY

22 22 Meaning and Structure to XML  Document Type Definition (DTD)  Describes the structure of the XML document.  Legal Parents – Children relationships.  Custom non-XML syntax to describe the schema.  Does not support data types and namespaces.  XML Schema Definition (XSD)  XML-like syntax to describe the schema.  Supports different data types.  Support namespaces.

23 23 Traversing and Querying  XPath  Navigate through the XML document.  Find a particular element or attribute.  Building block for XQuery, XSLT.  XQuery  Find and retrieve elements and attributes from XML document.  Query language similar to SQL.  Supported by relational databases like Oracle and SQL server.

24 24 Other Programming Languages Support  Document Object Model (DOM)  Standard way of accessing and manipulating XML elements.  Loads the entire XML document in the memory (RAM).  Bi-directional traversal of the XML tree.  Slow and high memory consumption for large XML documents.  Simple API for XML (SAX)  Event-driven parser to access XML elements.  Reads the XML document from the file, element-by- element basis.  Unidirectional traversal of the XML tree (top to bottom).  Fast and low memory consumption for large XML documents.

25 25 Presenting XML Data  Cascading Style Sheet (CSS)  Set of instructions to present data in readable format.  Non-XML syntax to make data look pretty.  Used in conjunction with HTML.  EXtensible Stylesheet Language Transformations (XSLT)  Transforms XML document into HTML, another XML or text file.  Uses XPath extensively.  XML-like syntax.

26 26 Other Markup Languages  MathML : Markup language for Mathematics  SVG : Scalar Vector Graphics  MusicXML: an XML-based music notation file format.  VoiceXML: format for specifying interactive voice dialogues between a human and a computer  Linguists : Use of XML in studying different languages and their grammar. http://en.wikipedia.org/wiki/List_of_XML_markup_languages

27 27 Useful Links  http://xml.coverpages.org/PESC-HS-Transcript2006.htmlXML High School Transcript Standard  http://enterprise.astm.org/REDLINE_PAGES/E2369.htmXML Health care Record Standard  http://www.w3schools.com/xml/default.aspXML Tutorial from W3Cschools  http://www.w3schools.com/xsl/xsl_languages.aspXSL Tutorial from W3Cschools  http://www.w3schools.com/xpath/default.aspXPath Tutorial from W3Cschools  http://www.w3schools.com/xquery/default.aspXQuery Tutorial from W3Cschools  http://www.w3schools.com/dtd/default.aspDTD Tutorial from W3Cschools  http://www.w3schools.com/schema/default.aspXML Schema (XSD) Tutorial from W3Cschools  http://www.xml.com/pub/rg/XML_EditorsXML Editors (contains a list of editors, not exhaustive many more exist outthere)  http://www.w3.org/The World Wide Web Consortium (W3C)  http://www.wowwiki.com/XML_User_InterfaceWorld of Warcraft and XML  http://docs.info.apple.com/article.html?artnum=93732iTunes and XML

28 28 Internet/Network Hospital School Company Personal Records Student/Person University School Records (XML) University Records (XML) Health Records (XML) Employment Records Revisit Virtual Organization Sharing Information Understanding what is being sent/received

29 29 Summary  HTML and WWW  Limitations of HTML  Introduction to XML  XML  Structure  Key features  Data-centric Vs. Document-centric.  Supporting technologies

30 30

31 31 Document Type Definition (DTD) The following slides are derived from the slides of Dr. Suzanne Dietrich. She is an assistant professor at the West campus, Department of Mathematical Sciences & Applied Computing.

32 32 Document Type Definition (DTD)  Describes the structure of the XML document.  Legal Parents – Children relationships.  Can be defined as internal section of the XML document before the root element of the XML document.  Can be attached to XML document as an external reference.

33 33 Structure of DTD Document   contentSpecification defines the content of the element  ANY: No restrictions on the element’s content; limited use  EMPTY: Cannot store any content (assume attributes)  #PCDATA: Contains parsed character data (NO ELEMENTS) < (  Nested elements using parentheses  Mixed elements – can contain parsed character data and nested elements

34 34 DTD: Nested Elements  (element1, element2, element3) indicates a sequence of elements, i.e., ordered  (elementA | elementB | elementC) indicates a choice of elements

35 35 DTD: Elements Cardinality  element+: element occurs one or more times  element*: element occurs zero or more times  element?: optional (0 or 1)  element : exactly once

36 36 DTD: Mixed Elements  Elements with mixed content allow for both parsed character data or child elements.  Allows any number of occurrences of pcdata or child elements  Not very useful for a document with defined structure.

37 37 Limitations of DTD  No support for newer features of XML — most importantly, namespaces.  Lack of expressivity. Certain formal aspects of an XML document cannot be captured in a DTD.  Custom non-XML syntax to describe the schema.


Download ppt "1 Tools for Memory: Semantic Content (XML) Mahesh Chaudhari School of Computing and Informatics Department of Computer Science and Engineering Arizona."

Similar presentations


Ads by Google