rvp(1) - Linux man page

Name

rvp - RELAX NG Validation Pipe

Synopsis

rvp {-q | -s | -v | -h} grammar.rnc

The options are:

-q

returns only error numbers, suppresses messages;
-s
uses less memory and runs slower;
-v
prints version number;
-h
displays usage summary and exits.

Relax Ng Validation Pipe

RVP is abbreviation for Relax NG Validation Pipe. It reads validation primitives from the standard input and reports result to the standard output; it's main purpose is to ease embedding of a RELAX NG validator into various languages and environment. An application would launch RVP as a parallel process and use a simple protocol to perform validation. The protocol, in BNF, is:

query ::= (
          quit
        | start
        | start-tag-open
        | attribute
        | start-tag-close
        | text
        | end-tag) z.
      quit ::= "quit".
      start ::= "start" [gramno].
      start-tag-open ::= "start-tag-open" patno name.
      text ::= ("text"|"mixed") patno text.
      end-tag ::= "end-tag" patno name.
    response ::= (ok | er | error) z.
       ok ::= "ok" patno.
       er ::= "er" patno erno.
       error ::= "error" patno erno error.
    z ::= "\0" .
• RVP assumes that the last colon in a name separates the local part from the namespace URI (it is what one gets if specifies : as namespace separator to Expat).
• Error codes can be grabbed from rvp sources by grep _ER_ *.h and OR-ing them with corresponding masks from erbit.h. Additionally, error 0 is the protocol format error.
• Either er or error responses are returned, not both; -q chooses between concise and verbose forms (invocation syntax described later).
• start passes the index of a grammar (first grammar in the list of command-line arguments has number 0); if the number is omitted, 0 is assumed.
• quit is not opposite of start; instead, it quits RVP.
To assist embedding RVP, samples in Perl (tools/rvp.pl) and Python (tools/rvp.py) are provided. The scripts use Expat wrappers for each of the languages to parse documents; they take a RELAX NG grammar (in the compact syntax) as the command line argument and read the XML from the standard input. For example, the following commands validate rnv.dbx against docbook.rnc:
perl rvp.pl docbook.rnc < rnv.dbx
python rvp.py docbook.rnc < rnv.dbx
The scripts are kept simple and unobscured to illustrate the technique, rather than being designed as general-purpose modules. Programmers using Perl, Python, Ruby and other languages are encouraged to implement and share reusable RVP-based components for their languages of choice.

Authors

David Tolpin

Developer
Thomas Schraitle
Manpage