| OLD | NEW |
| (Empty) | |
| 1 <!-- |
| 2 |
| 3 Welcome to a document type declaration (DTD). |
| 4 This is a document that makes sure XML files are correctly formed. |
| 5 |
| 6 Below, |request| is implied to be the root element of the XML document, whose |
| 7 children are |os| and |app|. |
| 8 --> |
| 9 <!ELEMENT request (os, app)> |
| 10 <!-- |
| 11 |
| 12 Below, this indicates that |protocol| is a required attribute of the |
| 13 |request| element; by indicating `NMTOKEN`, we indicate that this attribute |
| 14 must have a value associated with it that does not contain whitespace. `CDATA` |
| 15 would be the more commonly used keyword for content with whitespace. |
| 16 --> |
| 17 <!ATTLIST request protocol NMTOKEN #REQUIRED> |
| 18 <!-- |
| 19 |
| 20 The |os| element should not have any children and cannot have any content |
| 21 within the tag. (<os/> and <os></os> are allowed, but <os>stuff here!</os> is |
| 22 not a valid element.) |
| 23 --> |
| 24 <!ELEMENT os EMPTY> |
| 25 <!-- |
| 26 |
| 27 This |platform| attribute is a required attribute of |os|, and its value must |
| 28 be "mac". |
| 29 --> |
| 30 <!ATTLIST os platform (mac) #REQUIRED> |
| 31 <!-- |
| 32 |
| 33 The |version|, |arch|, and |sp| attributes are optional attributes of |os|. If |
| 34 a request's XML body has the |sp|, it may not need the version or arch; if the |
| 35 |sp| is not included but |version| and |arch| are specified, the XML body is |
| 36 still valid. Unfortunately there is relatively less logic available for |
| 37 attributes, so I currently cannot reject the XML document if there is only |
| 38 either |arch| or |version|. |
| 39 --> |
| 40 <!ATTLIST os version NMTOKEN #IMPLIED> |
| 41 <!ATTLIST os arch NMTOKEN #IMPLIED> |
| 42 <!ATTLIST os sp NMTOKEN #IMPLIED> |
| 43 <!-- |
| 44 |
| 45 |app| has only one child, |updatecheck|. |
| 46 --> |
| 47 <!ELEMENT app (updatecheck)> |
| 48 <!-- |
| 49 |
| 50 The |appid| attribute of the |app| element must have "com.google.Chrome" as |
| 51 its value. |
| 52 --> |
| 53 <!ATTLIST app appid (com.google.Chrome) #REQUIRED> |
| 54 <!-- |
| 55 |
| 56 The following two attributes are required; their values must not contain |
| 57 whitespace. |
| 58 --> |
| 59 <!ATTLIST app version NMTOKEN #REQUIRED> |
| 60 <!ATTLIST app lang NMTOKEN #REQUIRED> |
| 61 <!-- |
| 62 |
| 63 |updatecheck| must be an empty element. |
| 64 --> |
| 65 <!ELEMENT updatecheck EMPTY> |
| OLD | NEW |