Hi

I am having problems with OM schemas, and need some help.

I am learning xerces-c with OM and as a result have to use the xsd
schemas from the OM web site, since AFAIK I can't use relax-ng with
xerces-c. When loading them in my program (called jetsomcd, attached,
it's a bit clunky and unfinished but I don't think I am doing anything
unusual... all it does is load a cd file, validate it, and print a
list of all symbols and their roles in a specific format - you probably
don't even need to look at it but it is here in case you want to) I
get the following errors


jetsomcd: reading schema from
http://www.openmath.org/standard/om20-2017-07-22/omcd2.xsd ...
Error at line 83 column 43 type 'xs:anyType' specified as the base in
simpleContent definition must not have complex content
Error at line 0 column 0 complex type '__AnonC4' violates the unique
particle attribution rule in its components 'CDComment' and 'CDComment'
jetsomcd: reading schema failed
terminate called after throwing an instance of
'xmlparser::initialisation_error'
Aborted


It seems there are errors in the xsd from the open math web site,
which therefore can't be loaded.  My program works fine without the
validation step.  I do not understand the details for xsd or relax-ng
and am a rank beginner in both but it seems there is a problem with
the OMI element in openmath2.xsd and also a problem with something
being repeated in CDComment in omcd2.xsd (my code doesn't identify
which file generates the error but I have verified this independently
by loading the schemas one at a time)

When I look at the code and OMI in particular I am puzzled for a
another reason as well: the "informal description" of the XML encoding
(in the OM standard) says hexadecimal is allowed for integers (the
example it gives as being allowed is <OMI> xA </OMI>) but I cannot see
how xA matches \s*(-\s?)?[0-9]+(\s[0-9]+)*\s* (from the relax-ng in
3.1.1) so if you could explain my misunderstanding I'd be grateful.

One further point concerning the standard: there is an omission in the
specification for binding (2.1.3).  The problem is that examples like

  binding(application(mysymbol,v),v,w,application(mybody,v,w))

(where v,w are variables) or in XML

<OMBIND>
  <OMA>
    <OMS name="mysymbol" cd="mycd"/>
    <OMV name="v"/>
  </OMA>
  <OMBVAR>
    <OMV name="v"/>
    <OMV name="w"/>
  </OMBVAR>
  <OMA>
    <OMS name="mybody" cd="mycd"/>
    <OMV name="v"/>
    <OMV name="w"/>
  </OMA>
<OMBIND>

are possible.  Obviously w is bound here. But since v occurs both in
the binder and the body the question is whether all occurrences of v
are bound or only occurrences in the last element of OMBIND.  I can
think of mathematical examples that suggest that the answer could go
either way.  Of course I have no idea what the above code actually
means.  That is not the point.  The point is the spec says that OM
objects must be equivalent under alpha conversion, I need to make sure
my code conforms to the spec, and I cannot even be sure what you mean by
alpha conversion because of this problem.

My guess is that variables in the binder are *not* bound in the
binding, but I have made guesses before :)

Thanks

Richard




