1 / 9

WHAT THE HELL IS XML?

WHAT THE HELL IS XML?. What the hell is XML?. Markup Language Derived from SGML (Standardized General Markup Language) Describes the CONTENT (stylesheet has to be applied to format content) Structured documents, can be used like a database that you can send to your clients/suppliers

margie
Télécharger la présentation

WHAT THE HELL IS XML?

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. WHAT THE HELL IS XML?

  2. What the hell is XML? • Markup Language • Derived from SGML (Standardized General Markup Language) • Describes the CONTENT (stylesheet has to be applied to format content) • Structured documents, can be used like a database that you can send to your clients/suppliers • They can then use the data in any XML-supporting database/app

  3. Like HTML? • Both based on SGML • Both use tags < … > • In both, tags enclose content.. • <TAGNAME>..content..</TAGNAME> • In both, tags have attributes.. • <TAGNAME ATTRIBUTENAME=“attributevalue”>

  4. Like HTML? • XML MUST have closing tags • <P>This is a paragraph • <P>This is invalid in XML • MUST have quotation marks around attributes • <FONT SIZE=9>No quotes</FONT> • CaSE senSiTivE! • <CaSE>This will not close</CASE> • XML has a strict syntax • Documents must be well-formed! • XML documents must start with an xml tag.. • <?xml version=“1.0” standalone=“yes” ?>

  5. Object Modelling • <APOGEE> • <EMPLOYEE> • <NAME>Irfan</NAME> • <PHONE>770-980-0099</PHONE> • </EMPLOYEE> • <EMPLOYEE> • <NAME>Michelle</NAME> • <PHONE>678-357-3661</PHONE> • </EMPLOYEE> • </APOGEE> • In a database, Apogee would be the database name, Employee would be the Table, Name and Phone would be columns • In object models, Employee would be the object, Name and Phone would be Properties

  6. Attributes • <APOGEE> • <EMPLOYEE role=“programmer”> • <NAME>Irfan</NAME> • <PHONE type=“home”>678-981-0193</PHONE> • <PHONE type=“cell”>770-980-0099</PHONE> • </EMPLOYEE> • <EMPLOYEE role=“director”> • <NAME>Joel</NAME> • <PHONE type=“cell”>678-357-3661</PHONE> • </EMPLOYEE> • </APOGEE> • Debate over when to use attributes and when to use elements • MS XML tends to use attributes by default (faster to process?) • Standard XML used elements more

  7. XML – The Rules • Document Type Definitions (DTDs) • Give the rules for validating documents • A bit like a database schema/object model • Describes the rules of the structure • Relationships between elements (e.g. one to many) • Which elements contain which other elements • In Backus Naur Form (BNF) – obscure? • XML Schemas • For a similar purpose to DTDs • Are taking over from DTDs • Are expressed in XML • <xsd:schema>…</xsd:schema>

  8. XML – The Rules • Referencing a DTD • <!DOCTYPE DOCUMENT PUBLIC “-//W3C//DTD HTML 4.0//EN” “http://www.w3.org/TR/REC-html/strict.dtd”> • The above is the strict DTD for DHTML (HTML 4)

  9. XML Editors • Schema Editors • Some allow you to turn a DTD into a schema • XML Spy • Turbo XML • Schema Verifiers • Only check the doc is well formed • Expat http://www.jclark.com/xml/expat.html • Schema Validator • World Wide Web Consortium • http://www.w3.org/2000/09/webdata/xsv • XML Parser • Xerces Java • http://xml.apache.org/xerces-j/

More Related