Hi,
I have three files related to my challenge. I have one xml file, one css file and one dtd. The files are as follows:
The following file is books.xml
<!DOCTYPE booklist SYSTEM “booklist.dtd”>
<?xml version="1.0" ?>
<?xml-stylesheet type="text/css" href="booklist.css" ?>
<booklist>
<book>
<name>Backpacker's Field Manual</name>
<author>Rick Curtis</author>
<publisher>Crown Publishers Inc.</publisher>
<ISBN>0517887835</ISBN>
<date>March 1998</date>
</book>
<book>
<name>Modern Backpacker's Handbook</name>
<author>Glen Randall</author>
<publisher>Lyons and Burford Publishers</publisher>
<ISBN>1558212485</ISBN>
<date>February 1994</date>
</book>
<book>
<name>Backpacker's Handbook</name>
<author>Chris Townsend</author>
<publisher>Ragged Mountain Press</publisher>
<ISBN>0070653151</ISBN>
<date>October 1996</date>
</book>
</booklist>
The following file is booklist.css:
book
{
font-family: "Arial",sans-serif;
font-size:10pt
}
name
{
display:block;
font-size: 12pt;
background-color:#ffffcc
}
author
{
display:block;
color: #cc6600
}
publisher
{
display:inline;
color: navy
}
ISBN
{
display:inline;
color: blue
}
Date
{
display:inline;
font-style:italic;
color: navy
}
The following file is booklist.dtd:
<!DOCTYPE booklist [
<!ELEMENT booklist (book+)>
<!ELEMENT book (name,author,publisher,ISBN?,date?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT ISBN (#PCDATA)>
<!ELEMENT date (#PCDATA)>
]>
I have very little understanding of xml however all was going well until I externalized the dtd. Originally the dtd was part of books.xml, and this displayed fine in IE however now that the dtd has been moved to an external file nothing is working as expected. Here is a report of the errors that I am getting in Internet Explorer and Mozilla respectively:
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
IE!
An invalid character was found in text content. Error processing resource 'file:///D:/Swinburne Docs/Classes/Web Development 1/Lab Work/books.xml'. Line 1, Position 27
<!DOCTYPE booklist SYSTEM
Mozilla!!
XML Parsing Error: not well-formed
Location: file:///D:/Swinburne%20Docs/Classes/Web%20Development%201/Lab%20Work/books.xml
Line Number 1, Column 27:<!DOCTYPE booklist SYSTEM ?booklist.dtd?>
I imagine that this is a simple error that I am not familiar with. However as I am not familiar with XML an help with sorting this out will be really appreciated.
Thanks
David
I have three files related to my challenge. I have one xml file, one css file and one dtd. The files are as follows:
The following file is books.xml
<!DOCTYPE booklist SYSTEM “booklist.dtd”>
<?xml version="1.0" ?>
<?xml-stylesheet type="text/css" href="booklist.css" ?>
<booklist>
<book>
<name>Backpacker's Field Manual</name>
<author>Rick Curtis</author>
<publisher>Crown Publishers Inc.</publisher>
<ISBN>0517887835</ISBN>
<date>March 1998</date>
</book>
<book>
<name>Modern Backpacker's Handbook</name>
<author>Glen Randall</author>
<publisher>Lyons and Burford Publishers</publisher>
<ISBN>1558212485</ISBN>
<date>February 1994</date>
</book>
<book>
<name>Backpacker's Handbook</name>
<author>Chris Townsend</author>
<publisher>Ragged Mountain Press</publisher>
<ISBN>0070653151</ISBN>
<date>October 1996</date>
</book>
</booklist>
The following file is booklist.css:
book
{
font-family: "Arial",sans-serif;
font-size:10pt
}
name
{
display:block;
font-size: 12pt;
background-color:#ffffcc
}
author
{
display:block;
color: #cc6600
}
publisher
{
display:inline;
color: navy
}
ISBN
{
display:inline;
color: blue
}
Date
{
display:inline;
font-style:italic;
color: navy
}
The following file is booklist.dtd:
<!DOCTYPE booklist [
<!ELEMENT booklist (book+)>
<!ELEMENT book (name,author,publisher,ISBN?,date?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT ISBN (#PCDATA)>
<!ELEMENT date (#PCDATA)>
]>
I have very little understanding of xml however all was going well until I externalized the dtd. Originally the dtd was part of books.xml, and this displayed fine in IE however now that the dtd has been moved to an external file nothing is working as expected. Here is a report of the errors that I am getting in Internet Explorer and Mozilla respectively:
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
IE!

An invalid character was found in text content. Error processing resource 'file:///D:/Swinburne Docs/Classes/Web Development 1/Lab Work/books.xml'. Line 1, Position 27
<!DOCTYPE booklist SYSTEM
Mozilla!!

XML Parsing Error: not well-formed
Location: file:///D:/Swinburne%20Docs/Classes/Web%20Development%201/Lab%20Work/books.xml
Line Number 1, Column 27:<!DOCTYPE booklist SYSTEM ?booklist.dtd?>
I imagine that this is a simple error that I am not familiar with. However as I am not familiar with XML an help with sorting this out will be really appreciated.
Thanks
David