Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to XML Kostas Kontogiannis Evan Mamas.

Similar presentations


Presentation on theme: "Introduction to XML Kostas Kontogiannis Evan Mamas."— Presentation transcript:

1 Introduction to XML Kostas Kontogiannis Evan Mamas

2 Outline zIntroduce XML, HTML and SGML zCompare and Contrast yXML vs. HTML yXML vs. SGML zXML yComponents, Applications, Industry zThoughts on XML

3 What is XML? zeXtensible Markup Language zProper subset of SGML for web use zMeta-language yAllows you to create your own markup languages zCompromise between HTML and SGML

4 What is HTML ? zHyperText Markup Language zLanguage to describe information for transmission over the web. zUses tags to markup the information zTags are just a formatting tool zExample y Hello, World

5 Why isn’t HTML enough? zGood enough for presenting text on the web zNot accepted as an authoring or archival form zExtensibility yHTML standard changes continually yUses tags for formatting zStructures yHas no defined or definable structural rules

6 What is SGML ? zStandard Generalized Markup Language yInternational Standard for over 10 years zLanguage for specifying markup languages zDescribes only the formal properties and inter- relations of the components of a document zDocument, Entities, Elements, Attributes

7 Uses of SGML zFormally structured documents yTechnical Manuals zExchange documents yProduct documentation zData encoding zInterchange specification zProvide long-term storage of information which was independent of suppliers and changes in h/w and s/w

8 SGML Example zMemo zDTD (Document Type Definition) All staff Martin Bryan 5th November Cats and Dogs Please remember to keep all cats and dogs indoors tonight.

9 Why isn’t SGML enough? zSpecification is very long zContains many options not needed for Web applications zTime consuming and high cost yExpensive tools zToo much for small applications zBad reputation

10 XML vs. HTML zNew tags and attributes definitions allowed zDocument structures can be nested to any level of complexity zStructural validation is possible by describing the grammar

11 XML vs. SGML zXML is the minimum required subset of SGML for web use zEasier to implement and to create tools for zA new attempt at structured markup languages with a new “face”

12 XML Components zXML Style Language (XSL) zCascading Style Sheets, level 2 CCS2 zXML Document Object Model (DOM) zXML Linking Language (XLL) zXML Pointer Language (XPL) zXML Name Spaces zSynchronized Multimedia Integration Language (SMIL) zResource Description Framework (RDF) zMathematical Markup Language (MathML)

13 XML Components (cont.) zXML Style Language (XSL) yDefines a way to present the documents ySeparates formatting from content yHas two steps: xGenerate a result tree (associate patterns with templates) xUse XML Namespace (formatting vocabulary) to generate formatted output. ySimilar to DSSSL for SGML

14 XML Components (cont.) zCascading Style Sheets, level 2 CCS2 yDefines a way to present documents ySimilar to XSL (Not as strong) ySupported by most browsers Bach's home page H1 { color: blue } Bach's home page Johann Sebastian Bach was a prolific composer.

15 XML Components (cont.) zXML Document Object Model (DOM) yIn-memory model for representing parsed XML documents yDesigned to provide common structures in XML browsers yIntended to enable interoperable XML processing across browsers yImplemented by Internet Explorer and Netscape

16 XML Components (cont.) zXML Linking Language (XLL) yLinks by reference rather than exact location yProvides hyperlinking elements xSimple links like HTML links xExtended Multi-directional links Links with multiple destinations Placing content inline from a linked document yRequires use of XML Pointer Language

17 XML Components (cont.) zXML Name Spaces yVocabulary of all elements and attribute types xNamespace prefix (mapped to Uniform Redource Identifier) xLocal Part yAllows use of names defined in other documents yModularity and reuse of a markup yMechanisms to establish name scope

18 XML Components (cont.) zSynchronized Multimedia Integration Language (SMIL) yLanguage for describing interactive synchronized multimedia distributed on the Web ySeveral components (images, video, audio) can be linked together to create a presentation on the web zResource Description Framework (RDF) yAbstract mechanism for defining simple relationships among web resources zMathematical Markup Language (MathML) yLanguage to describe mathematical expressions

19 XML DTD zDefines the hierarchy of all user-defined elements (tags) in the XML document zDeclares the attributes and behaviour of each XML element zEach XML document calls a specific DTD file to validate its elements

20 XML DTD z Defines what other tags are within the tag Defines data types for contents within the tag

21 XML Document (page 1 of 2) z z include stdio.h: z z include math.h z z code statement3: z z code statement2: z z char* z UW z Calls a XSL style sheet Calls a DTD document

22 XML Document (page 2 of 2) z z int z numOfstudents z z char* z facultyName z z student_profile z z elec_eng z z name z