On Fri, 2018-06-22 at 12:00 +0200, [email protected] wrote:
> Send Om mailing list submissions to
>       [email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       http://mailman.openmath.org/cgi-bin/mailman/listinfo/om
> or, via email, send a message with subject or body 'help' to
>       [email protected]
> 
> You can reach the person managing the list at
>       [email protected]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Om digest..."
> 
> 
> Today's Topics:
> 
>    1. Scientific software engineer position at the TBA group DIPF
>       (Frankfurt) (Paul Libbrecht)
>    2. CICM 2018, Call for Contributions to doctoral programme,
>       work-in-progress, posters, demos, tutorial (Serge Autexier)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Thu, 21 Jun 2018 18:44:34 +0200
> From: Paul Libbrecht <[email protected]>
> To: <[email protected]>
> Subject: [Om] Scientific software engineer position at the TBA group
>       DIPF (Frankfurt)
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear list,
> 
> our group has a job opening for a developer inclined to research the very 
> diverse IT-infrastructures where learning environments are with an eye to the 
> high expectations of standardised assessments.
> 
> Please consider spreading this announce.
> 
> thanks in advance.
> 
> Paul Libbrecht
> 
> - - -
> 
> The German Institute for International Educational Research (DIPF, 
> www.dipf.de)
> is a national centre for educational research and educational information; it
> is jointly funded by the federal government and the federal states. DIPF is
> a member of the Leibniz Association operating from locations in Frankfurt
> am Main and Berlin, with around 300 employees.
> 
> Become part of the research and service structure for ?Technology-Based
> Assessment (TBA). The TBA centre is an innovator in national and international
> research and application projects and a key player in digital assessment
> and education.
> 
> 
> The TBA centre develops solutions to administer technology-based assessments
> (e.g. tests, questionnaires) by means of heterogeneous infrastructures and
> assessment methods(e.g. online, offline, app-based, with or without test
> administrators, etc.). Additionally, the centre develops delivery systems
> incl. mechanisms for the results feedback and deployment. For further 
> developing
> our HTML5-based assessment software that supports various delivery 
> architectures
> the TBA centre is seeking to employ a
> 
>    **Scientific Software Engineer**
>    **(full time, limited until 31.12.2019, salary based on EG 13 TV-H*)**
> 
> for the location in Frankfurt am Main.
> 
> Your tasks:
> 
> -   Research and development of architectures and data models to
>     integrate assessment components into delivery architectures and ICT
>     infrastructures
> 
> -   Design based research to integrate assessment components into existing
>     deliveries based on existing assessment software or ICT infrastructure as
>     well as on national and international projects
> 
> -   Independent prototyping, planning, implementation and testing
>     (incl. writing documentation) of a modern delivery system for HTML5-based
>     assessment components into heterogeneous infrastructures
> 
> 
> -   Identification of further development needs of current learning technology
>     standards (e.g. LTI, QTI, SCORM, xAPI) with regard to the integration of
>     assessment components including their underlying data models
> 
> 
> -   Scientific publishing on the activities described above is desired and
>     is supported
> 
> 
> Requirements:
> 
> -   An excellent university degree in Computer Science (Master/diploma) or 
> related field
> -   Sound technical knowledge and relevant experience (at least 2 years) in 
> the
>     following technical areas:
>     o   WWW technologies (and protocols)
>     o   Data representation languages (at least JSON, ideally JSON schema and 
> XML schema)
>     o   Advanced web interoperability standards
>     o   Software development for mobile devices
>     o   A programming language for data manipulation (such as: R, Python
> 
> 
> Knowledge on programming languages such as Java or C# is a plus.
> 
> -   Knowledge of relevant JavaScript libraries  is desirable (e.g., ReactJS)
> -   Analytical skills, structured and independent working as well as 
> commitment,
>     high motivation and ability to work under pressure
> 
> -   Good knowledge of English (written and spoken)
> -   Ability for interdisciplinary and international collaboration, team 
> communication
>     and willingness to travel
> 
> We offer a demanding and challenging environment, a modern workplace, good
> conditions  for balancing work and family life (e.g. flexible working-hours 
> and
> home office options),  a pleasant work atmosphere and development perspectives
> (training opportunities).  Women are especially encouraged to apply. 
> Applicants will,
> in principle, be able  to work part-time provided that job-related 
> requirements are
> appropriately considered.  Equally qualified persons with disabilities will 
> be favoured.
> 
> Please submit your application and standard documents ? preferably in 
> electronic format
> in a single pdf file - quoting the reference number IZB 2018-11. The closing 
> date
> is 25.06.2018. Applications should be addressed to Dr. Paul Libbrecht,
> [email protected], PO Box 900270, 60442 Frankfurt am Main. You will find 
> general
> information on  the website of the TBA Centre (http://tba.dipf.de/). Any 
> further
> inquiry should be addressed to  Paul Libbrecht (069-24708-811), 
> [email protected].
> 
> *Labour agreement for public service in the state of Hessen
> 
> 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> <http://mailman.openmath.org/pipermail/om/attachments/20180621/df0ff741/attachment-0001.html>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: signature.asc
> Type: application/pgp-signature
> Size: 512 bytes
> Desc: OpenPGP digital signature
> URL: 
> <http://mailman.openmath.org/pipermail/om/attachments/20180621/df0ff741/attachment-0001.pgp>
> 
> ------------------------------
> 
> Message: 2
> Date: Fri, 22 Jun 2018 08:49:54 +0200
> From: Serge Autexier <[email protected]>
> To: <[email protected]>
> Cc: [email protected]
> Subject: [Om] CICM 2018, Call for Contributions to doctoral programme,
>       work-in-progress, posters, demos, tutorial
> Message-ID:
>       <20180622064954.d30f22dbc...@mbp-autexier.informatik.uni-bremen.de>
> Content-Type: text/plain; charset="UTF-8"
> 
>                              Call for Contributions
>       work-in-progress - posters - demos - tutorials - doctoral programme
>               11th Conference on Intelligent Computer Mathematics
>                                  - CICM 2018 - 
>                                August 13-17, 2018
>                             RISC, Hagenberg, Austria
>                     http://www.cicm-conference.org/2018
> 
> --------------------------------------------------------------------------------
> 
> CICM   focuses  on   theoretical  and   practical  solutions   for  
> mathematical
> applications such  as computation,  deduction, knowledge  management, 
> libraries,
> and user interfaces.
> 
> CICM 2018 will feature 3 invited speakers:
> 
> * Akiko Aizawa, National Institute of Informatics, University of Tokyo
> * Bruno Buchberger, Research Institute for Symbolic Computation, Johannes 
> Kepler
>   University
> * Adri Olde Daalhuis, University of Edinburgh
> 
> and 6 affiliated workshops:
> 
> * Computer Algebra in the age of Types
> * Computer Mathematics in Education - Enlightenment or Incantation
> * Formal Mathematics for Mathematicians
> * Formal Verification of Physical Systems
> * Mathematical Models and Mathematical Software as Research Data
> * OpenMath Workshop
> 
> In  addition to  the  above  and the  formally  reviewed  program, CICM  
> invites
> contributions of various forms:
> 
> 1) Work-in-progress papers (any length up  to 15 pages) will be lightly 
> reviewed
>    and, if  accepted, presented at the  conference and published in  a volume 
> of
>    CEUR-WS.
>    
> 2) Demos and  posters (submitted  as a  summary of  a few  paragraphs) will  
> be
>    presented  during a  dedicated  session.
>    Submission is  open to any topic  interesting to the CICM  audience.  We 
> also
>    encourage authors of accepted papers to  supplement their talk with a demo 
> or
>    poster.
> 
> 3) Tutorials (up to 60 minutes, submitted as a summary of a few paragraphs) 
> will
>    take place in individual rooms during a dedicated session.
> 
> 4) Doctoral  program submissions (2  page abstract +  CV) will be  presented 
> and
>    discussed during  a dedicated session  focusing on mentoring.
>    Submission is open to any doctoral student in the CICM area.  Student 
> authors
>    of  accepted papers  are strongly  encouraged to  additionally submit  to 
> the
>    doctoral program.
>    
>    Financial support for doctoral program participants is available.
> 
> 
> All submissions should be made via easychair at
> 
>               https://easychair.org/conferences/?conf=cicm2018
> 
> Notifications are sent on a rolling basis.
> 
> The last day to submit is July 15.
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> Om mailing list
> [email protected]
> http://mailman.openmath.org/cgi-bin/mailman/listinfo/om
> 
> 
> End of Om Digest, Vol 144, Issue 6
> **********************************

