XML- Extensible Markup Language

  • Published on
    07-Jan-2016

  • View
    18

  • Download
    0

Embed Size (px)

DESCRIPTION

XML- Extensible Markup Language. HTML to XML. HTML documents Emerging Web Standards - XML XML good for data interchange across platforms enterprise wide conversion HTML to XML - IBM, Microsoft. XML - Motivation. - PowerPoint PPT Presentation

Transcript

  • XML- Extensible Markup Language

  • HTML to XMLHTML documents Emerging Web Standards - XML XML good for data interchange across platforms enterprise wide conversion HTML to XML - IBM, Microsoft

  • XML - MotivationIn HTML, both the tag semantics and tags are fixed. There is limited and strict interpretation of tags.HTML is widely successful in disseminating documents across internet.Though data can be disseminated through HTML, its extraction is painful, and laborious.EDI has been a predominate mode of exchanging data among businesses. But it has very rigid format that requires highly customized applications.

  • XML - IntroductionXML aims to provide ease of authoring HTML documents with ease of data exchange that is possible with EDI.Tags are used to markup documents.XML is a meta-language for describing markup languages.XML provides a facility to define tags and structural relationships between them.No pre-defined tag set implied no preconceived semantics, semantics of XML document is defined by applications that process them

  • XML - GoalsStraightforward to use over internetSupport wide variety of applications, authoring, browsing, content analysis, etc.Easy to write programs that process XML documents and validate them.XML documents must be human-legible and reasonably clear.Design of XML shall be formal and concise - expressed as EBNF (extended Backus Naur Form) - amenable to modern compiler tools and techniques.

  • XML-featuresSome structure - not rigidExtensibility - User defined tagsnested elementsvalidation - documents may specify their own grammarDTD (Document Type Descriptor) - schema exists with data as tag namesApplication -EDI - extraction, conversion, , transformation, integration can be modeled using DOM

  • More terminologyRDF - Resource Description Framework - a method to describe metdata for XML documentsXSL - Extensible Stylesheet Language - language for transforming and formatting XML. Transformation Language - XSLT, XPath, Xpointer, Xlink

  • Example-HTMLPrint - Sanjay Madria Web Warehouse Tutorial, ADBIS99HTML Sanjay Madria Web Warehouse Tutorial, ADBIS99Very difficult to understand, structure is hidden, describes only appearance

  • XML

    Sanjay Madria Web Warehouse Tutorial ADBIS99

    another format:

  • XML can Separate Data from HTMLXML is used to Exchange DataXML can be used to Share DataXML can be used to Store DataXML can be used to Create new Languages (WML)

  • XML - a start-tag - a end tagTags are also called markups.Tags must be balanced; close in inverse order of their openingTags are defined by users, no predefined tags

  • Alan 42 agb@abc.com

    Element - ..Subelement Age

  • XML elements must follow these naming rules:Names can contain letters, numbers, and other characters Names must not start with a number or "_" (underscore) Names must not start with the letters xml (or XML or Xml ..) Names can not contain spaces

  • People on the fourth floor

    Alan 42 agb@abc.com

    Patsy 36 ptn@abc.com

    Ryan 58 rgz@abc.com

  • Can be abbreviated to

  • XML Attributes(Name, value) pair

    trompette six trous 420.12 31 rue Croix-Bosset92310SevresFrance

    Att.

  • Attributes takes always string values (..)A given attribute may occur only once within a tag, while subelements within same tag can repeat attributes

  • XML tags are case sensitiveWith XML, White Space is Preserved

    This text is bold and italicOk in HTMLThis text is bold and italic

  • XML Elements are ExtensibleExtract to MESSAGE To: Tove From: JaniDon't forget me this weekend!

  • - Tove Jani Reminder Don't forget me this weekend!

  • 1999-08-01 Tove Jani Reminder Don't forget me this weekend! No problem

  • Book Title: My First XMLChapter 1: Introduction to XMLWhat is HTML What is XML Chapter 2: XML SyntaxElements must have a closing tag Elements must be correctly nested

  • My First XML

    Introduction to XML What is HTML What is XML XML Syntax Elements must have a closing tag Elements must be properly nested

  • Anna Smith

    female Anna Smith

  • Bad Design

  • Tove Jani Reminder Don't forget me this weekend!

  • 12/11/99 Tove Jani Reminder Don't forget me this weekend!

  • 12 11 99 Tove Jani Reminder Don't forget me this weekend!

  • PCDATAXML parsers treat all text as Parsable Characters (PCDATA).When an XML element is parsed, the text between the XML tags is also parsed:CDATAEverything inside a CDATA section is ignored by the parser.Starts with "":

  • Alan 42 agb@abc.com

    or

    or

    Alan agb@abc.com

  • personemailagenamepersonageemailnameAlan42agb@abc.comAlan42agb@abc.com

  • XML can associates unique identifier to elements, as the value of certain attribute Called idRefer that element using idref

  • Tove Jani Reminder Don't forget me this weekend! Jani Tove Re: Reminder I will not!

  • NENevada

    CCNCarson City

  • abca

  • some string

    Assume c as reference attribute

    some string Assume b as reference attribute

  • IDIdaho

    NENevada.

    .

  • BOIBoise

    CCNCarson City

    MOCMoscow

  • Orderingperson:{firstname: John, lastname:Smith}person:{lastname: Smith,firstname: John}

    As SSD, both are same

  • These two are not same as XML documentsJohn Smith Smith John

    The following two are equivalent as attributes are not ordered

  • Mixing elements and Text

    This is my best friend Alan 42 I am not too sure of the following email agb@abc.com

  • - Comments are allowed anywhere except inside markup and is a part of the document.

    - Processing instructions for applications

    This is not PI, not passed to application.

    this is an incorrect element ]]>

  • Alan 42 agb@abc.com

    ]>

  • Recursion

    An example of such XML document is

    1 2 3

  • a1 b1 c1 a2 b2 c2 c2 d2 c3 d3 c4 d4

  • ]>

  • trompette six trous 420.12

  • IDREF attributes value is some other elements identifieriDREFS attributes value is a list of identifiers, separated by spaces

    ]>

  • Jane Doe John Doe Mary Smith Jack Smith

  • ]>

  • ]>

  • ]>

    Data on the web %abstract;%content;

  • Limitations of DTDImpose OrderNo notion of atomic type, for example age can be integer, but in DTD, it will be PCDATANo constraintsDo not constrain the type of IDREFs; state-of must be an identifier of a state element, while cities-in must be of type cityName tag may corresponds to classname and student name both

  • Bibliography Entries

  • Bibliography Entriest1a1a2t2a3a4t3a5a6 a7

Recommended

View more >