CSE134A LECTURE NOTES

May 30, 2001
 
 

ANNOUNCEMENTS

CAPE and TA evaluations are today.

One major design flaw in many of the second project submissions is lack of code portability.  Software portability is important for many reasons:

For 134A portability is necessary because the turnin utility copies all your files to a different location.
 

DESIGN ISSUES FOR USER INTERFACES

Getting the UI right is difficult.  Bad visual interfaces are still usable, but bad voice interfaces are not.  There are few established principles, but here are some guidelines.

(0) Provide 80% of the functionality with 20% of the complexity in the interface.

(1) Make the service sensitive to the context of the user.  For example, let the user say "today" when a date is needed.

(2) Keep prompts short, but specific.  For example, "say or type your four-digit PIN" not "enter your pertsonal identification number."

(3) Get confirmation from the user, but unobtrusively.  Make backing up easy.

A fundamental issue: user initiative versus system initiative versus mixed initiative.
 
 

XML

XML is a human-readable notation for writing and exchanging structured information of all sorts.  XML stands for "eXtensible meta-Markup Language."  It is a markup language for structure and (very slightly) for semantics. XML is not a presentation language, not a programming langiage, not a database system, not a network protocol.

XML is portable data.  It can be used to define a high-level protocol, and be sent using a low-level network protocol.
 
 

XML SYNTAX

A document is "well-formed" if it satisfies all the XML syntax rules.  No subsets or supersets of XML are allowed.

An XML document is a tree with exactly one root element, and no overlapping elements.  XML is case-sensitive, and in fact can use non-Western characters.

Start tags are written <elementname ...> and end tags are written </elementname>. Start tags can have attributes, which have the syntax name="value".  There is no XML-defined syntax inside attribute values, so nested elements are preferable.  Also, attributes must be unique for each tag instance.

Tags are nested, and can appear inside free text.  <name/> is an empty tag, unlike in HTML.

In free text, special characters must be written as &lt; and &amp;  Any XML parser translates these before passing the text to any application using the parser.

<?xml version="1.0" encoding="ISO_8859-1" standalone="no"?>            optional processing instruction
<!DOCTYPE person SYSTEM "http://www.ucsd.edu/person.dtd">
        <person born="1912" died="1954" id="p342">
           <name>
             <first_name>Alan</first_name>
             <last_name>Turing</last_name>
           </name>
           <!-- Did the word computer scientist exist in Turing's day? -->
           <profession>computer scientist</profession>
           <profession>mathematician</profession>
           <profession>cryptographer</profession>
        </person>
A section written <![CDATA[ text ]]> doesn't need escaped characters.

A tag beginning <? and ending ?> is a processing instruction.  These are considered to be markup, but not elements, so they can appear outside the root element.  Script code, e.g. PHP code, is a special case.
 
 



Copyright (c) by Charles Elkan, 2001.