Line : 5
Position : 7
Reason : Element content is invalid according to the DTD/Schema.
Expecting: head
The file its validating :
<?xml version="1.0"?>
<!DOCTYPE html SYSTEM "C:\$Source\XML\xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head><title>Test</title>
</head>
<body></body>
</html>
<?xml version="1.0"?>
<!DOCTYPE html SYSTEM
"C:\$Source\XML\xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head><title>Test</title>
</head>
<body></body>
</html>
the second <html> is not necessary here - remove it and it will work.
The file is :
<?xml version="1.0"?>
<!DOCTYPE html SYSTEM "C:\$Source\XML\xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test
</title>
</head>
<body>
</body>
</html>
"John Hughes" <hug...@netcomuk.co.uk> wrote in message
news:#3d5Bpeg$GA....@cppssbbsa02.microsoft.com...
> Using the XHTML DTD from W3C I get the following error. Im not sure if
this
> is a bug or Im making an error. If anyone can help it would be
appreciated.
>
> Line : 5
> Position : 7
> Reason : Element content is invalid according to the DTD/Schema.
> Expecting: head
>
"John Hughes" <hug...@netcomuk.co.uk> wrote in message
news:eiFc0Mfg$GA....@cppssbbsa02.microsoft.com...
<?xml version="1.0"?>
<!DOCTYPE html SYSTEM
"C:\$Source\XML\xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test
</title>
</head>
<body>
</body>
</html>
Well, your problem is really tricky!
I have immediately tried your file with our XML Spy 3.0b2 and it told
me, that file is valid (this version uses our own validator engine). And
just before to write you this answer, I have tried it also with XML Spy
2.5 which uses IE5.0 for validation, and it placed the cursor on <head>
element, and said "head expected!"
Going through DTD I have finally found the reason of all that strange
error messages. The problem is, that <html> is defined with a fixed
attribute xmlns="http://www.w3.org/1999/xhtml" which you have also used
in your XML file.
But using this attribute makes html element and all sub-elements named
actually with prefix {http://www.w3.org/1999/xhtml}. At the same time
the complete DTD is written for simply named elements, without prefix!
It is the very old problem about using DTD and Namespaces. James Clark
has written in his article http://www.jclark.com/xml/xmlns.htm about
Namespaces, that DTD validation has to be done WITHOUT to care about
Namespaces, means to see the pure names.
I hope my answer helps you.
Vladislav Gavrielov
Icon Information-Systems makers of XML Spy http://www.xmlspy.com
No, that's deliberate. The W3C's URLs really do start with
www.w3.org.
--
-----------------------------------------------------------------
Joe Kesselman, kes...@us.ibm.com