Zoo tutorials: [ SQL | Java | Linux | XML ]

A Gentle Introduction to xml

Additional Questions

Question 1: Union Jack

The Union Jack is said to consist of three flags overlaid. Union Jack flag

The Union Jack is easy to draw incorrectly. We can overlay the three Saints' flags - St.Andrew, St. Patrick and St. George - but:


Question 2: Stars

We can give an element an id. The use element allows us to reuse that node in another context. US Flag

In this example we have a five pointed star defined as star it gets used three times in different positions.

  1. Complete the row of six stars across the top of the blue rectangle.
  2. You can use the following to define a group of six stars. Insert the text just after the definition of the star. We can use this several times as <use xlink:href="#row6" y="3"/>
     <g id="row6">
       <use xlink:href="#star" x="1"/>
       <use xlink:href="#star" x="3"/>
       <use xlink:href="#star" x="5"/>
       <use xlink:href="#star" x="7"/>
       <use xlink:href="#star" x="11"/>
     </g>
    
  3. Using similar techniques you can create a 5 x 4 grid of stars, these can be used to complete the "stars" part or the stars and stripes.

Question 3: Stripes

Add the seven red stripes before the stars.

You can draw each stripe either as a line or as a rectangle.

Working in 13th's is a little clumsy so you may enclose all of the stripes in a g element - we can use the transform "scale" so that we can work with a rectangle that is one unit wide and 13 units high.

<g transform="scale(1.9,0.0769)">
  <line x1="0" x2="1" y1=".5" y2=".5" stroke="red"/>
</g>

Question 4: Namibia

The flag for Namibia is particularly attractive, it presents an interesting challenge. Flag of Namibia