Everything You Always Wanted To Know About XML But Were Afraid To Ask

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite & 1 Group

    Everything You Always Wanted To Know About XML But Were Afraid To Ask - Presentation Transcript

    1. “ Everything you always wanted to know about XML * * But were afraid to ask”
    2. <everything>
      • XML basics
      • A bit of web history
      • XML in detail
      • Where is XML used?
      • Creating XML
      • Manipulating XML
      • Pros and cons
    3. XML basics
      • <?xml version=&quot; 1.0 &quot;?>
      • <manual id=&quot; CRDA/ULCC/IMP/BPM/1.0 &quot;>
      • <title> Biscuit Procedures Manual </title>
      • <author> Ruth Vyse </author>
      • <date> 1998-04-01 </date>
      • <content>
      • <heading> Purpose </heading>
      • <para> This document describes the procedures for
      • <list>
      • <item> provision of an adequate quantity of biscuits </item>
      • <item> provision of an adequate variety of biscuits </item>
      • </list>
      • </para>
      • </content>
      • </manual>
      • XML declaration
      • Elements
      • Attributes
      • Well-formed
      • Valid?
    4. A bit of web history
      • SGML
      • HTML
      • Cascading Style Sheets (CSS)
      • Javascript
    5. Standard Generalized Markup Language (SGML)
      • ISO Standard 8879:1986
      • Define structured document types
      • Markup languages for structured documents
      • Main components -
        • Elements delimited by tags
        • Attributes
        • Character data
        • Entities
    6. Hypertext Markup Language (HTML)
      • An application of SGML
      • Hyperlinks / hypertext
      • Designed for structural markup of documents
      • Evolution:
        • 4 major versions
        • Non-standard extensions (Netscape, MS)
        • Superseded by XHTML
    7. Cascading Style Sheets (CSS)
      • body { font-family: serif ;
      • text-align: justify ;
      • margin: 0pt ;
      • background-color: white ;
      • color: black }
      • h1, h2, h3 { font-family: sans-serif ;
      • font-weight: bold ;
      • text-align: left ; }
      • .reverse { background-color: black ;
      • color: white }
      • Non SGML syntax
      • Properties cascade to descendants
      • Styles can be defined:
        • In external files
        • In document header
        • Inline
    8. Javascript
      • Interface to browser functions
      • &quot;Document object&quot;
      • Event-driven interaction with
        • Forms
        • Images
        • Formatting
      • Security: limited IO
      • Object-oriented
      • ECMA 262 / ISO 16262
      • <html>
      • <head>
      • <script language=“ Javascript ”>
      • function helloWorld() {
      • var message = “Hello World”;
      • document.form[0].elements[0].value
      • = message;
      • }
      • </script>
      • </head>
      • <body>
      • <form>
      • <input type=“ text ”>
      • <input type=“ button ”
      • onClick=“ helloWorld ();”>
      • </form>
      • </body>
      • </html>
      • <mylink style =&quot; color: blue; text-decoration: underline &quot; onClick=&quot; location='http://ndad.ulcc.ac.uk/'; &quot;> NDAD </mylink>
    9. XML in a little more detail
      • <?xml version=&quot; 1.0 &quot;
      • encoding=&quot; ISO-8859-1 &quot; ?>
      • <!DOCTYPE ead SYSTEM &quot; ead.dtd &quot;>
      • <ead audience=&quot; internal &quot;>
      • <eadheader langencoding=&quot; ISO 639-3 &quot;>
      • <titleproper> Lord Chancellor's Department:
      • Judge Advocate General's Office Case Index System </titleproper>
      • <date> 2002-08-06 10:52:20 </date>
      • </eadheader>
      • <archdesc level=&quot; series &quot; >
      • <scopecontent id=&quot; AIM-PURPOSE &quot;>
      • <head> Aim and purpose </head>
      • <p> A court martial is a court convened to try armed forces personnel who have committed military or criminal offences. </p>
      • </scopecontent>
      • </archdesc>
      • </ead>
      • Character encoding
      • DTD
      • Namespaces
    10. Character encoding
      • ASCII: ISO 646
        • 7 bit
      • ISO 8859
        • 8 bit
        • Top half interchangeable
      • Unicode: ISO 10646
        • Code for every symbol of every language
        • Variable 8 - 32 bit encoding (UTF-8)
        • ASCII transparent in 8 bit encoding
    11. Document Type Definition (DTD)
      • SGML compatible
      • Non XML syntax *
      • Defines document structure
        • Elements
        • Attributes
        • Entities
      • * pointy brackets notwithstanding
      • <!ELEMENT table (title, datafile, field+) >
      • <!ELEMENT title ( #PCDATA ) >
      • <!ELEMENT datafile (bytes, numrecs, maxrecsize) >
      • <!ELEMENT field (name, description, ddtext?, note?, choices?) >
      • <!ATTLIST table reference CDATA #REQUIRED >
      • <!ATTLIST datafile type CDATA #REQUIRED
      • location CDATA #REQUIRED>
      • <!ATTLIST field type CDATA #REQUIRED>
      • <!ENTITY NDAD &quot;http://ndad.ulcc.ac.uk/&quot; >
    12. Namespaces
      • Mix and match XML applications
      • Avoid conflicting elements
      • Limited DTD compatibility
      <?xml version=&quot; 1.0 &quot; encoding=&quot; ISO-8859_1 &quot; ?> <table reference = &quot; CRDA/8/DS/1/1/1 &quot;>   <title> Court Details </title>   <datafile type=&quot; CSV &quot; location =&quot;/data/ready/8/court.txt &quot;> <bytes> 20583 </bytes>     <numrecs> 388 </numrecs>     <maxrecsize> 65 </maxrecsize>   </datafile> <description xmlns:html =&quot; http://www.w3.org/1999/xhtml &quot;> < html:p > For further details see the < html:a href=&quot; /datasets/8/series.htm &quot;> Series Catalogue < /html:a > . < /html:p > </description> </table>
    13. Where is XML used?
      • Web
      • Desktop applications
      • New markup applications
      • Standards for data exchange
      • Configuration files
    14. Web
      • Server side
        • on-the-fly transformation to HTML / XHTML using XSLT
      • Client side
        • rendered native using CSS
        • transformed to HTML / XHTML using XSLT
      • Metadata
    15. Desktop applications
      • OpenOffice/StarOffice
      • Mozilla/Netscape 6+
      • MS Office 2000
    16. Other applications
      • Encoded Archival Description (EAD)
      • Text Encoding Initiative (TEI)
      • Scalable Vector Graphics (SVG)
      • XHTML
      • Custom applications
    17. Creating XML
      • By hand
      • XML editors
      • Programming
      • Using XML ...
    18. XML editors
      • Non-validating
        • XML Notepad
      • Validating
        • Xmetal
        • XML Spy
        • XML Writer
    19. Programming
      • A simple Perl example:
      • #!/usr/bin/perl
      • use XML::LibXML;
      • $parser = new XML::LibXML;
      • $doc = $parser ->parse_file(&quot; myfile.xml &quot;);
      • $root = $doc ->getDocumentElement;
      • @fields = $root ->getElementsByTagName(&quot; field &quot;);
      • foreach ( @fields ) { # do something # }
    20. Manipulating XML
      • Document Object Model (DOM)
      • XPath
      • XML Stylesheets (XSL)
      • More XML applications
    21. Document Object Model (DOM)
      • W3C recommendation
      • Application independent
      • Language/OS neutral
      • Hierarchical
        • Parent
        • Children
        • Siblings
      • Node types
          • Document
          • Element
          • Attribute
          • Text
          • Comment
          • Entity
          • + 6 more
    22. XPath
      • W3C recommendation
      • XML document as a tree of Nodes
      • Non XML syntax
      • Location paths
        • Relative: ../../tr
        • Absolute: /html/body/h1
        • Attributes: img@src
        • Axes: parent, child, sibling, etc
      • Functions
        • String: contains(), substring()
        • Array/node: last(), count(), position()
    23. XML Stylesheets (XSL)
      • W3C Recommendation
      • XML syntax
      • Transformations (XSLT)
      • Formatting objects (XSL-FO)
      • XSLT processor e.g. Sablotron (sabcmd)
    24. More XML applications
      • XHTML (strict, transitional)
      • XML-Schema
      • RELAX-NG
      • XLink
      • XPointer
      • XML Query
      • Open standard
      • Flexible
      • Transformable
      • Not going to be around forever
      • Simple
      • Complex
      • Machine-readable
      • Human-readable
    25. </everything>

    + Richard DavisRichard Davis, 2 years ago

    custom

    667 views, 1 favs, 0 embeds more stats

    Short internal XML course (2003). Interesting to no more

    More info about this document

    CC Attribution License

    Go to text version

    • Total Views 667
      • 667 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags

    Groups / Events