Re: proposal to have sequential / grouped messages in soap output

On Oct 30, 2007, at 08:16, Chris Parrish wrote:

> Hello, Henri.
>
>> In the mean time, I designed and deployed a format that  
>> specifically matches the Validator.nu internals well:
>> http://wiki.whatwg.org/wiki/Validator.nu_XML_Output
>
> I've read through your site but I'd *love* it if you could post an  
> example of your format.

http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest% 
2Fmoz%2Felaboration-demo.xhtml&showsource=yes&out=xml

Reindented here:

<?xml version="1.0" encoding="UTF-8"?>
<messages xmlns="http://n.validator.nu/messages/" xmlns:h="http:// 
www.w3.org/1999/xhtml" url="http://hsivonen.iki.fi/test/moz/ 
elaboration-demo.xhtml">
   <error last-line="6" last-column="9" first-column="4">
     <message>Required attributes missing on XHTML element <a  
xmlns="http://www.w3.org/1999/xhtml" href="http://www.whatwg.org/ 
specs/web-apps/current-work/#img"><code>img</code></a>.</message>
     <extract>&lt;body&gt;
&lt;p&gt;<m>&lt;img/&gt;</m>&lt;/p&gt;
&lt;</extract>
     <elaboration>
       <dl xmlns="http://www.w3.org/1999/xhtml">
         <dt>Element-specific attributes for element <a href="http:// 
www.whatwg.org/specs/web-apps/current-work/#img"><code>img</code></ 
a>:</dt>
         <dd><code><a href="http://www.whatwg.org/specs/web-apps/ 
current-work/#alt">alt</a></code></dd>
         <dd><code><a href="http://www.whatwg.org/specs/web-apps/ 
current-work/#src">src</a></code> (required)</dd>
         <dd><code><a href="http://www.whatwg.org/specs/web-apps/ 
current-work/#usemap1">usemap</a></code></dd>
         <dd><code><a href="http://www.whatwg.org/specs/web-apps/ 
current-work/#ismap">ismap</a></code> (but only
     if one of the ancestor elements is an <code><a href="http:// 
www.whatwg.org/specs/web-apps/current-work/#a">a</a></code>
     element)</dd>
         <dd><code><a href="http://www.whatwg.org/specs/web-apps/ 
current-work/#width3">width</a></code></dd>
         <dd><code><a href="http://www.whatwg.org/specs/web-apps/ 
current-work/#height3">height</a></code></dd>
       </dl>
     </elaboration>
</error>
<error last-line="7" last-column="20" first-column="1">
    <message>Bad value <code xmlns="http://www.w3.org/1999/xhtml">en- 
UK</code> for attribute <code xmlns="http://www.w3.org/1999/ 
xhtml">xml:lang</code> on XHTML element <a xmlns="http://www.w3.org/ 
1999/xhtml" href="http://www.whatwg.org/specs/web-apps/current-work/ 
#p"><code>p</code></a>: Bad region subtag.</message>
    <extract>img/&gt;&lt;/p&gt;<m>&lt;p xml:lang='en-UK'&gt;</m>en- 
UK&lt;</extract>
   </error>
   <error last-line="8" last-column="37" first-column="29">
     <message>Required children missing from XHTML element <a  
xmlns="http://www.w3.org/1999/xhtml" href="http://www.whatwg.org/ 
specs/web-apps/current-work/#figure"><code>figure</code></a>.</message>
     <extract>o&lt;/legend&gt;<m>&lt;/figure&gt;</m>&lt;deta</extract>
     <elaboration>
       <dl xmlns="http://www.w3.org/1999/xhtml">
         <dt>Content model for element <a href="http://www.whatwg.org/ 
specs/web-apps/current-work/#figure"><code>figure</code></a>:</dt>
         <dd>In any order, exactly one <code><a href="http:// 
www.whatwg.org/specs/web-apps/current-work/#legend">legend</a></code>
     element, and exactly one <a href="http://www.whatwg.org/specs/ 
web-apps/current-work/#embedded0">embedded content</a>
     element.</dd>
       </dl>
     </elaboration>
</error>
<error last-line="9" last-column="12" first-column="10">
    <message>Required children missing from XHTML element <a  
xmlns="http://www.w3.org/1999/xhtml" href="http://www.whatwg.org/ 
specs/web-apps/current-work/#details"><code>details</code></a>.</ 
message>
    <extract>&lt;details&gt;<m>&lt;p&gt;</m>Foo&lt;/p</extract>
    <elaboration>
      <dl xmlns="http://www.w3.org/1999/xhtml">
        <dt>Content model for element <a href="http://www.whatwg.org/ 
specs/web-apps/current-work/#details"><code>details</code></a>:</dt>
        <dd>One <code><a href="http://www.whatwg.org/specs/web-apps/ 
current-work/#legend">legend</a></code> element followed by
     either one or more <a href="http://www.whatwg.org/specs/web-apps/ 
current-work/#block-level0">block-level elements</a> or <a  
href="http://www.whatwg.org/specs/web-apps/current-work/#inline- 
level0">inline-level content</a> (but not both).</dd>
      </dl>
    </elaboration>
</error>
<error last-line="10" last-column="9" first-column="1">
    <message>SVG element <code xmlns="http://www.w3.org/1999/ 
