------------------------------------------------------------------------------
MC logo
XML
[^] CSc 302 Outlines
------------------------------------------------------------------------------
<<Deployment
  1. XML = eXtensible Markup Language.
  2. A collection of file types using balanced tags: <tags>...</tags> in a rococo arrangement of relationship and function.
    1. A standard way to transfer information between programs.
      1. XML news feeds are popular. For instance.
      2. MS is starting to use XML to store Office documents.
    2. XML files.
      1. Specify data in a structure.
      2. Use balanced <tags>...</tags>, make up whatever you like.
      3. Just start with xml line.
        <?xml version="1.0" encoding="ISO-8859-1" ?>
          <car>
             <make>Chevrolet</make>
             <color>Blue</color>
             <license type="private">
               <state>MS</state>
               <number>GED-348</number>
             </license>
          </car>

      4. Case-sensitive.
      5. Use &lt;, &amp;, etc. to include special characters in data.
    3. Document type definition (DTD) files tells what a correctly-constructed file looks like.
      1. Also an XML document.
      2. What tags are allowed.
      3. What tags go in what others.
      4. Order and number restrictions.
      5. [ Data File ] [ Type Definition ]
      6. On sandbox: xmllint -valid car.xml
      7. The ? means optional. Also + for one or more, and * for zero or more.
    4. Using an XML file.
      1. Client software may do whatever it likes with the XML file.
      2. Often it can be formatted into HTML or XHTML.
  3. Namespaces.
    1. Used to keeps sets of names apart.
    2. <tag xmlns:fred="url"...>
    3. <fred:name ...>
  4. Translating XML documents for display.
    1. XML documents contain data.
    2. One use is to translate them for some kind of display, into XHTML perhaps.
    3. Apply an external style sheet.
    4. There are several languages used for external style sheets.
      1. Using CSS. [ Car Display ] [ Style Sheet ]
        (Partially swiped from xml.com.)
      2. Translate the document using the eXtensible Style Language (XSL) Formatting Objects. (XSL/FO).
        1. Document contains literal output and selection commands. [ Cnet News RSS 2.0 summary ] [ RSS XSL Stylesheet ] The RSS stylesheet is from Juicy Studio.
        2. Sandbox command: xsltproc rss.xsl 2547-1_3-0-5.xml
        3. A [ local copy ] with style sheet link. (May work in Explorer.)
<<Deployment