Anatomy xml

Embed Size (px)

Citation preview

  • 8/11/2019 Anatomy xml

    1/33

    Introduction to XMLJohn Arnett, MScStandards Modeller

    Information and Statistics DivisionNHSScotlandTel: 0131 551 8073 (x2073)mailto:[email protected]://isdscotland.org/xml

  • 8/11/2019 Anatomy xml

    2/33

    Contents

    What is XML?

    Anatomy of an XML Document

    Conformance and Validation Summary

    Find Out More

  • 8/11/2019 Anatomy xml

    3/33

    What is XML?

    a programming language

    a software panacea an object-oriented technology

    HTML with funny tags

    a replacement for HTML but it isre-shaping publishing on the web

    XML is not

  • 8/11/2019 Anatomy xml

    4/33

    What is XML?

    Meta-markup language derived

    from SGML (Standard GeneralisedMarkup Language)

    Open Standard, currently XML 1.02ndedition (W3C Recommendation

    6 October 2000)

    Stands for Extensible Markup Language

  • 8/11/2019 Anatomy xml

    5/33

    What is XML?

    XML is the universal format for

    structured documents and data onthe Web

    A data object is an XML documentif it is well-formed, as defined in [the

    W3C]specification(more on this later)

    W3C says

  • 8/11/2019 Anatomy xml

    6/33

    What is XML?

    Data Content and Presentation

    Sample dataset

    1

    0

    1

    0

    SEX

    15061976SarahJackson147678

    12111979LesleyMartin111672

    23081983AlisonMcKenzie198457

    06011971IanJones134376

    DOBFORENAMESURNAMEID

    Flat file, database, spreadsheet, etc

  • 8/11/2019 Anatomy xml

    7/33

    Recorddata oriented structure

    111672 Martin Lesley 0 12111979

    What is XML?

    Structured

    Searchable Easy to understand

    Portable

  • 8/11/2019 Anatomy xml

    8/33

    What is XML?

    HTMLdocument oriented structureRecord Id:11672

    Surname:MartinGiven Name:Lesley

    Sex:Male

    Date of Birth:12 November 1979

    Record Id: 11672Surname: MartinGiven Name: Lesley

    Sex: Male

    Date of Birth:12 November 1979

    Easy to understand Portable

    Structured

    Searchable

  • 8/11/2019 Anatomy xml

    9/33

    What is XML?

    XML to the rescue!

  • 8/11/2019 Anatomy xml

    10/33

    What is XML?

    Text based

    Open standards Widely used

    HTML and XML are

  • 8/11/2019 Anatomy xml

    11/33

    What is XML?

    Structured

    Separates data from presentation Self-describing

    Searchable

    Extensible i.e. any number of tags allowed

    But XML also

  • 8/11/2019 Anatomy xml

    12/33

    Anatomy of an XML Document

    character data

    tab, carriage return and line feed Unicode characters

    markup

    XML documents consist of text

  • 8/11/2019 Anatomy xml

    13/33

    Anatomy of an XML Document

    Markup

    Hello, World Wide Web!

    start-, end- and empty element tags

    tag names are case sensitive!

    entity and character references

    comments

  • 8/11/2019 Anatomy xml

    14/33

    Anatomy of an XML Document

    Character data

    Hello, World Wide Web!

    Reserved characters

    &, ,and

  • 8/11/2019 Anatomy xml

    15/33

  • 8/11/2019 Anatomy xml

    16/33

    Anatomy of an XML Document

    Root Element

    Hello, World Wide Web!

    Uniquely named element

    Contains all the data and links toother documents

  • 8/11/2019 Anatomy xml

    17/33

    Anatomy of an XML Document

    Elements

    XML Bible24.99

  • 8/11/2019 Anatomy xml

    18/33

    Anatomy of an XML Document

    Attributes

  • 8/11/2019 Anatomy xml

    19/33

    Anatomy of an XML Document

    Built-in entities& = &

    = "< = = >

    = '

    Handling reserved characters

    CDATASectionsgetX() < 5 && values[0] =>10) cerr

  • 8/11/2019 Anatomy xml

    20/33

    Anatomy of an XML Document

    Namespaces

    Preventing naming collisions

  • 8/11/2019 Anatomy xml

    21/33

    Conformance and Validation

    One root element

    Start and end tags matchcontent

    Empty elements are terminated as

    Tags are correctly nested All attributes enclosed in quotes

    All XML processors must check well-formedness constraints

  • 8/11/2019 Anatomy xml

    22/33

    Conformance and Validation

    specified in Document TypeDefinitions(DTDs) or Schemas

    a valid XML document must bewell-formed

    a well-formed document need notnecessarily be valid

    Validating XML processors checkagainst validityconstraints

  • 8/11/2019 Anatomy xml

    23/33

    Document Type Definitions

    DTD syntax able to specify

    Element attributes

    limited number of data types

    default and fixed attribute values

    Structure and order of child elements

  • 8/11/2019 Anatomy xml

    24/33

    Document Type Definitions

    Easy to understand and implement

    Lightweight alternative to schemas But

    use non-XML syntax

    only limited support for datatyping and namespaces

    difficult to extend

    DTDs

  • 8/11/2019 Anatomy xml

    25/33

    Schemas

    Uses XML syntax

    Provides built-in and supports user-defined data types

    Supports namespaces

    Provides several extensibilty

    mechanisms

    W3C Schema

  • 8/11/2019 Anatomy xml

    26/33

  • 8/11/2019 Anatomy xml

    27/33

    In Summary

    A language for describing markuplanguages

    Extensible, ie. define own tags Readable, structured and self

    describing

    Documents must be well-formed

    Documents may be validated usingDTDs and/or Schemas

  • 8/11/2019 Anatomy xml

    28/33

    Find Out More

    World Wide Web Consortium

    www.w3.org

    W3C XML v1.0 Specification http://www.w3.org/TR/REC-xml

    http://www.w3.org/http://www.w3.org/TR/REC-xmlhttp://www.w3.org/TR/REC-xmlhttp://www.w3.org/TR/REC-xmlhttp://www.w3.org/TR/REC-xmlhttp://www.w3.org/
  • 8/11/2019 Anatomy xml

    29/33

    Find Out More

    The XML Industry Portal

    www.xml.org

    OReilly XML site www.xml.com

    XML Cover Pages

    www.oasis-open.org/cover/ Caf Con Leche

    www.ibiblio.org/xml/

    http://www.xml.org/http://www.xml.com/http://www.oasis-open.org/cover/http://www.ibiblio.org/xml/http://www.ibiblio.org/xml/http://www.oasis-open.org/cover/http://www.oasis-open.org/cover/http://www.oasis-open.org/cover/http://www.xml.com/http://www.xml.org/
  • 8/11/2019 Anatomy xml

    30/33

    Find Out More

    Scottish Health and Community CareXML Steering Group

    www.isdscotland.org/xml

    http://www.isdscotland.org/xmlhttp://www.isdscotland.org/xml
  • 8/11/2019 Anatomy xml

    31/33

    XML Tools

    XSV- Open Source XML SchemaValidator

    www.ltg.ed.ac.uk/~ht/xsv-status.html MSXML 4.0

    www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-

    46da-b4b6-c5d7485f2b42

    http://www.ltg.ed.ac.uk/~ht/xsv-status.htmlhttp://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42http://www.ltg.ed.ac.uk/~ht/xsv-status.htmlhttp://www.ltg.ed.ac.uk/~ht/xsv-status.htmlhttp://www.ltg.ed.ac.uk/~ht/xsv-status.html
  • 8/11/2019 Anatomy xml

    32/33

    XML Tools

    XML Spy 2004IDE

    www.altova.com/products_ide.html

    Free XML Tools and Software www.garshol.priv.no/download/xmlt

    ools/

    http://www.altova.com/products_ide.htmlhttp://www.garshol.priv.no/download/xmltools/http://www.garshol.priv.no/download/xmltools/http://www.garshol.priv.no/download/xmltools/http://www.garshol.priv.no/download/xmltools/http://www.altova.com/products_ide.html
  • 8/11/2019 Anatomy xml

    33/33

    Printed Sources

    Numerous printed sourcesfor moreinformation visit

    Charles F. Goldfarb's

    www.xmlbooks.com

    www.amazon.com

    http://www.xmlbooks.com/http://www.amazon.com/http://www.amazon.com/http://www.xmlbooks.com/