XML and SVG from PQL - PowerPoint PPT Presentation

About This Presentation
Title:

XML and SVG from PQL

Description:

This presentation only covers a very small but usable subset of what ... Further details available from Professional XML 2nd Edition (Wrox) 1267 pages. Outline ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 21
Provided by: dcd
Category:
Tags: pql | svg | xml | wrox

less

Transcript and Presenter's Notes

Title: XML and SVG from PQL


1
XML and SVG from PQL
  • By Dave Doulton
  • Computing Services
  • University of Southampton

2
XML and SVG
  • This presentation only covers a very small but
    usable subset of what can be done with XML and
    SVG.
  • Further details available from Professional XML
    2nd Edition (Wrox) 1267 pages.

3
Outline
  • What is XML?
  • What use is it?
  • How do I generate it?
  • What is SVG?
  • How do I generate it?

4
What is XML
  • XML is eXtensible Markup Language
  • It is a way of marking up data to impose some
    structure.
  • It is hierarchical in nature and uses tags
    similar to HTML

5
What is XML
  • Basically data is divided up in a tree structure
    with tags defining the levels in the tree.
  • There must be one root to the tree.
  • An example of an outline tree for the company
    database would be

6
Example XML
  • ltCOMPANYgt
  • ltCASEgt
  • ltEMPLOYEEgt
  • lt/EMPLOYEEgt
  • ltOCCUPgt
  • lt/OCCUPgt
  • ltREVIEWgt
  • ltREVIEWgt
  • lt/CASEgt
  • lt/COMPANYgt

7
Where does the data go?
  • Each of the sub levels can have attributes or
    further sublevels.
  • Each sublevel must be uniquely named or have a
    unique set of attributes.
  • So for the case level there must be an attribute
    as there is more than 1 case.

8
Example data
  • ltcase id1gt
  • ltemployeegt
  • ltnamegt
  • John D Jones
  • lt/namegt
  • ltgendergt
  • 1
  • lt/gendergt
  • . Etc
  • lt/employeegt

9
An alternative
  • ltcase id1gt
  • ltemployee nameJohn D Jones gender1
    gt
  • lt/employeegt

10
An alternative
  • ltcase id1gt
  • ltemployee nameJohn D Jones gender1
    / gt
  • if there is no data between tags, the opening
    tag can be closed with a /gt instead

11
What use is it?
  • It is an advancement on other data interchange
    methods as there are no problems associated with
    parsing it. With comma delimited there are
    problems with commas and quotes in the data and
    also with missing columns.

12
What use is it?
  • Due to the syntax the only problems can be with lt
    gt and
  • These are replaced in data with gt lt amp
    apos and quot
  • All data is treated as text.

13
What use is it?
  • Given the scope of the syntax there are more and
    more tools becoming available to use XML. So it
    becomes a natural means for exporting and
    importing data between programs. As we shall see
    even between SIR and the web browser and plugins
    in the web browser.

14
What use is it?
  • To use it effectively there needs to be something
    to read it and manipulate it.
  • One such application is XSL (eXtensible Style
    Language)
  • Another is SVG (Scalable Vector Graphics)

15
What use is it?
  • See
  • http//www.soton.ac.uk/sug/conf2002/xsldemo.htm
    l
  • Some of the content is an example from Microsoft
    of varying the style for the same content.

16
How do I generate it?
  • To generate XML you basically just write text to
    a file.
  • However there is the need for some extra XML to
    state that the content is XML.
  • In PQL there is the added problem of XML looking
    like global variables.

17
How do I generate it?
  • A simple way to generate it in PQL is to write
    the start and end of the tag separately
  • Write ltemployee gt
  • Or
  • write ltemployeegt

18
What is SVG ?
  • SVG is Scalable Vector Graphics.
  • It is an xml document that contains data that is
    a set of drawing instructions. When viewed with
    an svgviewer plugin it produces scalable
    drawings.
  • These can be text, graphs or diagrams.

19
What is SVG?
  • It can also be used with CSS or cascading style
    sheets to control aspects of the display.
  • See http//www.soton.ac.uk/sug/conf2002/svgdemo.h
    tml
  • Get the SVG plugin from http//www.adobe.com/svg/v
    iewer/install/main.html

20
Conclusion
  • XML and SVG are relatively easy to use.
  • They allow useful data display and/or transfer
    capabilities.
  • Well worth investigating.
Write a Comment
User Comments (0)
About PowerShow.com