george wrote:
The W3C Validator is an application. That tries to detect automatically the document type and in some cases it fails. But you have the option to specifically test a document against a document type that you choose, just click on More Options and then select in the Use Doctype combo box XHTML+RDFa. If you do that with the document from this post topic has the DOCTYPE declaration commented then you will get that passing the validation.
Right, but if I select XHTML+RDFa in the Doctype combo box, this just adds a doctype line to the file and validates the result (which is something Oxygen won't validate). For instance, if I paste the last example you gave into the W3C validator and override the doctype, the result is this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/MarkUp/SCHEMA/xhtml-rdfa-1.xsd"
xmlns:con="http://www.w3.org/2000/10/swap/pim/contact#"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:rec="http://www.w3.org/2001/02pd/rec54#"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:mat="http://www.w3.org/2002/05/matrix/vocab#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:doc="http://www.w3.org/2000/10/swap/pim/doc#"
xmlns:org="http://www.w3.org/2001/04/roadmap/org#">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>SKOS Simple Knowledge Organisation System Reference, Editors' Draft
1 October 2008 $Revision: 1.38 $</title>
<meta name="generator" content="Amaya 9.54, see http://www.w3.org/Amaya/" />
<link href="extras.css" rel="stylesheet" type="text/css" />
<link href="http://www.w3.org/StyleSheets/TR/base" rel="stylesheet"
type="text/css" />
<script type="text/javascript" src="extras.js"></script>
</head>
<body>
</body>
</html>
which Oxygen does not consider valid due to the xml:space issue mentioned earlier in this thread. Even the W3C validator isn't totally happy: it generates the warning: 'The DOCTYPE Declaration for "XHTML + RDFa" has been inserted at the start of the document, but even if no errors are shown below the document will not be Valid until you add the new DOCTYPE Declaration.'
As far as I can tell, this is due to the W3C validator implementing an out-of-date draft of the RDFa in XHTML syntax spec, which
required the presence of a doctype. The latest version
does not require a doctype to be present, and the sample document presented (shown below) is not validated by the W3C validator unless the XHTML+RDFa doctype override is selected, much as was the case for your sample document.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
version="XHTML+RDFa 1.0"
xml:lang="en">
<head>
<title>Virtual Library</title>
</head>
<body>
<p>Moved to <a href="http://example.org/">example.org</a>.</p>
</body>
</html>
So w.r.t the latest draft, you were quite right about commenting out the doctype; w.r.t. the older one, you weren't, and it wasn't until I noticed the change in the draft that I realised what was going on.
Thank you for giving me the most up-to-date solution
george wrote:
oXygen is also an application and it allows you to validate documents against XML Schema, DTD or other type of schemas. By default the engine used for validating against XML Schema for example is Xerces but you can change that to Saxon SA or other engine.
Just to check my understanding: all of these should conclude with the same result as each other, though, shouldn't they? I realise that Saxon SA might be faster, but the outcome should be the same, shouldn't it, unless one of the engines has a bug? (I don't have a license for Saxon SA though, so I can't test this.)
george wrote:
It is not a but as the DTD information is used when you specify to prefer a schema for validation even if a DTD is specified. This is how it was designed to work to allow for example using entities with other schema languages. The validation results depend on the schema or DTD that is used. In this topic the DTD and the schema are not synchronized.
I'm afraid I don't understand this. If selecting the "Ignore the DTD for validation if a schema is specified" is supposed to make Oxygen ignore validation information in the DTD and use it for entity specifications only, then why is Oxygen still objecting to the presence of xml:space attributes in script elements? Surely the relevant part of
http://www.w3.org/MarkUp/DTD/xhtml-script-1.mod (which is linked from
http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd) counts as validation information that should be ignored?
That is to say, I realise that
http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd and
http://www.w3.org/MarkUp/SCHEMA/xhtml-rdfa-1.xsd are not synchronized exactly, but surely ticking the "Ignore the DTD for validation if a schema is specified" checkbox should overcome this problem.
If it did, then I could create a document that would validate in both the W3C validator (as it stands) and in Oxygen, which would mean I'd benefit from Oxygen's validation while I'm developing my code, and my site's users could check my code's validity (against the older standard) by way of "validation" buttons on my site. Until the W3C updates its validator, that would be the best of both worlds
Again, many thanks indeed for the help!
Sam