// jetsomcd utility program .. parse and validate a CD and print a jetsom sequence of symbols

#include <iostream>
#include <string>
#include <stdexcept>
#include <fstream>
#include <unistd.h>

#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMDocumentType.hpp>
#include <xercesc/dom/DOMElement.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMImplementationLS.hpp>
#include <xercesc/dom/DOMNodeIterator.hpp>
#include <xercesc/dom/DOMNodeList.hpp>
#include <xercesc/dom/DOMText.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/framework/LocalFileInputSource.hpp>
#include <xercesc/sax/ErrorHandler.hpp>
#include <xercesc/sax/SAXParseException.hpp>
#include <xercesc/validators/common/Grammar.hpp>

using namespace xercesc;

class writeString {
private:
  XMLCh*  wStr;
  
public:
  writeString(const char* str) {
    wStr = XMLString::transcode(str);
  }
  
  ~writeString() {
    XMLString::release(&wStr);
  }
 
  operator const XMLCh*() const {
    return wStr;
  }
};

class ParserErrorHandler : public ErrorHandler {
private:
  
  void reportParseException(const SAXParseException& ex) {
    char* msg = XMLString::transcode(ex.getMessage());
    std::cerr << "Error at line " << ex.getLineNumber() << " column "
	      <<  ex.getColumnNumber() << " " << msg << std::endl;
    XMLString::release(&msg);
  }
 
public:
  
