1 / 26

XML and Enterprise Computing

XML and Enterprise Computing. What is XML?. Stands for “Extensible Markup Language” similar to SGML and HTML document “tags” are used to define content not just formatting can be defined for individual industries Allows e-commerce applications to publish databases to Web more easily

rio
Download Presentation

XML and Enterprise Computing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML and Enterprise Computing

  2. What is XML? • Stands for “Extensible Markup Language” • similar to SGML and HTML • document “tags” are used to define content not just formatting • can be defined for individual industries • Allows e-commerce applications to publish databases to Web more easily • merging of relational, O-O, and XML models

  3. What is meant by a “document”? • A form of presentation • paper, browser screen, voice, etc. • Structure and organization of elements • memo, contract, recipe, etc. • Informational content • text and numbers organized in relation to each other

  4. Relationship Among Markup Languages HTML SGML XML

  5. What are some current XML applications? • On-line banking • Push technology • Web automation • Database Publishing • Software Distribution

  6. Some sample HTML <!-- snippet of HTML --> <h1>Personal Computers For Sale</h1> <h2>Maker: Acme PC Inc.</h2> <h3>Model: Blaster 555</h3> <table border = 1> <tr> <td>Storage:</td> </tr> <tr> <td>RAM<td>72 MB</td> <tr> <td>Hard Disk</td><td>2 GB</td> </tr> </table>

  7. XML Sample <!--Snippet of an XML Document --> <PcForSale> <Make>Acme PC Inc</Maker> <Model>Blaster 555</Model> <Storage> <Ram Units = “MB”>72</Ram> <HardDisk Unites = “GB”>2</HardDisk> </Storage> </PcForSale>

  8. How is XML Presented? • XML includes a DTD (Document Type Definitions) • lists the element types and the order you are allowing them to occur • XML parser tests to see them are valid DTDs • XSL (XML Style Language) • similar to cascading style sheets • contain presentation information

  9. Another Example • Convert a business card into an XML document • start with representative XML content • define DTD elements

  10. XML Rules • Open and close tags define “elements” and each element must have a closing tag (except for “empty” elements) • Elements appear in a strict hierarchy; upper elements are parents of lower “child” elements. • DTD is not mandatory but it ensures two parties define a docement’s contents the same. • DTDs constrain the data, the hierarchy of content, and the number of times it may appear

  11. XML Rules (cont.) • Elements • XML is case sensitive • must have 1 and only 1 “root” element • elements consist of an “element name” and “element content” • element content may consist of character or other data or even other elements embedded • an XML schema or “tree” describes hierarchy of elements • empty elements are indicated by a trailing backslash

  12. Well-Formed XML Documents • Have one root element • All non-empty elements have start and stop tags that match exactly • All empty elements have correct trailing slash • Elements are strictly nested with no overlapping elements

  13. Attributes • Allow designer to add richer metadata to elements • Consist of attribute name and attribute value • attribute values are bounded by quotes • can specify as many attributes for each element as you want • some authors use UC text for attribute names to easily distinguish <addresses> <address ADDTYPE=“shipto” <firstname>Robert</firstname> ……… </address> </addresses>

  14. Defining a DTD • Element declaration begins with “<!ELEMENT” and ends with > • this contains an element name and content model surrounded by parentheses • elements can contain data or other elements or be empty • to indicate it contains data we use (#PCDATA) • if it contains other elements we list them in brackets (name, title, address, etc) • empty elements use the key word “EMPTY”

  15. Further DTD Specifications • Designer can specify the number of times an element may appear • “?” means it may occur 0 or 1 times in document • “*” means it may occur 0 or more times • “+” means it may appear 1 or more times • can enumerate possible alternative with “|” • can specify an attribute is required with #REQUIRED • #IMPLIED means attribute may not have a value

  16. Try another example • Think of your resume, posted say on Monster.com • What does html for this look like? • Write your resume in XML???? • What is the “root” element? • Why would this be valuable?

  17. Another Example • Creating an “order” in XML • include a “prolog”of XML document • header information before root element • may include processing instructions and DTD declaration ex. <?xml version=“1.0”?> <!DOCTYPE order SYSTEM “order.dtd”> • may include comments in prolog or after • start with <!- and end with ->

  18. XML Document XML App XML Processor XML DTD

  19. Some XML Processors • Processors are either “validating” or “non-validating” • Msxml • developed by MS Corp. Java and ActiveX versions • Aelfred • Java-based XML. Microstar Corp. • XP • Java-based XML processor by James Clark

More Related