XML - Managing Data Exchange/CSS/Answers

Exercise 1

edit

Here is one way you could do it:

To be able to hook up your external style sheet with your XML document you have to write:
<?xml-stylesheet type="text/css" href="excercise1.css"?>
at the start of the document, under
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Like this:

<?xml version="1.0" encoding="UTF-8"  standalone="yes"?>
<?xml-stylesheet type="text/css" href="exercise1.css"?>
<!DOCTYPE inventory[
  <!ELEMENT inventory (book+)>
  <!ELEMENT book (isbn,title,titel?,author+,publisher,price)>
  <!ELEMENT isbn (#PCDATA)>
  <!ELEMENT title (#PCDATA)>
  <!ELEMENT author (#PCDATA)>
  <!ELEMENT publisher (#PCDATA)>
  <!ELEMENT price (#PCDATA)> 
  <!ENTITY gyl "Gylden, Oslo Norway">    <!-- example of publisher -->
  <!ENTITY sybex "SYBEX Inc. San Francisco California"> <!-- example of publisher -->
]>

<inventory>
 <book>
  <isbn>91-1-300875-7</isbn>
  <title>Here you put in a title</title>
  <author>Here you put in a author</author>
  <publisher>&gyl;</publisher>
  <price>$30</price>
 </book>
 <book> 
  <isbn>91-2-705229-X</isbn>
  <title>Title of second book</title>
  <author>Author of second book </author>
  <publisher>&sybex;</publisher>
  <price>$30</price>
 </book>
</inventory>