The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

nexvl.pl - Command-line NeXML validation script

SYNOPSIS

 $ ./nexvl.pl my-nex.xml her-nex.xml our-nex.xml
 -or if that doesn't work-
 $ perl nexvl.pl my-nex.xml her-nex.xml our-nex.xml

 $ ./nexvl.pl -q 01_basic.xml Fang_2003.xml
 01_basic.xml : Success!
 Fang_2003.xml : FAIL
 
 $ if (./nexvl.pl -Q Fang_2003.xml) ;
 > then echo Excellent\!
 > else echo Gnarly\!
 > fi
 Gnarly!

 $ ./nexvl.pl -v 01_basic.xml
 01_basic.xml : Success!
 --messages--
  debug: created helper objects
  debug: going to read file '01_basic.xml'
  debug: reading from handle
  debug: created temporary file '/tmp/_0sNAnwOGL'
  debug: copied uploaded data to '/tmp/_0sNAnwOGL'
  debug: read file '01_basic.xml', copied contents to '/tmp/_
  debug: created java validator invocation
  info : executing java validator
  info : executing perl validator
  [ and many, many more... ]
  debug: set char: '0' (line 85)
  debug: processed <nex:nexml/> (line 86)
  info : Processed nexml element (line 86)
  info : validation succeeded
 --end messages--

 $ ./nexvl.pl -V 01_basic.xml
 01_basic.xml : Success!
 --messages--
  debug: created helper objects
  debug: going to read file '01_basic.xml'
  [...]
  info : Processed nexml element (line 86)
  info : validation succeeded
 --end messages--
 --submitted--
 1       <nex:nexml generator="Bio::Phylo::Project v.0.17_RC9_841" version="0.8" xmlns="http://www.nexml.org/1.0" xmlns:nex="http://www.nexml.org/1.0" xmlns:rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns" xmlns:xml="http://www.w3.org/XML/1 98/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaL cation="http://www.nexml.org/1.0 http://www.nexml.org/1.0/nexml.xsd">
 2       <otus id="otus1">
 3       <otu id="otu2" label="otuA"/>
 4       <otu id="otu3" label="otuB"/>
 5       <otu id="otu4" label="otuC"/>
 6       <otu id="otu5" label="otuD"/>
 7       <otu id="otu6" label="otuE"/>
 8       <otu id="otu7" label="otuF"/>
 9       </otus>
 10      [...]
 [...]
 85      </characters>
 86      </nex:nexml>
 --end submitted--

DESCRIPTION

nexvl.pl will send your NeXML files off to Rutger Vos' web validator at http://nexml.org/nexml/validator.cgi, and parse the response, returning success or fail results for each file, and if desired, the detailed comments the validator makes on each file. The script strips all HTML tags and decodes HTML entities before output.

The validator returns the following comment types (in order of decreasing severity): fatal, error, warning, info, and debug. Command line options are available to control comment verbosity; see the OPTIONS section.

Comments always welcome; see the AUTHOR section.

OPTIONS

The default behavior is to return validator comments if a file fails validation, and a simple success message if it succeeds. Valid options are as follows:

 -v : verbose - return all validator comments, regardless of 
      success/fail
 -V : very verbose - return all validator comments, plus the 
      validator's echo of the NeXML file you sent
 -q : quiet - return only success/fail message
 -Q : very quiet - return 0 on success for all files, 1 on failure 
      of any file
 -[n], where n is [1|2|3|4|5]
    : return validator comments of decreasing severity, 
      from -1 (only fatal exceptions) to -5 (same as -v)

AUTHOR - Mark Jensen

Email maj@fortinbras.us