Extensible Markup Language XML

  • View

  • Download

Embed Size (px)


Extensible Markup Language XML. MIS 520 – Database Theory Fall 2001 (Day) Lecture 14. Types of Databases. Data is facts and figures Database is a related set of data Kinds of databases Unstructured Meaning of data interpreted by user Semi-Structured - PowerPoint PPT Presentation

Text of Extensible Markup Language XML

  • Extensible Markup LanguageXMLMIS 520 Database TheoryFall 2001 (Day)Lecture 14

  • Data is facts and figuresDatabase is a related set of dataKinds of databasesUnstructured Meaning of data interpreted by userSemi-StructuredStructure of data wrapped around dataStructuredFixed structure of dataData added to the fixed structureTypes of Databases

  • XML is a text based markup language that is fast becoming a standard of data interchangeAn open standard from W3CA direct descendant from SGML

    Example: Product Inventory DataRefrigeratorR3456d2hGeneral Electric1290.001200


  • XMLs key role is data interchangeTwo business partners want to exchange customer dataAgree on a set of tagsExchange data without having to change internal databasesOther business partners can join in the exchange by using the tagsetNew tags can be added to extend the functionalityData InterchangeKey to successful data interchange is building consensus and standardizing of tag sets

  • TCP/IP Universal NetworkingHTML Universal RenderingJava Universal CodeXML Universal Data

    Numerous standard bodies are set up for standardization of tags in different domainsebXMLXBRLMMLCMLXML = Universal Data

  • Both are markup languagesHTML has fixed set of tagsXML allows user to specify the tags based on requirementsUsageHTML tags specify how to display dataXML tags specify semantics of the data Tag InterpretationHTML specifies what each tag and attribute meansXML tags delimit data & leave interpretation to the parsing applicationWell formednessHTML very tolerant of rule violations (nesting, matching tags)XML very strictly follows rules of well formedness

    HTML vs. XML

  • PrologInstructs the parser as to what it it parsingContains processing instructions for processorBodyTags- EntitiesAttributes- Properties of EntitiesComments- Statements for clarification in the documentExample Prolog

    SanjayGoel Body56 Della StreetPhoenixAZ15784

    Structure of XML

  • Contains eclaration that identifies a document as xmlVersionVersion of XML markup language used in the dataNot optional EncodingIdentifies the character set used to encode the dataDefault compressed Unicode: UTF-8StandaloneTells whether or not this document references external entityMay contain entity definitions and tag specificationsProlog

  • Uses less-than and greater-than characters () as delimiters Every opening tag must having an accompanying closing tag SanjayEmpty tags do not require an accompanying closing tag.Empty tags have a forward slash before the greater-than sign e.g. Tags can have attributes which must be enclosed in double quotes
  • XML documents have a tree structure containing multiple levels of nested tags. Root element is a single XML element which encloses all of the other XML elements and data in the documentAll other elements are children of the root element

    Root ElementSanjayGoel56 Della Street Child ElementsPhoenixAZ15784

    Tree Structure - Elements

  • AttributesAttributes are properties associated with an elementEach attribute is a name value pair No element may contain two attributes with same nameName and value are strings

    Example Attributes56 Della Street Nested ElementsPhoenixAZ15784

  • Data should be stored in ElementsInformation about data (meta-data) should be stored in attributesWhen in doubt use elementsRules of thumbElements should have information which some one may want to read.Attributes are appropriate for information about document that has nothing to do with content of document e.g. URLs, units, references, ids belong to attributesWhat is your meta-data may be some ones dataElements vs. Attributes

  • XML comments begin with All data between these delimiters is discarded

    Comments should not come before XML declarationComments can not be placed inside a tagComments may be used to hide and surround tags

    Sanjay Last tag is ignored

    -- string may not occur inside a comment except as part of its opening and closing tag IllegalComments