Correction: DTD Examples (I)
Correction: DTD Examples (I)
More on XML
<!ELEMENT name (#PCDATA)>
<name>John</name>
(The slides that were skipped in the last lecture)
1 2
1
Element vs. Attribute Elements vs. Attributes
Element Elements Attributes
Data can be considered independent objects Can have child Elements Can contain only strings, or
Data is related via a parent/child relationship nested within them lists of strings
Item needs to occur multiple times Structured and simple data Used for atomic data items
Ordering required May have to appear in order Can only appear once in an
Attribute as specified, but may be element
Information that describes the element more than once
Such as status or id Natural, core content, which Secondary data, often
Valuesare limited would generally appear in metadata
A property of element every printout/display
(Sub-)Elements represent Properties of an Element
http://xml.coverpages.org/draft-stuhec-elemvsattrib-03-20020316.pdf parts of an Element
7 8
Application
XML and DOM
XML
Processor
Parsing XML
XML
File
9 10
2
The Four Steps
1. Develop a data model
What information are you going to store and how will you represent it?
2. Develop a collection of legal transactions on that model
E.g., inserts and updates
3. Design the page flow
Building Internet Applications How will the user interact with the system?
What steps will lead up to one of those legal transactions?
An Internet service lives or dies by Steps 1 through 3
What can the service do for the user?
Is the page flow comprehensible and usable?
http://philip.greenspun.com/seia/basics The answers to these questions are determined at Steps 1 through 3
4. Implement the individual pages
You'll be writing scripts that query information from the data model, wrap that
information in XHTML, and return the combined result to the user
This step is intellectually uninteresting and also uninteresting from an
engineering point of view
However, this is where you have a huge range of technology choices
13 14