  void warning(const SAXParseException& ex) {
    reportParseException(ex);
  }
 
  void error(const SAXParseException& ex) {
    reportParseException(ex);
  }
 
  void fatalError(const SAXParseException& ex) {
    reportParseException(ex);
  }
 
  void resetErrors() { }
};

char const * schemadoc = 0; // will be set in main()
bool dontvalidate = false;

class xmlparser {
private:
  
  xercesc::XercesDOMParser *xmlFileParser;
  ParserErrorHandler parserErrorHandler;
  
public:

  class initialisation_error { };
  class parse_error { };
  
  xmlparser() {
    xmlFileParser = 0;
    try {
      xmlFileParser = new xercesc::XercesDOMParser();
      xmlFileParser->setDoNamespaces( true );
      if (!dontvalidate) xmlFileParser->setDoSchema( true );
      xmlFileParser->setValidationScheme( xercesc::XercesDOMParser::Val_Auto );
      xmlFileParser->setDoXInclude( true );
      if (!dontvalidate) xmlFileParser->setValidationSchemaFullChecking(true); 
      if (!dontvalidate) xmlFileParser->setValidationConstraintFatal(true); 
      xmlFileParser->setErrorHandler(&parserErrorHandler);
      
      if (!dontvalidate) {
	std::cerr << "jetsomcd: reading schema from " << schemadoc << " ..." << std::endl;
	if (!xmlFileParser->loadGrammar(schemadoc, Grammar::SchemaGrammarType, true)) {
	  std::cerr << "jetsomcd: reading schema failed" << std::endl;
	  throw initialisation_error();
	}
	// std::cerr << "jetsomcd: reading schema OK" << std::endl;
      }
      /* help please!  this is what I get..

$ ./jetsomcd -w ../cd/badgeneric.ocd "#generic" >test
jetsomcd: reading schema from http://www.openmath.org/standard/om20-2017-07-22/omcd2.xsd ...
Error at line 83 column 43 type 'xs:anyType' specified as the base in simpleContent definition must not have complex content
Error at line 0 column 0 complex type '__AnonC4' violates the unique particle attribution rule in its components 'CDComment' and 'CDComment'
jetsomcd: reading schema failed
terminate called after throwing an instance of 'xmlparser::initialisation_error'
Aborted

      */
    }
    catch( xercesc::XMLException& e ) {
      char* message = xercesc::XMLString::transcode( e.getMessage() );
      std::cerr << "XML initialization error: " << message << std::endl;
      xercesc::XMLString::release( &message );
      throw initialisation_error();
    }
  }
  
