Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loosen model of nomenclature #52

Closed
tcatapano opened this issue Nov 23, 2021 · 5 comments
Closed

loosen model of nomenclature #52

tcatapano opened this issue Nov 23, 2021 · 5 comments

Comments

@tcatapano
Copy link
Member

tcatapano commented Nov 23, 2021

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
Copy link
Member Author

tcatapano commented Apr 24, 2022

implementing changes in branch issue52. Getting following errors:

  • xmllint:
Entity: line 1: parser error : xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected
 %nomenclature-model;
                     ^
Entity: line 1:
sec-meta?, label?, tp:taxon-name, tp:taxon-authority?, tp:taxon-status?, tp:taxo
^
Entity: line 1: parser error : Content error in the external subset
 %nomenclature-model;
                     ^
Entity: line 1:
sec-meta?, label?, tp:taxon-name, tp:taxon-authority?, tp:taxon-status?, tp:taxo

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
Copy link
Member Author

tcatapano commented Apr 24, 2022

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
Copy link
Member Author

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

tcatapano added a commit that referenced this issue Jan 30, 2023
tcatapano added a commit that referenced this issue Jan 30, 2023
@tcatapano
Copy link
Member Author

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
Copy link
Member Author

Implemented. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant