1RVP(1) General Commands Manual RVP(1)
2
3
4
6 rvp - Relax NG validation pipe
7
8
10 rvp {-q|-s|-v|-h} {schema.rnc}
11
12
14 -q returns only error numbers, suppresses messages
15
16 -s takes less memory and runs slower
17
18 -v prints current version
19
20 -h displays usage summary and exits
21
22
24 RVP is abbreviation for Relax NG Validation Pipe. It reads validation
25 primitives from the standard input and reports result to the standard
26 output; it's main purpose is to ease embedding of a Relax NG validator
27 into various languages and environment. An application would launch RVP
28 as a parallel process and use a simple protocol to perform validation.
29 The protocol, in BNF, is:
30
31 query ::= (
32 quit
33 | start
34 | start-tag-open
35 | attribute
36 | start-tag-close
37 | text
38 | end-tag) z.
39 quit ::= "quit".
40 start ::= "start" [gramno].
41 start-tag-open ::= "start-tag-open" patno name.
42 attribute ::= "attribute" patno name value.
43 start-tag-close :: = "start-tag-close" patno name.
44 text ::= ("text"|"mixed") patno text.
45 end-tag ::= "end-tag" patno name.
46 response ::= (ok | er | error) z.
47 ok ::= "ok" patno.
48 er ::= "er" patno erno.
49 error ::= "error" patno erno error.
50 z ::= "\0" .
51
52
53 RVP assumes that the last colon in a name separates the local partfrom
54 the namespace URI (it is what one gets if specifies `:' as namespace
55 separator to Expat).
56
57 Error codes can be grabbed from rvp sources by grep _ER_.h and OR-ing
58 them with corresponding masks from erbit.h. Additionally, error 0 is
59 the protocol format error.
60
61 Either er or error responses are returned, not both; -q chooses between
62 concise and verbose forms (invocation syntax described later).
63
64 Start passes the index of a grammar (first grammar in the list of com‐
65 mand-line arguments has number 0); if the number is omitted, 0 is
66 assumed.
67
68 Quit is not opposite of start; instead, it quits RVP.
69
70
72 To assist embedding RVP, samples in Perl and Python are provided. The
73 scripts use Expat wrappers for each of the languages to parse docu‐
74 ments; they take a Relax NG grammar (in the compact syntax) as the com‐
75 mand line argument and read the XML from the standard input. For exam‐
76 ple, the following commands validate rnv.dbx against docbook.rnc:
77
78 perl rvp.pl docbook.rnc < rnv.dbx
79 python rvp.py docbook.rnc < rnv.dbx
80
81 The scripts are kept simple and unobscured to illustrate the technique,
82 rather than being designed as general-purpose modules. Programmers
83 using Perl, Python, Ruby and other languages are encouraged to imple‐
84 ment and share reusable RVP-based components for their languages of
85 choice.
86
87
89 http://sourceforge.net/projects/rnv/
90
91
93 Michael Simacek <msimacek@redhat.com>. This man page was made from the
94 readme written by RNV's author David Tolpin <dvd@davidashen.net>.
95
96
98 rnv(1), arx(1), xmllint(1), xmlstarlet(1), trang(1)
99
100
101
102
103 2013-8-12 RVP(1)