Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XHTML DTD

27 views
Skip to first unread message

John Hughes

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
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

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>

Gavrielov, Vladislav

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
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>


the second <html> is not necessary here - remove it and it will work.


John Hughes

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
Sorry.

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
>

Sam Judson

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
Ignore me..

"John Hughes" <hug...@netcomuk.co.uk> wrote in message

news:eiFc0Mfg$GA....@cppssbbsa02.microsoft.com...

Sam Judson

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
Should it be www.w3c.org not www.w3.org? or is this just a typo?

Sam Judson

Gavrielov, Vladislav

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
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>


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


Joseph Kesselman (yclept Keshlam)

unread,
Feb 29, 2000, 3:00:00 AM2/29/00
to
Sam Judson wrote:
> Should it be www.w3c.org not www.w3.org? or is this just a typo?

No, that's deliberate. The W3C's URLs really do start with
www.w3.org.

--
-----------------------------------------------------------------
Joe Kesselman, kes...@us.ibm.com

0 new messages