Re: Some suggestions for the SOAP api

olivier Thereaux wrote:
> As documented, the <m:explanation> is the same block of HTML used in 
> the validator's main output. Unfortunately, that's the way the error 
> message explanations are stored, so unless someone comes in and wishes 
> to clean that up, it may stay that way a while. Your suggestions are 
> quite good, though, but it would take time to:
> * take the current error explanations file
> * massage that into something more structure
> * change the templates of the validator to take that structured data 
> and make that HTML/API XML at runtime
>
> If anyone's interested, that would speed things up. If not, let's put 
> the suggestion in bugzilla and see when one of the developers may have 
> time for it.
>

Bummer.  Well, as a compromise, are the explanation messages (in HTML)
separate from the helpwanted links?  It would at least help if the
current <m:explanation> could be served up via SOAP as:

<m:explanationfeedback>
  <![CDATA[
   <p class="helpwanted">
     <a

href="http://validator.w3.org/feedback.html?uri=;errmsg_id=64#errormsg"
   title="Suggest improvements on this error message through our
feedback channels"
     >&#x2709;</a>
   </p>
]]>
</m:explanationfeedback>

and

<m:explanationtext>
  <![CDATA[
   <div class="ve mid-64">
   <p>
     The element named above was found in a context where it is not
     allowed. This could mean that you have incorrectly nested elements
     -- such as a "style" element in the "body" section instead of
     inside "head" -- or two elements that overlap (which is not
     allowed).
   </p>
   <p>
     One common cause for this error is the use of XHTML syntax in HTML
     documents. Due to HTML's rules of implicitly closed elements, this
     error can create cascading effects. For instance, using XHTML's
     "self-closing" tags for "meta" and "link" in the "head" section of
     a HTML document may cause the parser to infer the end of the "head"
     section and the beginning of the "body" section (where "link" and
     "meta" are not allowed; hence the reported error).
   </p>
   </div>
]]>
</m:explanationtext>

Is this possible (simply)?


Now, with regards to massaging the current explanation files, I hadn't
noticed that some of the message paragraphs, are filled with <a>, <code> 
and other tags.  So, I'm not sure how you'd convert the messages to a
text-only format unless you kept a separate version of the error for the
SOAP and standard validator.  You certainly couldn't keep a text-only
version and reconstitute the HTML from it.

I'm guessing  a better solution might be to keep the existing messages
in the current format and, instead, code a processor for SOAP users that
parses them into plain text (or at least more distinct blocks of HTML)
much like app developers now must do.  That way, the fancy parsing rules
are coupled to the messages themselves in the same app -- yours.  Sure,
changes to the message format would require adjusting the SOAP
processing code on the validator -- but it wouldn't require every SOAP
consumer to re-work their apps.  And you would have knowledge of when/if
those changes were going to happen.

>> Sure I can strip tags but then the whole "Suggest improvements on 
>> this error message" bit gets reduced to a '?'
>
> Sounds odd. Are you sure you treat the incoming data as utf-8?

Yeah it's odd.  To be accurate, what is left is '&#x2709;' which is the
content of the <a> tag.  So, what I said is correct.


-Chris

Received on Thursday, 11 October 2007 00:06:13 UTC