Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:thomas-schraitle
rnv
reference.xml
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File reference.xml of Package rnv
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.docbook.org/xml/4.4/docbookx.dtd"> <reference lang="en"> <referenceinfo> <authorgroup> <author> <firstname>David</firstname> <surname>Tolpin</surname> <contrib>Developer</contrib> </author> <author> <firstname>Thomas</firstname> <surname>Schraitle</surname> <contrib>Manpage</contrib> </author> </authorgroup> </referenceinfo> <title>Reference Manual for RNV Tools</title> <refentry id="rnv"> <refentryinfo> <productname>rnv</productname> </refentryinfo> <refmeta> <refentrytitle>rnv</refentrytitle> <manvolnum>1</manvolnum> <refmiscinfo class="version">1.7.9</refmiscinfo> <refmiscinfo class="source">http://www.davidashen.net/rnv.html</refmiscinfo> <refmiscinfo class="manual" >/usr/share/doc/packages/rnv/readme.txt</refmiscinfo> </refmeta> <refnamediv> <refname>rnv</refname> <refpurpose>RELAX NG Compact Syntax Validator in C</refpurpose> </refnamediv> <refsynopsisdiv> <title>Synopsis</title> <cmdsynopsis><command>rnv</command> <group choice="req"> <arg choice="plain">-q</arg> <arg choice="plain">-p</arg> <arg choice="plain">-c</arg> <arg choice="plain">-s</arg> <arg choice="plain">-v</arg> <arg choice="plain">-h</arg> </group> <arg choice="plain">grammar.rnc</arg> <arg choice="plain">document.xml</arg> </cmdsynopsis> <para>The options are:</para> <variablelist> <varlistentry> <term><option>-q</option></term> <listitem> <para> names of files being processed are not printed; in error messages, expected elements and attributes are not listed;</para> </listitem> </varlistentry> <varlistentry> <term><option>-n</option> <replaceable>NUM</replaceable></term> <listitem> <para>sets the maximum number of reported expected elements and attributes, <option>-q</option> sets this to 0 and can be overriden;</para> </listitem> </varlistentry> <varlistentry> <term><option>-p</option></term> <listitem> <para>copies the input to the output;</para> </listitem> </varlistentry> <varlistentry> <term><option>-c</option></term> <listitem> <para>if the only argument is a grammar, checks the grammar and exits;</para> </listitem> </varlistentry> <varlistentry> <term><option>-s</option></term> <listitem> <para>uses less memory and runs slower;</para> </listitem> </varlistentry> <varlistentry> <term><option>-v</option></term> <listitem> <para>prints version number;</para> </listitem> </varlistentry> <varlistentry> <term><option>-h</option></term> <listitem> <para>displays usage summary and exits.</para> </listitem> </varlistentry> </variablelist> </refsynopsisdiv> <refsect1> <title>Limitations</title> <para>This tool has the following limitations:</para> <itemizedlist> <listitem> <para>RNV assumes that the encoding of the syntax file is UTF-8.</para> </listitem> <listitem> <para>Support for <citetitle>XML Schema Part 2: Datatypes</citetitle> is partial.</para> </listitem> <listitem> <para>The schema parser does not check that all restrictions are obeyed, in particular, restrictions 7.3 and 7.4 are not checked.</para> </listitem> <listitem> <para>RNV for Win32 platforms is a Unix program compiled on Win32. It expects file paths to be written with normal slashes; if a schema is in a different directory and includes or refers external files, then the schema's path must be written in the Unix way for the relative paths to work. For example, under Windows, <command>rnv</command> that uses <filename>..\schema\docbook.rnc</filename> to validate <filename>userguide.dbx</filename> should be invoked as</para> <screen><command>rnv.exe</command> ../schema/docbook.rnc userguide.dbx</screen> </listitem> </itemizedlist> </refsect1> </refentry> <refentry id="arx"> <refentryinfo> <productname>arx</productname> </refentryinfo> <refmeta> <refentrytitle>arx</refentrytitle> <manvolnum>1</manvolnum> <refmiscinfo class="version">1.7.9</refmiscinfo> <refmiscinfo class="source">http://www.davidashen.net/rnv.html</refmiscinfo> <refmiscinfo class="manual" >/usr/share/doc/packages/rnv/readme.txt</refmiscinfo> </refmeta> <refnamediv> <refname>arx</refname> <refpurpose>Automatically determine the type of a document from its name and contents</refpurpose> </refnamediv> <refsynopsisdiv> <title>Synopsis</title> <cmdsynopsis><command>arx</command> <group choice="req"> <arg choice="plain">-n</arg> <arg choice="plain">-v</arg> <arg choice="plain">-h</arg> </group> <arg choice="plain">document.xml</arg> <arg choice="plain">arx.conf</arg> <arg choice="req">arx.conf</arg> </cmdsynopsis> <para>ARX either prints a string corresponding to the document's type or nothing if the type cannot be determined. The options are:</para> <variablelist> <varlistentry> <term><option>-n</option></term> <listitem> <para>turns off prepending base path of the configuration file to the result, even if it looks like a relative path (useful when the configuration file and the grammars are in separate directories, or for association with something that is not a file);</para> </listitem> </varlistentry> <varlistentry> <term><option>-v</option></term> <listitem> <para>prints version number;</para> </listitem> </varlistentry> <varlistentry> <term><option>-h</option></term> <listitem> <para>displays usage summary and exits.</para> </listitem> </varlistentry> </variablelist> </refsynopsisdiv> <refsect1> <title>The Configuration File</title> <para>The configuration file must conform to the following grammar:</para> <screen>arx = grammars route* grammars = "grammars" "{" type2string+ "}" type2string = type "=" literal type = nmtoken route = match|nomatch|valid|invalid match = "=~" regexp "=>" type nomatch = "!~" regexp "=>" type valid = "valid" "{" rng "}" "=>" type invalid = "!valid" "{" rng "}" "=>" type literal=string in '"', '"' inside must be prepended by '\' regexp=string in '/', '/' inside must be prepended by '\' rng=Relax NG Compact Syntax Comments start with # and continue till the end of line.</screen> <para>Rules are processed sequentially, the first matching rule determines the file's type. RELAX NG templates are matched against file contents, regular expressions are applied to file names. The sample below associates documents with grammars for XSLT, DocBook or XSL FO.</para> <screen>grammars { docbook="docbook.rnc" xslt="xslt.rnc" xslfo="fo.rnc" } valid { start = element (book|article|chapter|reference) {any} any = (element * {any}|attribute * {text}|text)* } => docbook !valid { default namespace xsl = "http://www.w3.org/1999/XSL/Transform" start = element *-xsl:* {not-xsl} not-xsl = (element *-xsl:* {not-xsl}|attribute * {text}|text)* } => xslt =~/.*\.xsl/ => xslt =~/.*\.fo/ => xslfo</screen> <para>ARX can also be used to link documents to any type of information or processing.</para> </refsect1> </refentry> <refentry id="rvp"> <refentryinfo> <productname>rvp</productname> </refentryinfo> <refmeta> <refentrytitle>rvp</refentrytitle> <manvolnum>1</manvolnum> <refmiscinfo class="version">1.7.9</refmiscinfo> <refmiscinfo class="source">http://www.davidashen.net/rnv.html</refmiscinfo> <refmiscinfo class="manual" >/usr/share/doc/packages/rnv/readme.txt</refmiscinfo> </refmeta> <refnamediv> <refname>rvp</refname> <refpurpose>RELAX NG Validation Pipe</refpurpose> </refnamediv> <refsynopsisdiv> <title>Synopsis</title> <cmdsynopsis><command>rvp</command> <group choice="req"> <arg choice="plain">-q</arg> <arg choice="plain">-s</arg> <arg choice="plain">-v</arg> <arg choice="plain">-h</arg> </group> <arg choice="plain">grammar.rnc</arg> </cmdsynopsis> <para></para> <para>The options are:</para> <variablelist> <varlistentry> <term><option>-q</option></term> <listitem> <para>returns only error numbers, suppresses messages;</para> </listitem> </varlistentry> <varlistentry> <term><option>-s</option></term> <listitem> <para>uses less memory and runs slower;</para> </listitem> </varlistentry> <varlistentry> <term><option>-v</option></term> <listitem> <para>prints version number;</para> </listitem> </varlistentry> <varlistentry> <term><option>-h</option></term> <listitem> <para>displays usage summary and exits.</para> </listitem> </varlistentry> </variablelist> </refsynopsisdiv> <refsect1> <title>RELAX NG Validation Pipe</title> <para>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:</para> <screen>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" . </screen> <itemizedlist> <listitem> <para>RVP assumes that the last colon in a name separates the local part from the namespace URI (it is what one gets if specifies <token>:</token> as namespace separator to Expat).</para> </listitem> <listitem> <para>Error codes can be grabbed from <command>rvp</command> sources by <command>grep</command> _ER_ <filename>*.h</filename> and OR-ing them with corresponding masks from <filename>erbit.h</filename>. Additionally, error 0 is the protocol format error.</para> </listitem> <listitem> <para>Either er or error responses are returned, not both; <option>-q</option> chooses between concise and verbose forms (invocation syntax described later).</para> </listitem> <listitem> <para>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.</para> </listitem> <listitem> <para>quit is not opposite of start; instead, it quits RVP.</para> </listitem> </itemizedlist> <para>To assist embedding RVP, samples in Perl (<filename>tools/rvp.pl</filename>) and Python (<filename>tools/rvp.py</filename>) 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 <filename>rnv.dbx</filename> against <filename>docbook.rnc</filename>:</para> <screen>perl rvp.pl docbook.rnc < rnv.dbx python rvp.py docbook.rnc < rnv.dbx</screen> <para>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.</para> </refsect1> </refentry> </reference>
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor