|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.bitplan.w3ccheck.W3CValidator
public class W3CValidator
Wrapper for W3C Validator Soap responses see W3C Markup Validation Service Request Format
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
...
</env:Envelope>
According to W3C Markup Validation Service Request Format documentation:
A SOAP response for the validation of a document (invalid) will look like this:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<m:markupvalidationresponse
env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
xmlns:m="http://www.w3.org/2005/10/markup-validator">
<m:uri>http://qa-dev.w3.org/wmvs/HEAD/dev/tests/xhtml1-bogus-element.html</m:uri>
<m:checkedby>http://validator.w3.org/</m:checkedby>
<m:doctype>-//W3C//DTD XHTML 1.0 Transitional//EN</m:doctype>
<m:charset>utf-8</m:charset>
<m:validity>false</m:validity>
<m:errors>
<m:errorcount>1</m:errorcount>
<m:errorlist>
<m:error>
<m:line>13</m:line>
<m:col>6</m:col>
<m:source><![CDATA[
<foo<strong title="Position where error was detected.">></strong>This phrase is enclosed in a bogus FOO element.</foo>
]]>
</m:source>
<m:explanation>
<![CDATA[
<p> ... </p<p>
]]>
</m:explanation>
<m:messageid>76</m:messageid>
<m:message>element "foo" undefined</m:message>
</m:error>
</m:errorlist>
</m:errors>
<m:warnings>
<m:warningcount>0</m:warningcount>
<m:warninglist>
...
</m:warninglist>
</m:warnings>
</m:markupvalidationresponse>
</env:Body>
</env:Envelope>
the structure of this W3CValidator class is aligned to this format| Nested Class Summary | |
|---|---|
static class |
W3CValidator.Body
structure for the Body node of the message {@code |
| Field Summary | |
|---|---|
W3CValidator.Body |
body
field that holds the structure for the Body node of the message {@code |
static boolean |
debug
set to true if Logging should be enabled |
protected static Logger |
LOGGER
Logging may be enabled by setting debug to true |
static String |
url
the URL of the official W3C Markup Validation service if you'd like to run the tests against your own installation you might want to modify this |
| Constructor Summary | |
|---|---|
W3CValidator()
|
|
| Method Summary | |
|---|---|
static W3CValidator |
check(String html)
create a W3CValidator result for the default url http://validator.w3.org/check with the given html |
static W3CValidator |
check(String url,
String html)
create a W3CValidator result for the given url with the given html |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean debug
protected static Logger LOGGER
public static String url
public W3CValidator.Body body
<env:Body>
...
</env:Body>
| Constructor Detail |
|---|
public W3CValidator()
| Method Detail |
|---|
public static W3CValidator check(String html)
throws JAXBException
html - - the html code to be checked
JAXBException - if there is something wrong with the response message so that it
can not be unmarshalled
public static W3CValidator check(String url,
String html)
throws JAXBException
url - - the url of the validator e.g. "http://validator.w3.org/check"html - - the html code to be checked
JAXBException - if there is something wrong with the response message so that it
can not be unmarshalled
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||