xhtml">foo</code> not allowed as child of XHTML element <a  
xmlns="http://www.w3.org/1999/xhtml" href="http://www.whatwg.org/ 
specs/web-apps/current-work/#body0"><code>body</code></a> in this  
context. (Suppressing further error errors from this subtree.)</message>
    <extract>/details&gt;<m>&lt;svg:foo&gt;</m>&lt;baz/&gt;</extract>
</error>
<error last-line="11" last-column="5" first-column="1">
    <message>XHTML element <code xmlns="http://www.w3.org/1999/ 
xhtml">bar</code> not allowed as child of XHTML element <a  
xmlns="http://www.w3.org/1999/xhtml" href="http://www.whatwg.org/ 
specs/web-apps/current-work/#body0"><code>body</code></a> in this  
context. (Suppressing further error errors from this subtree.)</message>
    <extract>/svg:foo&gt;<m>&lt;bar&gt;</m>&lt;baz/&gt;</extract>
</error>
<source type="application/xhtml+xml" encoding="utf-8">&lt;html  
xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/ 
2000/svg"&gt;
&lt;head&gt;
&lt;title&gt;Validator.nu message demo&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;&lt;img/&gt;&lt;/p&gt;
&lt;p xml:lang='en-UK'&gt;en-UK&lt;/p&gt;
&lt;figure&gt;&lt;legend&gt;Foo&lt;/legend&gt;&lt;/figure&gt;
&lt;details&gt;&lt;p&gt;Foo&lt;/p&gt;&lt;/details&gt;
&lt;svg:foo&gt;&lt;baz/&gt;&lt;/svg:foo&gt;
&lt;bar&gt;&lt;baz/&gt;&lt;/bar&gt;
&lt;/body&gt;
&lt;/html&gt;</source>
</messages>

> As far as I can tell, your validator's output does not have a 1- 
> to-1 correlation with the internals of the current validator, though.

It doesn't. Validator.nu can report source locations in more ways  
than the W3C Validator. However, the W3C Validator source location  
way is one of the ways that the Validator.nu XML output format  
supports. Conversely, the Validator.nu output doesn't yet have a  
capability of representing the parse tree and doesn't have a  
capability of communicating implementation-specific error numbers.  
(Validator.nu does not have a concept of error numbers.)

> And would you be suggesting that the w3c validator be converted to  
> a more streaming format (no error count summaries)?

I don't think of myself as a direct stakeholder in the output format  
of the W3C Validator. However, if there's demand for Validator.nu  
supporting the same output format as the W3C Validator, I'd much  
prefer that format to be suitable for streaming generation (not just  
"more" streaming but fully streaming). So yeah, in case I need to  
implement the format, I'd suggest it be streamably generatable.

After the W3C chartered the new HTML WG to work on HTML 5, there has  
been some interest in running an instance of the Validator.nu  
software in the w3.org space. Moreover, the Validator.nu software has  
RELAX NG and Schematron capabilities that would be useful with some  
other languages besides HTML 5 as well. (Validator.nu also has latent  
untested NVDL capabilities, since it uses a patched version of oNVDL.)

It isn't clear to me what the level of interest in running a copy in  
the w3.org space is and if the idea would be to run a standalone copy  
like the W3C copy of Feed Validator or to run it as a back end for  
Unicorn. Either way, I'd be happy to assist in making the software  
runnable in the w3.org space.

Considering Unicorn integration, I would, of course, prefer it if  
Unicorn consumed the Validator.nu native XML format directly.  
However, failing that, I'd rather implement another streamable output  
format than a non-streamable format.

> I have no say in the business decision of whether/how to break the  
> backwards-compatibility,

Me neither.

> Based on validator's internals, mine would go something like:
>
>   <messages count="4" prevalidationcount="1" errorcount="1"  
> warningcount="1" infocount="1">

The counts are redundant data. Moreover, putting them before the  
messages precludes streaming generation of the format.

>     <message type="prevalidation" mid="W06" feedbackuri="http:// 
> validat...">
>       <summary>Unable to Determine Parse Mode!</summary>

That suggests "prevalidation" is a subclass of error. Is it?

>       <explanation><![CDATA[...]]></explanation>

CDATA implies escaped HTML, right? I think it is XML-wise dirty and  
RSS-ish to use escaped HTML instead of inline XHTML.

>       <source line="58" col="23"><![CDATA[...]]></source>

Indicating source locations like that makes forward-compatibility  
with more sophisticated location reporting harder. For example,  
Validator.nu reports the source *range* that a tag occupies in many  
cases.

> I would still keep the <markupvalidationresponse> element  
> encapsulating the <messages>

Doesn't that just require consumers to burrow into a deeper tree?

> and would also keep the meta information like checkedby,

Surely a client knows which URI it is sending its request to?

> validity,

What should a client do if the outcome that can be computed from the  
presence of errors disagrees with the validity proclaimed by the  
validator?

> doctype

Validator.nu is opinionated software when it comes to doctypes. :-)

> PI still wish I could find a way to do away with the element I'm  
> calling <groupsummary>, though.  If there was some way developers  
> could parse the standard <summary> text and deduce their own group  
> summary text, they could then just use the message id (mid) to  
> define their groupings.

So message ids would allow the groups to be computed on the client side?

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Tuesday, 30 October 2007 14:28:33 UTC