Zoo tutorials: [ SQL | Linux | XML ]

A Gentle Introduction to xml

Options and brackets

We can nest options, this allows us to specify complicated options.

The bar (|) may be used to allow options. A|B means either A or B is permitted. We can use brackets in these regular expressions.

Any of the following is allowed:

Complete the DTD


ValidInvalid
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE amount SYSTEM "country.dtd">
<amount>
  <!-- United kingdom -->
  <pounds>10</pounds><pence>50</pence>
</amount>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE amount SYSTEM "country.dtd">
<amount>
  <!-- Duh -->
  <pounds>10</pounds><cents>50</cents>
</amount>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE amount SYSTEM "country.dtd">
<amount>
  <!-- USA -->
  <dollars>10</dollars><cents>50</cents>
</amount>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE amount SYSTEM "country.dtd">
<amount>
  <!-- Duh -->
  <dollars>10</dollars><pence>50</pence>
</amount>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE amount SYSTEM "country.dtd">
<amount>
  <!-- France -->
  <euros>10</euros><cents>50</cents>
</amount>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE amount SYSTEM "country.dtd">
<amount>
  <!-- Duh -->
  <pounds>10</pounds><dollars>50</dollars>
</amount>