XML and beyond - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

XML and beyond

Description:

character set. Validity of XML 2. The benefit of a known structure ... shows the document creator's intent that elements whose names are of form ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 10
Provided by: AriJ3
Category:

less

Transcript and Presenter's Notes

Title: XML and beyond


1
XML and beyond
  • XML
  • Parsing XML
  • Schemas
  • GML

2
XML
  • structured document
  • markup (metadata)
  • content (data)
  • programmers point of view
  • nodes
  • node has a name and type
  • node may have attributes
  • node may have a parent, siblings (previous and
    next) and children
  • node may have a value

3
Parsing XML
  • Two main methods
  • parsing into a DOM (Document Object Model,
    w3.org/DOM)
  • which is a tree of nodes
  • event-based parsing (SAX, Simple API for XML,
    sax.sourceforge.net)
  • which reports events to the application through
    callback functions

4
Validity of XML 1
  • Validating input is often a pain
  • is this a number?
  • what about security?
  • what is univeristy?
  • well-formed XML
  • markup is ok
  • characters, tag names, attributes, elements
    close, etc
  • contents is ok
  • character set

5
Validity of XML 2
  • The benefit of a known structure
  • application knows what to look for
  • DTD, XML Schema, RELAX NG, SOX, Schematron
  • structure, context, data types, ...
  • application (its programmer) knows what to look
    for and what to expect

6
Shared ontologies
copy is sent
XML
XML
creates
interprets
XSD
receiver
uses
sender
uses
7
Namespaces 1
  • attribute xmlnssome_prefixsome_URI in the
    document element
  • shows the document creators intent that elements
    whose names are of form some_prefixSome_name are
    created according to certain rules
  • what the rules are, are assumed to be clear from
    the URI
  • further hints may be given with an attribute
    xsischemaLocationsome_URI name_of_the_schema
    (for example)
  • BTW Compare to namespaces in Perl

8
Namespaces 2
  • if everything works out ok,
  • the creator can use a validating parser to make
    sure she is sending a valid document and
  • the receiver can check the received document is
    ok for further processing
  • Remember the schema is in any case hard-coded
    into the applications using the schema

9
GML
  • A namespace with and associated XML schema
    document
  • the schema is written in XML Schema
  • a draft ISO standard
  • an OpenGIS Recommendation Paper
  • now in version 3.1
  • Note the usual xmlnsgmlhttp//www.opengis.net/
    gml does not tell which version is used
  • May be used
  • as one namespace in an XML document
  • as a basis for higher level schemas
Write a Comment
User Comments (0)
About PowerShow.com