XHTML validation fails: Cannot find the declaration...
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 2
- Joined: Tue Dec 13, 2005 11:53 pm
XHTML validation fails: Cannot find the declaration...
I tried to validate the following XHTML:
I got: SystemID: /Users/rpaehlig/Applications/oxygen/Unbenannt4.xml
Position: 3:49
Beschreibung: E cvc-elt.1: Cannot find the declaration of element 'html'.
URL: http://www.w3.org/TR/xmlschema-1/#cvc-elt
I see the model being updated when i move the cursor, so I assume, the DTD has been read. What's wrong? TIA!
Code: Select all
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns:html="http://www.w3.org/1999/xhtml">
<head>
<title>Test XHTML</title>
</head>
<body>
<h1>Test</h1>
</body>
</html>
Position: 3:49
Beschreibung: E cvc-elt.1: Cannot find the declaration of element 'html'.
URL: http://www.w3.org/TR/xmlschema-1/#cvc-elt
I see the model being updated when i move the cursor, so I assume, the DTD has been read. What's wrong? TIA!
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi,
From the error message it looks like a schema validation was performed and there is no schema asssociated with the document thus the error. Please make sure you have disable the "Use only XML Schema for validation" option in the Options->Preferences / XML / XML Parser preference page, otherwise the DTD will be ignored for validation and the validation against XML Schema will be tried.
On the other hand your document does not declare correctly the namespace for the html element, instead of declaring a default namespace as the html element has no prefic, it declares a namespace bound to the html prefix which is not used in your document. You need something like:
Best Regards,
George
From the error message it looks like a schema validation was performed and there is no schema asssociated with the document thus the error. Please make sure you have disable the "Use only XML Schema for validation" option in the Options->Preferences / XML / XML Parser preference page, otherwise the DTD will be ignored for validation and the validation against XML Schema will be tried.
On the other hand your document does not declare correctly the namespace for the html element, instead of declaring a default namespace as the html element has no prefic, it declares a namespace bound to the html prefix which is not used in your document. You need something like:
Code: Select all
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test XHTML</title>
</head>
<body>
<h1>Test</h1>
</body>
</html>
George
-
- Posts: 2
- Joined: Tue Dec 13, 2005 11:53 pm
Thank you. That does the job.
I was not aware of this config option. The german translation of this switches label reads 'Use XML Schema for validation' instead of 'Use only XML Schema for validation', which suggested to me that, if disabled, the parser won't use XML Schemas at all anymore. Maybe this minor localization issue should be corrected. The proper german label would be: 'Nur XML Schema für Validierung benutzen'.
Thank you for pointing out that namespace issue too.
Best regards
--
Robby
I was not aware of this config option. The german translation of this switches label reads 'Use XML Schema for validation' instead of 'Use only XML Schema for validation', which suggested to me that, if disabled, the parser won't use XML Schemas at all anymore. Maybe this minor localization issue should be corrected. The proper german label would be: 'Nur XML Schema für Validierung benutzen'.
Thank you for pointing out that namespace issue too.
Best regards
--
Robby
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service