Presentation is loading. Please wait.

Presentation is loading. Please wait.

XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.

Similar presentations


Presentation on theme: "XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault."— Presentation transcript:

1 XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault

2 XML HISTORY Developed by work group, under authority of the W3C First seen in 1996, and standardized by the W3C in 1998 Simplified dialect of the SGML

3 SGML "Standard Generalized Markup Language" A method for creating interchangeable, structured documents Standardized in 1986 (ISO8879:1986) Can assemble a single document from many sources Defines a document structure using a special grammar called a Document Type Definition Adds markup to show the structural units in a document

4 HTML vs XML vs SGML HTML is an SGML application (a DTD and set of processing conventions) –As such it’s much more limited than SGML and XML –It’s easy to learn SGML is the mother of XML and HTML –It’s complicated – hundreds of pages in it’s definition –It has many extraneous features that aren’t needed on the web

5 HTML vs XML vs SGML II XML is a subset of SGML –Valid SGML –Only uses the parts that are useful on the web –Requires more syntax checking than HTML –Is extendable like SGML –Has a small definition (25 pages) –Easy to learn

6 How do I execute or run an XML file? You can't and you don't. XML is not a programming language, so XML files don't ‘run’ or ‘execute’. XML is a markup specification language and XML files are data.

7 Constructing your own XML You must supply a Document Type Definition What is a Document Type Definition (DTD)? A context-free grammar like Extended BNF Provides the rules that define the elements and structure of your new language Thousands of SGML DTDs already in existence SGML DTDs need to be converted to XML for use with XML systems

8 How is a DTD implemented? A DTD is a file (or several files to be used together), written in XML's Declaration Syntax It contains a formal description of a particular type of document It sets out what names can be used for element types, where they may occur, and how they all fit together Any browser (or application) with an XML parser could interpret an XML document instance by "learning" the rules defined by the DTD.

9 Defining the structure & Semantics of XML XML structure is defined in a schema Defines shared markup vocabularies Provide a means for defining the structure, content and semantics of XML Introduces new levels of flexibility that may accelerate the adoption of XML for significant industrial use

10 Schemas Schemas support inheritance and overriding old values Schemas are not yet a formal Recommendation, but a number of sites are starting to serve useful applications as both DTDs and Schemas

11 An XML example Example: Elements and Attributes This group of elements, attributes describe the contents of an address book. It includes a DTD which describes how all of the pieces work as XML. Jack Smith 513-555-3465

12 Required 1.The XML Declaration This is what tells an XML parser that the document is XML 2.XML Declaration w/ character set

13 Basic Syntax All tags must be closed The exception is an empty tag (i.e. ) All nested tags must close before the tag they are nested in All attributes must have quotes Case sensitive

14 Tags and DTD The DTD describes every object that can appear in the document An example section of a DTD is: This is an entry that says the element is composed of one or more elements.

15 Optional modifiers for the entries: 1.No modifier: Object appears once and only once in the element 2.+: Object appears at least once and can be repeated 3.*: Object appears zero or more times 4.?: Object appears zero or one times

16 Elements composed of multiple entries An element can be composed of multiple entries, for example an entry in the address book has: a name, phone number, and email Inside the parentheses are the elements that make up entry these can take the forms: (e1, e2): These elements will appear once each in order e1 e2 (e1 | e2): One of these elements will appear (either or) These can be combined as in: –(e1, (e2 | e3) )

17 Attributes of Elements Some elements have attributes, which are part of their data description. An attribute has: –The attribute tag opening: <!ATTLIST –The name of the element it belongs to: email –The attribute name: href –The attribute type: CDATA –Optionally a default value: #REQUIRED –The close bracket: >

18 Attributes of Elements II There can be more than one attribute listed in one attribute tag:

19 Referencing the DTD A DTD is referenced in the document using it with the tag:

20 Referencing the DTD II The section of the tag: SYSTEM "address- book.dtd"> Can be replaced with or followed by a [ and the actual DTD as in: <!DOCTYPE name [ ]>

21 Viewing the XML: XSL Because XML is just for describing data it isn’t inherently displayed in a particular way by a browser. XSL allows how things are displayed to be specified XSLT transforms the data into new forms XSLFO allows the style of the objects to be set A similar thing to XLSO which is more supported is CSS

22 Uses of XML 1.intelligent agents - content personalization via smart pull/push (possibly with a date-stamped XML repository) 2.structured records (purchase order) object with methods and data (Java, and potentially JavaScript) 3.meta-content about your web site (improves searches) query results 4.graphical user interface of an application 5.persistent storage format (e.g. ODBMS- powered XML repository)

23 Uses of XML II 6.electronic service manuals 7.online process/procedures documentation 8.EDI (electronic data interchange) - mapping data between purchasing and inventory departments of same or different companies

24 References http://www.w3.org/XML/ http://www.ucc.ie/xml http://www.xml.com/ http://www.gca.org/whats_xml/whats_xml_xmlfiles.htm http://www.schema.net/ most informative site: http://wdvl.com/Authoring/Languages/XML/Intro/ Also: XML for Dummies XML by Example by Que


Download ppt "XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault."

Similar presentations


Ads by Google