  ~xmlparser() {
    // Terminate Xerces
    try {
      if (xmlFileParser) delete xmlFileParser;
      xercesc::XMLPlatformUtils::Terminate();  // Terminate after release of memory
    }
    catch( xercesc::XMLException& e ) {
      char* message = xercesc::XMLString::transcode( e.getMessage() );    
      std::cerr << "XML error: " << message << std::endl;
      xercesc::XMLString::release( &message );
    }
  }

  /* Reads an xml file given by URL or filename and returns the 
   * DOM as a pointer.  Since the DOM is owned by the parser
   * there is no need to free the memory used. */
  xercesc::DOMDocument* read_xml_file( char * const f ) {
    
    try {
      
      xmlFileParser->parse( f );      
      // no need to free this pointer - owned by the parent parser object
      xercesc::DOMDocument* xmlDoc = xmlFileParser->getDocument();
      std::cerr << "jetsomcd: " << xmlFileParser->getErrorCount()
		<< " error(s)" << std::endl;
      return xmlDoc;      
      
    } catch( xercesc::XMLException& e ) {
      
      char* message = xercesc::XMLString::transcode( e.getMessage() );
      std::cerr << "Error parsing file: " << message << std::endl;
      xercesc::XMLString::release( &message );
      throw parse_error();
      
    }
  }

};

const char * defcdname = "unnamed";
char * cdname = 0;
char * cdbase = 0;
char * cdurl = 0;
char * cdreviewdate = 0;
char * cdstatus = 0;
char * cddate = 0;
char * cdversion = 0;
char * cdrevision = 0;

XMLCh* nametag = 0;
XMLCh* roletag = 0;
XMLCh* cdnametag = 0;
XMLCh* cdbasetag = 0;
XMLCh* cdurltag = 0;
XMLCh* cdreviewdatetag = 0;
XMLCh* cdstatustag = 0;
XMLCh* cddatetag = 0;
XMLCh* cdversiontag = 0;
XMLCh* cdrevisiontag = 0;
XMLCh* cddefinitiontag = 0;

const char* bindertag = "binder";
const char* attributiontag = "attribution";
const char* semantictag = "semantic-attribution";
const char* errortag = "error";
const char* applicationtag = "application"; 
const char* constanttag = "constant"; 

char * get_text( DOMElement* currentElement ) {
  char* t;
  t = XMLString::transcode( currentElement->getTextContent() );
  // std::cerr << "Text: " << t << std::endl;
  return t;
}

void make_symbol( DOMElement* element ) {
  char * name = 0;
  char * role = 0;
  int introle = 6;
  DOMNodeList* children = element->getChildNodes();
  const XMLSize_t nodeCount = children->getLength();
  for ( XMLSize_t cindex=0; cindex<nodeCount; cindex++ ) {
    DOMNode* currentNode = children->item(cindex);
    auto currentNodeType = currentNode->getNodeType();
    if ( currentNodeType==DOMNode::ELEMENT_NODE ) {
      
      DOMElement* currentElement = dynamic_cast< DOMElement* >(currentNode);
      auto currentElementName = currentElement->getTagName();
      // std::cout << "  ; scanning " << XMLString::transcode(currentElementName) << std::endl;
      if ( XMLString::equals(currentElementName, nametag) ) {
	if (name) {
	  std::cerr << "Warning: multiply defined name in definition\n";
	  XMLString::release(&name);
	}
	name = get_text( currentElement );
      }
      if ( XMLString::equals(currentElementName, roletag) ) {
	if (role) {
	  std::cerr << "Warning: multiply defined role in definition\n";
	  XMLString::release(&role);
	}
	role = get_text( currentElement );
	if ( XMLString::equals(role, bindertag) ) { introle = 0; }
	if ( XMLString::equals(role, attributiontag) ) { introle = 1; }
	if ( XMLString::equals(role, semantictag) ) { introle = 2; }
	if ( XMLString::equals(role, errortag) ) { introle = 3; }
	if ( XMLString::equals(role, applicationtag) ) { introle = 4; }
	if ( XMLString::equals(role, constanttag) ) { introle = 5; }
      }

    }
  }

  if (!name) {
    std::cerr << "Error: missing name in definition\n";
    return;
  }    
  std::cout << "  $" << name << "[";
  switch (introle) {
  case 0: std::cout << "bind"; break;
  case 1: std::cout << "attr"; break;
  case 2: std::cout << "sem"; break;
  case 3: std::cout << "err"; break;
  case 4: std::cout << "appl"; break;
  case 5: std::cout << "const"; break;
  case 6:
  default: std::cout << "none"; break;
  }
  if (cdname==0) std::cout << "|" << defcdname ; else std::cout << "|" << cdname ;
  if (cdbase!=0) std::cout << "|" << cdbase ;
  std::cout << "]" << std::endl;
  if (name) XMLString::release(&name);
  if (role) XMLString::release(&role);
}
		   