23 XML Namespaces zLatest milestone for W3C's XML technology (14-January-1999 ) zW3C’s definition of XML NameSpaces: y“XML namespaces provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references.” zWhy use it? xMaintain tag meaningfulness and uniqueness zHow does it solve the problem? xAdd context to XML tags by using prefix and URL

24 XSL Document (Page 1 of 3) z z This page consists of XML, XSL, Namespace, HTML, and Java Applet z Sample C Code (hidden XML tag) z z The above command prints out all contents within tags without any formmating, ordering, linebreaks, etc. z z End of IncludeTag, ascending sort on Include Tag Content Namespace for XSL Namespace for HTML

25 XSL Document (Page 2 of 3) z z End of SourceTag, ascending sort on SourceTag Content z z End of Declaration, ascending sort on Type_Name z

26 XSL Document (Page 3 of 3) z z End of Return_Type z z End of Function_Name z z End of Argument z

27 Applications that require XML zInformation exchange between heterogeneous databases yHealth care example zDistributed processing ySemiconductor industry example zMultiple views of the same data z“Intelligent” information agents

28 Using XML zXML for Storage yCompact syntax yGeneralized and standarized yProduct independent zXML for Searching yUse of content specific markup enables robust searching ySearch engines need to be XML aware yCan use current SGML search engines

29 What is DOM? zA programming API for XML zlogical structure of document zAccess and Manipulation of documents

30 What is DOM? zAs an object model, DOM identifies yInterface and Objects used for the doc. yBehaviours and Attributes yRelationships and Collaborations of Interfaces and Objects

31 What is DOM? z2 Major Components for DOM Level 1 yDOM Core = Basic functionalities for XML yDOM HTML = Objects and Methods specific to HTML zLevel 2 yDOM CSS, DOM Event, DOM Filters and Iterators, DOM Range

32 Advantages of using DOM zEasy to create, navigate, add, modify documents zDOM abstraction avoids implementation dependencies zDOM applications may use additional language bindings

33 A Typical DOM Structure if (b == c) {a += c}

34 A Typical DOM Structure (2) > if(b==c){a+=c}

35 A Typical DOM Structure (3) zDOM abstraction is a Tree or Forest Structure zUsers have full flexibility to specify the structure zStructural Isomorphism

36 Some Key Objects zNode yTree node of the document yroot node, parents and children zElement (is a Node object) yElements of a document yRepresents contents between the start tag and end tag yAttributes: defined by DTD

37 Some Key Objects (2) zDocument yroot node of a document zNodeIterator yiterates over a set of nodes specified by a filter zAttributeList ycollection of Attribute objects, indexed by attribute name

38 Some Key Objects (3) zAttribute yattribute of an Element Object zDocumentContext yrespository for metadata about a document zDOM yprovides instance-independent document operations

39 Memory Management for DOM zDOM APIs operate across a variety of memory implementation methods: yLanguage platforms that do not expose memory management to user yLanguage (Java) that provides constructors with Garbage collection capability yLanguage (C/C++) that requires explicit memory allocations

40 Resources/Quirks yIE 5 and Navigator 5.0 implement different features: xIE 5.0 - XML/XSL Navigator - XML/CSS xNavigator to support RDF yXML Resources: xhttp://www.swen.uwaterloo.ca/~group1

41 Using XML (cont.) zXML for Presentation yConvert to HTML at server yUse Java applications to render in browser xSlow yUse XSL or CSS to render in browser xFast

42 XML in the industry zExplosive growth of XML tools and specifications yTools: JADE, MSXML, JUMBO,... ySpecifications: CDF, CFML,EDI yBrowsers: IE, Netscape

43 Thoughts on XML zSeems like a transition stage between HTML and SGML yWill we eventually end up using SGML? zXML follows basic principles of SE yHigher abstraction layer yReuse yModularity

44 References zXML.COM - A guide to XML yhttp://www.xml.com/xml/pub/w3j/s3.walsh.html zXML.COM - The Road to XML: Adapting SGML to the Web yhttp://www.xml.com/xml/pub/w3j/s1.discussion.html zThe Computer Bulletin - The XML Files yhttp://www.bcs.org.uk/publicat/ebull/may98/xml.htm zXML, Java, and the future of the Web yhttp://sunsite.unc.edu/pub/sun-info/standards/xml/why/xmlapps.htm zXML: What is it yhttp://iai.sgml.com/980106-01.asp zWhy do we need XML? yhttp://info.admin.kth.se/SGML/Konferenser/xml98sve/seminar.html zAn Introduction to the Standard Generalized Markup Language yhttp://www.personal.u-net.com/~sgml/sgml.htm zSGML101 yhttp://www.uslynx.com/sgml101.htm


Download ppt "Introduction to XML Kostas Kontogiannis Evan Mamas."

Similar presentations


Ads by Google