| 1 |
<!-- This document is a loose version of a way to describe parts of a PDF --> |
| 2 |
<mso xmlns="http://www.example.org/mso" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 3 |
xsi:schemaLocation="http://www.example.org/mso mso.xsd"> |
| 4 |
<struct name="PDF"> |
| 5 |
<type name="header" type="Header" /> |
| 6 |
<type name="body" type="Body" /> |
| 7 |
<type name="crossReferenceTable" type="CrossReferenceTable" /> |
| 8 |
<type name="trailer" type="Trailer" /> |
| 9 |
</struct> |
| 10 |
<struct name="Whitespace"> |
| 11 |
<uint8 name="ws"> |
| 12 |
<limitation value="0x00|0x09|0x0A|0x0C|0x0D|0x20" /> |
| 13 |
</uint8> |
| 14 |
</struct> |
| 15 |
<struct name="Delimiter"> |
| 16 |
<uint8 name="delimiter"> |
| 17 |
<limitation value="'('|')'|'['|']'|'{'|'}'|'/'|'%'" /> |
| 18 |
</uint8> |
| 19 |
</struct> |
| 20 |
<struct name="Digit"> |
| 21 |
<uint8 name="digit"> |
| 22 |
<limitation value="'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'" /> |
| 23 |
</uint8> |
| 24 |
</struct> |
| 25 |
<struct name="Eol"> |
| 26 |
<hex>0D0A</hex> |
| 27 |
</struct> |
| 28 |
<struct name="Header"> |
| 29 |
<text>%PDF-1.3</text> |
| 30 |
<type name="ws" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 31 |
</struct> |
| 32 |
<struct name="Body"> |
| 33 |
<type name="objects" type="Object" minOccurs="0" maxOccurs="unbounded" /> |
| 34 |
</struct> |
| 35 |
<struct name="CrossReferenceLine"> |
| 36 |
<type name="offset" count="10" type="Digit" /> |
| 37 |
<hex>20</hex> |
| 38 |
<type name="generation" count="5" type="Digit" /> |
| 39 |
<hex>20</hex> |
| 40 |
<uint8 name="state"> |
| 41 |
<limitation value="'n'|'f'" /> |
| 42 |
</uint8> |
| 43 |
<hex>0D0A</hex> |
| 44 |
</struct> |
| 45 |
<struct name="CrossReferenceSection"> |
| 46 |
<type name="start" array="true" type="Digit" /> |
| 47 |
<hex>20</hex> |
| 48 |
<type name="offset" array="true" type="Digit" /> |
| 49 |
<type name="ws" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 50 |
<type name="entries" type="CrossReferenceLine" minOccurs="1" |
| 51 |
maxOccurs="unbounded" /> |
| 52 |
</struct> |
| 53 |
<struct name="CrossReferenceTable"> |
| 54 |
<text>xref</text> |
| 55 |
<type name="ws" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 56 |
<type name="sections" type="CrossReferenceSection" minOccurs="1" |
| 57 |
maxOccurs="unbounded" /> |
| 58 |
</struct> |
| 59 |
<struct name="Boolean"> |
| 60 |
<fixedchoice name="boolean"> |
| 61 |
<text>true</text> |
| 62 |
<text>false</text> |
| 63 |
</fixedchoice> |
| 64 |
</struct> |
| 65 |
<struct name="Integer"> |
| 66 |
<uint8 name="sign"> |
| 67 |
<limitation value="'+'|'-'" /> |
| 68 |
</uint8> |
| 69 |
<type name="value" minOccurs="1" maxOccurs="unbounded" type="Digit" /> |
| 70 |
</struct> |
| 71 |
<struct name="Real"> |
| 72 |
<uint8 name="sign"> |
| 73 |
<limitation value="'+'|'-'" /> |
| 74 |
</uint8> |
| 75 |
<type name="integer" minOccurs="0" maxOccurs="unbounded" type="Digit" /> |
| 76 |
<text>.</text> |
| 77 |
<type name="fraction" minOccurs="0" maxOccurs="unbounded" type="Digit" /> |
| 78 |
</struct> |
| 79 |
<struct name="Number"> |
| 80 |
<choice name="value"> |
| 81 |
<type type="Integer" /> |
| 82 |
<type type="Real" /> |
| 83 |
</choice> |
| 84 |
</struct> |
| 85 |
<struct name="EscapedCharacter"> |
| 86 |
<text>\</text> |
| 87 |
<uint8 name="character" /> |
| 88 |
</struct> |
| 89 |
<struct name="ParenthesisStringCharacters"> |
| 90 |
<uint8 name="literal" minOccurs="1" maxOccurs="unbounded"> |
| 91 |
<limitation expression="!='\'" /> |
| 92 |
<limitation expression="!=')'" /> |
| 93 |
<limitation expression="!='('" /> |
| 94 |
</uint8> |
| 95 |
</struct> |
| 96 |
<struct name="ParenthesisString"> |
| 97 |
<text>(</text> |
| 98 |
<type name="string" type="ParenthesisStringContent" array="true" /> |
| 99 |
<text>)</text> |
| 100 |
</struct> |
| 101 |
<struct name="ParenthesisStringContent"> |
| 102 |
<choice name="content"> |
| 103 |
<type type="EscapedCharacter" /> |
| 104 |
<type type="ParenthesisStringCharacters" /> |
| 105 |
<type type="ParenthesisString" /> |
| 106 |
</choice> |
| 107 |
</struct> |
| 108 |
<struct name="Hexadecimal"> |
| 109 |
<uint8 name="character"> |
| 110 |
<limitation |
| 111 |
value="'0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'|'a'|'b'|'c'|'d'|'e'|'f'|'A'|'B'|'C'|'D'|'E'|'F'" /> |
| 112 |
</uint8> |
| 113 |
</struct> |
| 114 |
<struct name="HexadecimalStringContent"> |
| 115 |
<type type="Hexadecimal" name="a" /> |
| 116 |
<type name="ws" type="Whitespace" array="true" /> |
| 117 |
<type type="Hexadecimal" name="b" /> |
| 118 |
<type name="ws2" type="Whitespace" array="true" /> |
| 119 |
</struct> |
| 120 |
<struct name="HexadecimalString"> |
| 121 |
<text><</text> |
| 122 |
<type name="string" type="HexadecimalStringContent" array="true" /> |
| 123 |
<text>></text> |
| 124 |
</struct> |
| 125 |
<struct name="String"> |
| 126 |
<choice name="string"> |
| 127 |
<type type="ParenthesisString" /> |
| 128 |
<type type="HexadecimalString" /> |
| 129 |
</choice> |
| 130 |
</struct> |
| 131 |
<struct name="Name"> |
| 132 |
<text>/</text> |
| 133 |
<uint8 name="name" array="true"> |
| 134 |
<limitation expression="!=0x00" /> |
| 135 |
<limitation expression="!=0x09" /> |
| 136 |
<limitation expression="!=0x0A" /> |
| 137 |
<limitation expression="!=0x0C" /> |
| 138 |
<limitation expression="!=0x0D" /> |
| 139 |
<limitation expression="!=0x20" /> |
| 140 |
<limitation expression="!='('" /> |
| 141 |
<limitation expression="!=')'" /> |
| 142 |
<limitation expression="!='['" /> |
| 143 |
<limitation expression="!=']'" /> |
| 144 |
<limitation expression="!='{'" /> |
| 145 |
<limitation expression="!='}'" /> |
| 146 |
<limitation expression="!='/'" /> |
| 147 |
<limitation expression="!='%'" /> |
| 148 |
</uint8> |
| 149 |
</struct> |
| 150 |
<struct name="ArrayEntry"> |
| 151 |
<choice name="entry"> |
| 152 |
<type type="Number" /> |
| 153 |
<type type="String" /> |
| 154 |
<type type="Dictionary" /> |
| 155 |
<type type="Array" /> |
| 156 |
</choice> |
| 157 |
<type name="ws" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 158 |
</struct> |
| 159 |
<struct name="Array"> |
| 160 |
<text>[</text> |
| 161 |
<type name="ws" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 162 |
<type name="entries" type="ArrayEntry" array="true" /> |
| 163 |
<text>]</text> |
| 164 |
</struct> |
| 165 |
<struct name="Object"> |
| 166 |
<choice name="entry"> |
| 167 |
<type type="Number" /> |
| 168 |
<type type="String" /> |
| 169 |
<type type="Dictionary" /> |
| 170 |
<type type="Array" /> |
| 171 |
</choice> |
| 172 |
</struct> |
| 173 |
<struct name="DictionaryEntry"> |
| 174 |
<type name="key" type="Name" /> |
| 175 |
<type name="ws" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 176 |
<type name="value" type="Object" /> |
| 177 |
<type name="ws2" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 178 |
</struct> |
| 179 |
<struct name="Dictionary"> |
| 180 |
<text><<</text> |
| 181 |
<type name="ws" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 182 |
<type name="entries" type="DictionaryEntry" array="true" /> |
| 183 |
<text>>></text> |
| 184 |
</struct> |
| 185 |
<struct name="Stream"> |
| 186 |
<type name="info" type="Dictionary" /> |
| 187 |
<type name="ws" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 188 |
<text>stream</text> |
| 189 |
<fixedchoice name="ws2"> |
| 190 |
<hex>0A</hex> |
| 191 |
<hex>0D0A</hex> |
| 192 |
</fixedchoice> |
| 193 |
<uint8 name="stream" count="info['Length']" /> |
| 194 |
<fixedchoice name="endstream"> |
| 195 |
<hex>0A6E65736472746165</hex> |
| 196 |
<hex>0D6E65736472746165</hex> |
| 197 |
<hex>0D0A6E65736472746165</hex> |
| 198 |
<text>endstream</text> |
| 199 |
</fixedchoice> |
| 200 |
</struct> |
| 201 |
<struct name="Null"> |
| 202 |
<text>null</text> |
| 203 |
</struct> |
| 204 |
<struct name="Trailer"> |
| 205 |
<text>trailer</text> |
| 206 |
<text>startxref</text> |
| 207 |
<type name="ws" type="Whitespace" minOccurs="1" maxOccurs="unbounded" /> |
| 208 |
<type name="startxref" array="true" type="Digit" /> |
| 209 |
<text>%%EOF</text> |
| 210 |
</struct> |
| 211 |
</mso> |