void process(char* cdfile, char* aspath=0) {

  xercesc::XMLPlatformUtils::Initialize();  // Initialize Xerces infrastructure
  xmlparser xp;
  xercesc::DOMDocument* cddoc;
  std::cerr << "jetsomcd: reading CD at " << cdfile << std::endl;
  try { cddoc = xp.read_xml_file(cdfile); }
  catch (xmlparser::parse_error) { return; }
  std::cerr << "jetsomcd: document read";
  if (aspath !=0) std::cerr << ", writing symbols to " << aspath;
  std::cerr << std::endl;

  std::cout << "; output from jetsomcd on CD " << cdfile << std::endl;
  if (aspath != 0) {
    std::cout << "{" << aspath << "{" << std::endl;
  }
  
  // scan CD and print a list of symbols from if in native JetsOM format  
  nametag = XMLString::transcode("Name");
  roletag = XMLString::transcode("Role");
  cdnametag = XMLString::transcode("CDName");
  cdbasetag = XMLString::transcode("CDBase");
  cdurltag = XMLString::transcode("CDURL");
  cdreviewdatetag = XMLString::transcode("CDReviewDate");
  cdstatustag = XMLString::transcode("CDStatus");
  cddatetag = XMLString::transcode("CDDate");
  cdversiontag = XMLString::transcode("CDVersion");
  cdrevisiontag = XMLString::transcode("CDRevision");
  cddefinitiontag = XMLString::transcode("CDDefinition");
 
  DOMElement* elementroot = cddoc->getDocumentElement();
  if (!elementroot) throw std::runtime_error("empty document!");
  DOMNodeList* children = elementroot->getChildNodes();
  const XMLSize_t nodeCount = children->getLength();

  for ( XMLSize_t cindex=0; cindex<nodeCount; cindex++ ) {
    DOMNode* currentNode = children->item(cindex);
    auto currentNodeType = currentNode->getNodeType();
    if ( currentNodeType==DOMNode::ELEMENT_NODE ) {
      DOMElement* currentElement = dynamic_cast< DOMElement* >(currentNode);
      auto currentElementName = currentElement->getTagName();
      // std::cout << "  ; scanning " << XMLString::transcode(currentElementName) << std::endl;
      if ( XMLString::equals(currentElementName, cdnametag) ) {
	cdname = get_text( currentElement );
	std::cout << "  ; cdname = " << cdname << std::endl;
      }
      else if ( XMLString::equals(currentElementName, cdbasetag) ){
	cdbase = get_text( currentElement );
	std::cout << "  ; cdbase = " << cdbase << std::endl;
      }
      else if ( XMLString::equals(currentElementName, cdurltag) ){
	cdurl = get_text( currentElement );
	std::cout << "  ; cdurl = " << cdurl << std::endl;
      }
      else if ( XMLString::equals(currentElementName, cdreviewdatetag) ){
	cdreviewdate = get_text( currentElement );
	std::cout << "  ; cdreviewdate = " << cdreviewdate << std::endl;
      }
      else if ( XMLString::equals(currentElementName, cdstatustag) ){
	cdstatus = get_text( currentElement );
	std::cout << "  ; cdstatus = " << cdstatus << std::endl;
      }
      else if ( XMLString::equals(currentElementName, cddatetag) ){
	cddate = get_text( currentElement );
	std::cout << "  ; cddate = " << cddate << std::endl;
      }
      else if ( XMLString::equals(currentElementName, cdversiontag) ){
	cdversion = get_text( currentElement );
	std::cout << "  ; cdversion = " << cdversion << std::endl;
      }
      else if ( XMLString::equals(currentElementName, cdrevisiontag) ){
	cdrevision = get_text( currentElement );
	std::cout << "  ; cdrevision = " << cdrevision << std::endl;
      }
      else if ( XMLString::equals(currentElementName, cddefinitiontag) ){
	make_symbol(currentElement);
      }
      
    }
  }
    
  if (nametag) XMLString::release(&nametag);
  if (roletag) XMLString::release(&roletag);
  if (cdnametag) XMLString::release(&cdnametag);
  if (cdbasetag) XMLString::release(&cdbasetag);
  if (cdurltag) XMLString::release(&cdurltag);
  if (cdreviewdatetag) XMLString::release(&cdreviewdatetag);
  if (cdstatustag) XMLString::release(&cdstatustag);
  if (cddatetag) XMLString::release(&cddatetag);
  if (cdversiontag) XMLString::release(&cdversiontag);
  if (cdrevisiontag) XMLString::release(&cdrevisiontag);
  if (cddefinitiontag) XMLString::release(&cddefinitiontag);
  if (cdname) XMLString::release(&cdname);
  if (cdbase) XMLString::release(&cdbase);
  if (cdurl) XMLString::release(&cdurl);
  if (cdreviewdate) XMLString::release(&cdreviewdate);
  if (cdstatus) XMLString::release(&cdstatus);
  if (cddate) XMLString::release(&cddate);
  if (cdversion) XMLString::release(&cdversion);
  if (cdrevision) XMLString::release(&cdrevision);
    
  if (aspath != 0) {
    std::cout << "}}" << std::endl;
  }
}

