plazi / TaxPub

TaxPub Extension of the Journal Publishing Tag Set NISO JATS Version 1.1 (ANSI/NISO Z39.96-2015)
MIT License
12 stars 5 forks source link

loosen model of nomenclature #52

Closed tcatapano closed 1 year ago

tcatapano commented 3 years ago

xmllint and xmlstar (i.e., libxml) throw "non-deterministic" error:

validity error : Content model of nomenclature is not deterministic:
 (sec-meta? , label? , tp:taxon-name , x? , tp:taxon-authority? , x? , 
tp:taxon-status? , x? , 
tp:taxon-identifier* , xref* , x? , tp:nomenclature-citation-list* , x? , 
(tp:type-genus | tp:type-species)? , x? , tp:taxon-type-location? , x?)

Also, the strictness of the model is impeding conversion from GGXML instances and for retrospective encoding in general, which is becoming the primary use case.

Besides, the x thing is nuts

tcatapano commented 2 years ago

implementing changes in branch issue52. Getting following errors:

Could not parse DTD tax-treatment-NS0-v1.dtd


* xerces:

A '(' character or an element type is required in the declaration of element type "tp:element-nomenclature".

MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN

tcatapano commented 2 years ago

All this probably has to do with the constraints being imposed. The goal is:

optional sec-meta and label then at least one taxon-name and zero or more #PCDATA, tp:taxon-authority, tp:taxon-status, xref, tp:nomenclature-citation-list, tp:type-genus, tp:type-species, tp:taxon-type-location, or x

or better yet:

mix of of #PCDATA, optional tp:taxon-authority, an optional tp:taxon-status?, zero or more xref, zero or more tp:nomenclature-citation-list, optionally either one of tp:type-genus or tp:type-species, an optional tp:taxon-type-location?, or zero or more x

just have to figure out a way to express the model in an acceptable way to xerces and libxml...

tcatapano commented 1 year ago

For <mixed-nomenclature> : punt on defining any requirements and just make a mixed model with available tp: namespaced elements:

tcatapano commented 1 year ago

Implemented a VERY loose mixed-nomenclature which allows zero or more PCDATA and the nomenclature children in any order. This does not enforce, for example, the requirement of a mandatory single taxon-name and allows both type-species and type-genus to exist in the same nomenclature section. However, it is minimally feasible and could be refined further.

tcatapano commented 1 year ago

Implemented. Closing.