Hi Everyone,
I am doing a simple lab for Uni. This lab requires me to write out a small xml file and link a style sheet to it. I have done these things no worries. However the lab also asks me to reference an external dtd. My xml document shows up in explorer without a doctype, with an internal doctype but not with an external doctype.
The code for these files is shown below:
file -- book.xml
file -- booklist.css
file -- booklist.dtd
Sorry about the amount of code included, just needed to paint the picture. Like I said this code works fine except when I try and externalize the dtd. I just don't get why it isn't working. I got the following error message from IE6
If anybody could help me with this small dilemma I will be greatly appreciative. Thanks
Regards
Davo
I am doing a simple lab for Uni. This lab requires me to write out a small xml file and link a style sheet to it. I have done these things no worries. However the lab also asks me to reference an external dtd. My xml document shows up in explorer without a doctype, with an internal doctype but not with an external doctype.
The code for these files is shown below:
file -- book.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE booklist SYSTEM “booklist.dtd”>
<?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>
Code:
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;
}
Code:
<!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)>
]>
Sorry about the amount of code included, just needed to paint the picture. Like I said this code works fine except when I try and externalize the dtd. I just don't get why it isn't working. I got the following error message from IE6
Code:
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.
An invalid character was found in text content. Error processing resource 'file:///E:/Web Design 1/book.xml'. Line 2, Position 27
<!DOCTYPE booklist SYSTEM
If anybody could help me with this small dilemma I will be greatly appreciative. Thanks
Regards
Davo