XML - Managing Data Exchange/CSS/Answers

Exercise 1Edit

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 -->

  <title>Here you put in a title</title>
  <author>Here you put in a author</author>
  <title>Title of second book</title>
  <author>Author of second book </author>