A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.
To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).
Validator.nu Pipeline Overview: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Obsolete|spec=https://github.com/validator/validator/wiki/Pipeline | {{Obsolete|spec=https://github.com/validator/validator/wiki/Service:-System-backend:-Pipeline}} | ||
Validator.nu makes extensive use of SAX pipelines. When a document is being validated, the main processing loop is in the parser that pulls data from the <code>InputStream</code> and pushes out parse events. | Validator.nu makes extensive use of SAX pipelines. When a document is being validated, the main processing loop is in the parser that pulls data from the <code>InputStream</code> and pushes out parse events. | ||
Revision as of 01:19, 22 March 2015
This document is obsolete.
For the current specification, see: https://github.com/validator/validator/wiki/Service:-System-backend:-Pipeline
Validator.nu makes extensive use of SAX pipelines. When a document is being validated, the main processing loop is in the parser that pulls data from the InputStream
and pushes out parse events.
These events are pushed through a pipeline of filters. Then each parse event is repeated to each validator in a chain of side-by-side validators. The parser, the filters and the validators push messages to a SAX ErrorHandler
. In the cases of the HTML, XHTML and XML output formats, the ErrorHandler
implementation in turn pushes out SAX events corresponding to the generated result document.
Parser Pipeline
HTML Pipeline
nu.validator.htmlparser.sax.HtmlParser
(in streaming mode)nu.validator.xml.WiretapXMLReaderWrapper
(feeding each event first tonu.validator.source.LocationRecorder
)nu.validator.xml.AttributesPermutingXMLReaderWrapper
- Validators
XML Pipeline
nu.validator.gnu.xml.aelfred2.SAXDriver
nu.validator.xml.IdFilter
nu.validator.xml.WiretapXMLReaderWrapper
(feeding each event first tonu.validator.source.LocationRecorder
)nu.validator.xml.NamespaceDroppingXMLReaderWrapper
(if there are namespaces to be filtered out)nu.validator.xml.AttributesPermutingXMLReaderWrapper
nu.validator.servlet.RootNamespaceSniffer
(if schema was left to autodetect)- Validators
Validator Chain
All (schema-based and non-schema-based) validators have to implement com.thaiopensource.validate.Validator
. Non-schema-based checkers inherit from org.whattf.checker.Checker
and are wrapped in org.whattf.checker.jing.CheckerValidator
to implement the required interface.
When more than one schema is specified, the corresponding validators are chained using com.thaiopensource.relaxng.impl.CombineValidator
.
Output Pipeline
nu.validator.messages.MessageEmitterAdapter
(implementsErrorHandler
)nu.validator.messages.MessageEmitter
HTML and XHTML
nu.validator.messages.XhtmlMessageEmitter
(extendsMessageEmitter
)nu.validator.htmlparser.sax.HtmlSerializer
(HTML) /nu.validator.htmlparser.sax.XmlSerializer
(XHTML)java.io.OutputStream
XML
nu.validator.messages.XmlMessageEmitter
(extendsMessageEmitter
)nu.validator.htmlparser.sax.XmlSerializer
java.io.OutputStream
JSON
nu.validator.messages.JsonMessageEmitter
(extendsMessageEmitter
)nu.validator.json.JsonHandler
java.io.OutputStream
GNU
nu.validator.messages.GnuMessageEmitter
(extendsMessageEmitter
)java.io.OutputStream
Text
nu.validator.messages.TextMessageEmitter
(extendsMessageEmitter
)java.io.OutputStream