XML, AJAX, Web Services




CS174

Chris Pollett

Nov 14, 2022

Outline

Introduction to XML

The Syntax of XML

XML Document Structure and Entities

Document Type Definitions

<!ELEMENT ..>

<!ATTLIST ..>

<!ENTITY ..>

Example DTD

<?xml version = "1.0" encoding ="utf-8" ?>
<!-- planes_for_sale.dtd  -->
<!ELEMENT planes_for_sale (ad+) >
<!ELEMENT ad (year, make, model, color, price?, seller) >
<!ELEMENT year (#PCDATA)>
<!ELEMENT make (#PCDATA)>
<!ELEMENT model (#PCDATA)>
<!ELEMENT color (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT seller (#PCDATA)>
<!ATTLIST seller license CDATA #REQUIRED >
<!ENTITY c "cessna" >

Internal versus External DTDs

Namespaces

XML and CSS

Quiz

Which of the following statements is true?

  1. setTimeout is used to set up a repeating timer in Javascript.
  2. The regex pattern /\s/ matches any single non-whitespace character.
  3. private visibility can be faked in Javascript using the module pattern.

Beginning AJAX

Step-by-Step I

Step-by-Step II

Step-by-Step Continued III

Step-by-Step Continued IV

Parsing What Comes Back

Fetch API

Web Services

REST

JSON

XML versus JSON versus POSH

GraphQL Web Services