char *optarg;
int optind, opterr, optopt;

int main(int argc, char *argv[]) {
  int c;
  schemadoc = "http://www.openmath.org/standard/om20-2017-07-22/omcd2.xsd";; // default
  
  while( (c = getopt(argc, argv, "?hvdlws:")) != -1 ) {
    switch (c) {
      
    case 'l': schemadoc = "omcd2.xsd"; break; 
    case 'w': schemadoc = "http://www.openmath.org/standard/om20-2017-07-22/omcd2.xsd";; break; 
    case 's': schemadoc = optarg; break; 
    case 'v': dontvalidate = false; break; 
    case 'd': dontvalidate = true; break; 
      
    case 'h':
    case '?':
    default:
      std::cerr << "JetsOM CD tool\n";
      std::cerr << "usage: jetsomcd [options] file-or-url [jetsom-path-to-aliasspace] >file\n";
      std::cerr << "  -v        : validate against schema (default)\n";
      std::cerr << "  -d        : don't validate against schema\n";
      std::cerr << "  -l        : use local copy (omcd2.xsd openmath2.xsd in current directory)\n";
      std::cerr << "  -w        : use internet copy of schema (from http://www.openmath.org/)\n";
      std::cerr << "  -s schema : use this schema instead\n";
      return 0;

    }
  }
  
  if (argc==optind || argc>optind+2) {
    std::cerr << "usage: jetsomcd [options] file-or-url [path-to-aliasspace] >file\n";
    return 0;
  }
  if (argc==optind+1) { process(argv[optind]); }
  else { process(argv[optind], argv[optind+1]); }   
  return 0;
}

_______________________________________________
Om mailing list
[email protected]
http://mailman.openmath.org/cgi-bin/mailman/listinfo/om

Reply via email to