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

Re: Polyglot XHTML5 Validator?

  • From: David Carlisle <davidc@nag.co.uk>
  • To: Jesper Tverskov <jesper.tverskov@gmail.com>
  • Date: Sun, 22 May 2011 14:43:13 +0100

Re:  Polyglot XHTML5 Validator?
On 22/05/2011 14:16, Jesper Tverskov wrote:
> Hi David
>
> You forgot to comment on this one:
> *** Also I think we need an assertion testing that document.write()
> and document.writeln() are not used.

ah sorry, hmm well I could do a simple check on inline scripts
but I can't really check external script an even for inline scripts if 
the script has a comment,
//can't use document.write()
then it would fail the test unless the test used a real javascript 
parser, which is out of scope here.
so I can't check all cases and will get the wrong answer on some cases I 
do check so (possibly) it's better just to document that the check is 
not done. this is not so different from if teh scriot uses innerHTML, 
which is allowed but only if the string inserted does itself meet the 
constraints of the polyglot document. If you need that level of checking 
then this kind of declarative schema isn't really what you want, you 
just need to parse the document as xhtml and html and then do a 
comparison of the resulting dom trees.

>
> You say that you don't want to make an assertion disallowing:
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> because: "I only want to test clauses in the polyglot spec, so perhaps
> you should raise a bug against that?
>
> I will do that. So please make the assertion, we need it. It will be a
> very common error. It is too stupid that I and others will have do
> make an improved version of your schema.

Actually I don't think this is needed at all, the meta statement won't 
affect the dom produced by either an html or xhtml parser as far as I 
can see.
>
> *** I think it is damaging that we cannot test for not allowed named
> entity references, since it is bound to be a very common error.

As I say the schematron assumes that teh input is well formed xml and 
valid html, so any entity names, if used, will be correct. then when 
parsed as xml either it will work correctly (if a dtd is read) or it 
will be an xml parse error. You won't get strangely incompatible doms.

>
> Why not make an assertion using unparsed-text(), it is not in XPath
> but will make it to the XSLT stylesheet and should work, I guess. You
> could write the necessary regex faster than the rest of us can check
> our mail on our iPhone.

the necessary regexp is (more or less) in the htmlparse stylesheet 
available at the same site, however it would have the same problems as 
checking for document.write giving a lot of false faiures. For example 
the mathml spec avoids using entity references by using a style
<mo>&#8596;<!-- &rightarrow; --></mo>
this would fail a check using unparsed-text() unless I tried to filter 
out comments and things and this would be very fragile.


David


[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.