arx man page

arx — automatically determines the type of an XML document

Synopsis

arx [Options] document.xml {config_file.conf ...}

Description

ARX is a tool to automatically determine the type of a document from its name and contents. It is inspired by James Clark's schema location approach for nXML.

Options

ARX either prints a string corresponding to the document's type or nothing if the type cannot be determined. You can specify configuration files to override defaults in /etc/arx.conf. The options are:

-n
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)
-v
prints current version
-h
displays usage summary and exits

Files

/etc/rnv/arx.conf

The configuration file must conform to the following grammar:
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.

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.

Examples

The sample configuration below associates documents with grammars for XSLT, DocBook or XSL FO.

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

Homepage

http://sourceforge.net/projects/rnv/

Author

Michael Simacek <msimacek@redhat.com>. This man page was made from the readme written by RNV's author David Tolpin <dvd@davidashen.net>.

See Also

rnv(1), rvp(1), xmllint(1), xmlstarlet(1), trang(1)

Referenced By

rvp(1).

2013-8-12