[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Polyglot XHTML5 Validator?

  • From: Jesper Tverskov <jesper.tverskov@gmail.com>
  • To: xml-dev@lists.xml.org
  • Date: Tue, 24 May 2011 08:59:47 +0200

Re:  Polyglot XHTML5 Validator?
I have now checked the spec, http://www.w3.org/TR/html-polyglot/, and
your XHTML5 polyglot Schematron schema, at
http://code.google.com/p/web-xslt/wiki/Overview, one more time, and I
feel we still have several issues.

*** 1***
The following assertion is OK:
<sch:pattern>
 <sch:rule context="*[@lang|@xml:lang]">
 <sch:assert test="@xml:lang and @lang and @xml:lang=@lang" >xml:lang
and lang should both be used</sch:assert>
</sch:rule>
</sch:pattern>

But I have a feeling that it is only half the job. The assertion says:
"If an element has a lang or an xml:lang attribute it should also have
the other, and the values must be identical".

But as I read the spec, 7.2, and "the most basic minimum polyglot
document example", in 6.1, the html root element _must_ have a lang
and an xml:lang attribute. So we need an extra assertion:

<sch:pattern>
 <sch:rule context="html">
 <sch:assert test="@xml:lang and @lang and @xml:lang=@lang" >The html
element must use both @xml:lang and @lang, and they must have the same
value.</sch:assert>
</sch:rule>
</sch:pattern>

***2***
Your Schematron schema has assertions for the existence of head and
body as first and second child of html. As I read the spec we also
need to test if head element contains a title element.

***3***
Also I feel that the following is not enough (it should be required to
use this meta):
<sch:pattern>
 <sch:rule context="h:meta[@charset]">
 <sch:assert test="lower-case(@charset)='utf-8'" >If meta/@charset is
used, it must specify utf-8.</sch:assert>
</sch:rule>
</sch:pattern>

As I read the spec it is not 100% necessary to use the above meta tag,
but morally speaking it is. The spec says:

"The W3C Internationalization (i18n) Group recommends to always
include a visible encoding declaration in a document, because it helps
developers, testers, or translation production managers to check the
encoding of a document visually."

***4***
We ought to check that the DOCTYPE lives up to certain constraints? I
know it will not be easy with Schematron unless we use unparsed-text()
and regex.

***5***
As I have indicated earlier, we must check that the following metatag
is not used, because it defeats the whole idea of a document that can
be served as HTML and XHTML only depending on the mimetype set outset
the document:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

I have now tested what happens if a document containing the above
metatag is validated at Validator.nu when served with mimetype
application/xhtml+xml. It doesn't pass as a valid XHTML document.

***6***
In an earlier answer you repeat that the following assertion is necessary:

<sch:pattern>
 <sch:rule context="h:script|h:style">
<sch:assert test="not(matches(.,'[&lt;&amp;]'))" >script and style
should not use &amp; or &lt;</sch:assert>
 </sch:rule>
</sch:pattern>

I still don't understand why, considering that point of departure is a
well-formed document?

Cheers
Jesper Tverskov
http://www.xmlplease.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.