and XML A primer for Web design students - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

and XML A primer for Web design students

Description:

Why PHP and XML? ... PHP Functions. Similar to JavaScript functions, but more powerful. ... PHP Example. English Department reservation system ... – PowerPoint PPT presentation

Number of Views:118
Avg rating:3.0/5.0
Slides: 23
Provided by: leehon
Category:
Tags: xml | design | php | primer | students | web

less

Transcript and Presenter's Notes

Title: and XML A primer for Web design students


1
and XML A primer for Web design
students
  • Lee Honeycutt
  • English 313

2
Today, well cover
  • PHP and MySQL for dynamic web pages
  • XML Overview
  • XML terms and processes
  • XML transformations
  • XML software
  • Impact of XML

3
1. What is PHP?
  • Originally Personal Home Page, a variant of
    Perl scripting language.
  • Open-source language for server-side scripting
    applications.
  • Works with variety of relational databases to
    create dynamic web sites on just about any server
    platform.

4
Static Web Pages
5
Dynamic Web Pages
index.php
Template
XHTML
6
Basic PHP Template
  • lthtmlgt
  • ltbodygt
  • lt?php echo "Hello World" ?gt
  • lt/bodygt
  • lt/htmlgt

7
PHP Variables
  • lt?php
  • txt"Hello World"
  • echo txt
  • ?gt

8
PHP Conditionals
  • lt?php
  • ddate("D")
  • if (d"Fri")
  • echo "Have a nice weekend!"
  • else
  • echo "Have a nice day!"
  • ?gt

9
PHP Functions
  • Similar to JavaScript functions, but more
    powerful. More than 700 unique functions.
  • phpinfo( ) function - used for outputting
    information
  • phpforms ( ) function - inputting information to
    database

10
PHP Form Function
  • ltform action"welcome.php method"POST"gt
  • Enter your name ltinput type"text" name"name"
    /gt
  • Enter your age ltinput type"text" name"age" /gt
  • ltinput type"submit" /gt
  • lt/formgt

11
PHP Example
  • English Department reservation system
  • Built from open-source program called MRBS
    (Meeting Room Booking System)
  • http//reserve.engl.iastate.edu/

12
2. XML overview
  • XML is a metalanguage, i.e. a language that
    defines the rules and symbols of another
    language.
  • XML is not used on the web, but instead used to
    define other markup languages, such as XHTML, the
    replacement of HTML.
  • Allows us to define markup languages customized
    to our individual needs instead of relying on
    pre-existing tags.

13
Think of XML as.
  • An indented outline of a very large document.
  • A database table expressed via element tags
    within one big flattened text file.
  • A family of technologies that work in tandem to
    express information in a variety of ways.
  • The Rosetta Stone of the information age,
    allowing you to move information from one context
    to another through a standardized structure.

14
XML Example
  • ltaddress typehomegt
  • ltnamegt
  • ltfirstgtLeelt/firstgt
  • ltlastgtHoneycuttlt/lastgt
  • lt/namegt
  • ltstreetgt404 South Pine Streetlt/streetgt
  • ltcitygtEllensburglt/citygt
  • ltstategtWAlt/stategtltzip length5gt98926lt/zipgt
  • lt/addressgt

15
Uses of XML
  • Provides a simpler method of structuring large
    data sets compared to earlier tagging systems
    like SGML.
  • Publishes information to various media formats
    from a single source.
  • Serves as a platform-independent lingua franca
    for sharing hierarchically structured information
    between various programs.
  • Embeds links in RSS feeds for news and weblogs.

16
3. Key XML Terms Processes
  • Elements - similar to HTML lttagsgt, but defined by
    the user instead. They describe, in human
    language, the data they surround.
  • Attributes - name and value pairs used to
    distinguish unique instances of an element.
  • Entities - shorthand placeholders for information
    used often within a document
  • DTDs Schemas - declared dictionaries of
    elements that model a documents content.

17
XML Example
  • ltaddress typehomegt
  • ltnamegt
  • ltfirstgtLeelt/firstgt
  • ltlastgtHoneycuttlt/lastgt
  • lt/namegt
  • ltstreetgt404 South Pine Streetlt/streetgt
  • ltcitygtEllensburglt/citygt
  • ltstategtWAlt/stategtltzip length5gt98926lt/zipgt
  • lt/addressgt

18
Purpose of DTDs Schemas
  • Define the set of allowed tags and attributes in
    the document.
  • Describe a documents content model using rules
    by which tags and data are ordered.
  • Provide easy model management through references
    to shortcuts and external files.

19
4. Transforming XML
  • XSL (Extensible Stylesheet Language) - special
    type of XML document that transforms XML data
    into styled format. Similar to HTMLs Cascading
    Stylesheets.
  • XSLT (Transformations) - usually used for
    transformation to XHTML.
  • XSL-FO (Formatting Objects) - used for page
    formats such as PDF and MS Word.

20
XML Transformations
21
5. XML Software
  • Some applications are moving to XML as their
    foundation. EX OpenOffice.
  • Most database programs have an XML export
    feature.
  • XML editors and companion components
  • Cross Platform - Editix, oXygen, Exchanger
  • Windows - XML Spy, XMetal, and Stylus

22
6. Impact of XML
  • Provides greater flexibility in organizing
    information, but also introduces greater
    complexity.
  • Requires greater upfront planning and design of
    information sets and their rhetorical use.
  • Separates content from style, which has huge
    rhetorical implications, just as does the use of
    CSS.
Write a Comment
User Comments (0)
About PowerShow.com