XML. 2 Microsoft The Extensible Markup Language (XML) is a general-purpose markup language. markup language It is classified as an extensible language

Embed Size (px)

Text of XML. 2 Microsoft The Extensible Markup Language (XML) is a general-purpose markup language. markup...

  • XML

    *Microsoft

    The Extensible Markup Language (XML) is a general-purpose markup language.It is classified as an extensible language because it allows its users to define their own tags.XML is a markup language for documents containing structured information. Its primary purpose is to facilitate the sharing of structured data across different information systems, particularly via the Internet. XML is recommended by the World Wide Web Consortium. It is a fee-free open standard. What is XML?

    *Microsoft

    So XML is Just Like HTML?No. In HTML, both the tag semantics and the tag set are fixed. An is always a first level heading and the tag is meaningless. XML specifies neither semantics nor a tag set.

    *Microsoft

    Why Is XML Important?Plain TextSince XML is not a binary format, you can create and edit files with anything from a standard text editor to a visual development environment. That makes it easy to debug your programs, and makes it useful for storing small amounts of data. XML provides scalability for anything from small configuration files to a company-wide data repository.

    Data IdentificationXML tells you what kind of data you have, not how to display it.

    *Microsoft

    Why Is XML Important?XML can Separate Data from HTMLWith XML, your data is stored outside your HTML.

    XML is Used to Exchange DataWith XML, data can be exchanged between incompatible systems.

    XML and B2BWith XML, financial information can be exchanged over the Internet.

    *Microsoft

    Why Is XML Important?XML Can be Used to Share DataWith XML, plain text files can be used to share data.Since XML data is stored in plain text format, XML provides a software- and hardware-independent way of sharing data.In the real world, computer systems and databases contain data in incompatible formats. One of the most time-consuming challenges for developers has been to exchange data between such systems over the Internet.Converting the data to XML can greatly reduce this complexity and create data that can be read by many different types of applications.

    *Microsoft

    Why Is XML Important?XML Can Be Used to Create Specialized VocabulariesXML is an extensible standard. By using XML as a base, you can create your own vocabularies. Wireless Application Protocol (WAP), Wireless Markup Language (WML), and Simple Object Access Protocol (SOAP) are some examples of specialized XML vocabularies.

    *Microsoft

    Other Applications of XMLMolecular sciences with CMLPeter Murray-Rusts Chemical Markup Language (CML)Science and math with MathMLThe Mathematical Markup Language (MathML) is an XML application for mathematical equations.Webcasting with CDFMicrosofts Channel Definition Format (CDF) is an XML application for defining channels. Web sites use channels to upload information to readers who subscribe to the site rather than waiting for them to come and get it. This is alternately called Webcasting or push.

    *Microsoft

    Other Applications of XMLSoftware updates through OSDThe Open Software Description (OSD) format is an XML application co-developed by Marimba and Microsoft for updating software automatically. OSD defines XML tags that describe software components. The description of a component includes the version of the component, its underlying structure, and its relationships to and dependencies on other componentsVector graphics with both PGML and VMLVector graphics better than GIF, JPEG imagesThe Precision Graphics Markup Language (PGML) from IBM, Adobe, Netscape, and Sun.The Vector Markup Language (VML) from Microsoft, Macromedia, Autodesk, Hewlett-Packard, and Visio

    *Microsoft

    Other Applications of XMLFinancial data with OFXthe Open Financial Exchange Format (OFX) is an XML application used to describe financial data of the type youre likely to store in a personal finance product like Money or Quicken. Any program that understands OFX can read OFX data. And since OFX is fully documented and non-roprietary (unlike the binary formats of Money, Quicken, and other programs) its easy for programmers to write the code to understand OFX.

    *Microsoft

    Other Applications of XMLFinancial data with OFX

    *Microsoft

    Other Applications of XMLFinancial data with OFX

    *Microsoft

    Other Applications of XMLAutomated voice responses with VoxMLFinancial data with OFXLegally binding forms with XFDLHuman resources job information with HRMLMeta-data through RDFInternal use of XML by various companies, including Microsoft, Federal Express, and Netscape

    *Microsoft

    XML SyntaxThe syntax rules of XML are very simple and very strict.

    An Example XML DocumentXML documents use a self-describing and simple syntax. Students Faculty Reminder Learn XML

    *Microsoft

    XML Syntax defines the XML version and the character encoding used in the document. In this case the document conforms to the 1.0 specification of XML and uses the ISO-8859-1 (Latin-1/West European) character set.

    The next line describes the root element of the document

    *Microsoft

    XML SyntaxThe next 4 lines describe 4 child elements of the root (to, from, heading, and body)Students Faculty Reminder Learn XML

    last line defines the end of the root element

    *Microsoft

    XML SyntaxAll XML Elements Must Have a Closing TagWith XML, it is illegal to omit the closing tag.In HTML some elements do not have to have a closing tag.

    The following code is legal in HTML:This is a paragraph This is another paragraph

    XML all elements must have a closing tag, like this:This is a paragraph This is another paragraph

    *Microsoft

    XML SyntaxXML Tags are Case Sensitive

    This is incorrect This is correct

    *Microsoft

    XML SyntaxXML Elements Must be Properly NestedImproper nesting of tags makes no sense to XML.

    This text is bold and italic

    In XML all elements must be properly nested within each other like this:This text is bold and italic

    *Microsoft

    XML SyntaxXML Documents Must Have a Root ElementAll XML documents must contain a single tag pair to define a root element.All other elements must be within this root element.All elements can have sub elements (child elements). Sub elements must be correctly nested within their parent element: .....

    *Microsoft

    XML SyntaxXML Attribute Values Must be QuotedWith XML, it is illegal to omit quotation marks around attribute values.XML elements can have attributes in name/value pairs just like in HTML. In XML the attribute value must always be quoted. Students Students

    *Microsoft

    XML SyntaxWith XML, White Space is PreservedWith XML, the white space in your document is not truncated.

    Comments in XMLThe syntax for writing comments in XML is similar to that of HTML.

    *Microsoft

    XML Sibling Elements 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 Sibling Elements: Title, prod, and chapter are siblings (or sister elements) because they have the same parent.

    *Microsoft

    Use of Elements vs. AttributesData can be stored in child elements or in attributes.

    ABC XYZ female ABC XYZ

    *Microsoft

    Use of Elements vs. AttributesSome of the problems with using attributes are: attributes cannot contain multiple values (child elements can) attributes are not easily expandable (for future changes) attributes cannot describe structures (child elements can) attributes are more difficult to manipulate by program code attribute values are not easy to test against a Document Type Definition (DTD) - which is used to define the legal elements of an XML document

    *Microsoft

    Well Formed XML DocumentWell Formed XML DocumentsA "Well Formed" XML document has correct XML syntax.A "Well Formed" XML document is a document that conforms to the following:XML documents must have a root element XML elements must have a closing tag XML tags are case sensitive XML elements must be properly nested XML attribute values must always be quoted

    *Microsoft

    Why usa a DTD?With a DTD, each of your XML files can carry a description of its own format. With a DTD, independent groups of people can agree to use a standard DTD for interchanging data. Your application can use a standard DTD to verify that the data you receive from the outside world is valid. You can also use a DTD to verify your own data.

    *Microsoft

    Valid XMLValid XML DocumentsA "Valid" XML document also conforms to a DTD.A "Valid" XML document is a "Well Formed" XML document, which also conforms to the rules of a Document Type Definition (DTD)

    *Microsoft

    Valid XMLXML DTD This is a statement of rules for an XML documentThe purpose of a DTD is to define the legal building blocks of an XML document. It helps ensure the accuracy of the information you collect. It helps ensure that the information gathered is in the most usable format for your business needs.

    *Microsoft

    DTDA DTD can be declared inline inside an XML document, or as an external reference.Internal DTD DeclarationIf the DTD is declared inside the XML file, it should be wrapped in a DOCTYPE definition with the following syntax:

    *Microsoft

    DTD Terms

    *Microsoft

    Inline to DTD ]> Students Faculty Reminder Don't forget to learn XML !!!

    *Microsoft

    External DTD DeclarationIf the DTD is declared in an external file, it should be wrapped in a DOCTYPE definition with the following syntax:

    File "note.dtd" which contains the DTD:

    *Microsoft

    DTD Explanation!DOCTYPE note defines that the root element of this document is note!ELEMENT note defines that the note element contains four elements: "to,from,heading,body!ELEMENT to defines the to element to be of type "#PCDATA"!ELEMENT from d