-
Notifications
You must be signed in to change notification settings - Fork 88
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
add <constraintDecl>
#2594
Open
sydb
wants to merge
6
commits into
dev
Choose a base branch
from
sydb_issue_230_constraintDecl
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
add <constraintDecl>
#2594
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
66f7ea3
Start of first crack, NOT READY for prime-
sydb 94ea0d3
Merge in latest from dev
sydb 96b051b
First crack at new constraintDecl element in
sydb 8d39266
Add “only 1 constraintDecl per scheme” constraint
sydb b7fd3e9
Update TEI-to-tei_customization.xslt to handle new
sydb b43f4df
Bug (noticed by @raffazizzi) fix: allow 0+ anyElement content of cons…
sydb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- © TEI Consortium. Dual-licensed under CC-by and BSD2 licenses; see the file COPYING.txt for details. --> | ||
<?xml-model href="https://jenkins.tei-c.org/job/TEIP5-dev/lastSuccessfulBuild/artifact/P5/release/xml/tei/odd/p5.nvdl" type="application/xml" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?> | ||
<elementSpec xmlns="http://www.tei-c.org/ns/1.0" xmlns:sch="http://purl.oclc.org/dsdl/schematron" module="tagdocs" ident="constraintDecl"> | ||
<gloss versionDate="2023-03-09" xml:lang="en">constraint declaration</gloss> | ||
<desc versionDate="2023-03-09" xml:lang="en">contains declarations pertaining to formal constraints expressed elsewhere in <gi>constraintSpec</gi> elements</desc> | ||
<classes> | ||
<memberOf key="att.global"/> | ||
<memberOf key="model.encodingDescPart"/> | ||
<!-- <constraintDecl> is part of content of <schemaSpec> directly, not via a class --> | ||
</classes> | ||
<content> | ||
<sequence> | ||
<alternate minOccurs="0" maxOccurs="unbounded"> | ||
<classRef key="model.identEquiv"/> | ||
<classRef key="model.descLike"/> | ||
</alternate> | ||
<anyElement minOccurs="0" maxOccurs="unbounded"/> <!-- typically <sch:ns> elements --> | ||
</sequence> | ||
</content> | ||
<constraintSpec scheme="schematron" ident="one-constraintDecl-per-scheme"> | ||
<!-- Note: the “not a descendant of <egXML>” predicate on the | ||
XPath defining $schemes is required for the P5 build process, | ||
not for normal users. (In P5 build validity of <egXML>s are | ||
tested by changing their namespace to TEI, so the tei: prefix | ||
is not sufficient.) —Syd, 2024-09-19 --> | ||
<constraint> | ||
<sch:rule context="/*[ count( //tei:constraintDecl ) gt 1 ]"> | ||
<sch:let name="schemes" value="//tei:constraintDecl[ not(ancestor::*[local-name(.) eq 'egXML'] ) ]/@scheme"/> | ||
<sch:let name="disctinct_schemes" value="distinct-values( $schemes )"/> | ||
<sch:assert test="count( $schemes ) eq count( $disctinct_schemes )"> | ||
Each <constraintDecl> element should have a @scheme attribute that is distinct from that of all the other <constraintDecl>s. | ||
</sch:assert> | ||
</sch:rule> | ||
</constraint> | ||
</constraintSpec> | ||
<attList> | ||
<attDef ident="scheme" usage="req"> | ||
<desc versionDate="2023-03-09" xml:lang="en">supplies the name of the language to which the declarations herein apply</desc> | ||
<datatype><dataRef key="teidata.enumerated"/></datatype> | ||
<valList type="semi"> | ||
<valItem ident="schematron"> | ||
<gloss versionDate="2016-09-27" xml:lang="en">ISO Schematron</gloss> | ||
</valItem> | ||
</valList> | ||
<remarks versionDate="2023-03-09" xml:lang="en"> | ||
<p>The declarations contained in a particular | ||
<gi>constraintDecl</gi> (including <att>queryBinding</att>, if | ||
present) apply to the <gi>constraintSpec</gi> elements whose | ||
<att>scheme</att> matches the <att>scheme</att> of the | ||
<gi>constraintDecl</gi>.</p> | ||
</remarks> | ||
</attDef> | ||
<attDef ident="queryBinding" usage="rec"> | ||
<gloss xml:lang="en" versionDate="2023-03-09">query language binding</gloss> | ||
<desc xml:lang="en" versionDate="2023-03-09">specifies the query | ||
language binding for rule-based schema expressions in | ||
<gi>constraintSpec</gi> elements that have a matching | ||
<att>scheme</att> attribute</desc> | ||
<datatype><dataRef key="teidata.enumerated"/></datatype> | ||
<valList type="semi"> | ||
<valItem ident="exslt"/> | ||
<valItem ident="stx"/> | ||
<valItem ident="xslt"/> | ||
<valItem ident="xslt2"/> | ||
<valItem ident="xslt3"/> | ||
<valItem ident="xpath"/> | ||
<valItem ident="xpath2"/> | ||
<valItem ident="xpath3"/> | ||
<valItem ident="xpath31"/> | ||
<valItem ident="xquery"/> | ||
<valItem ident="xquery3"/> | ||
<valItem ident="xquery31"/> | ||
</valList> | ||
<remarks versionDate="2023-03-09" xml:lang="en"> | ||
<p>The suggested values above are the values reserved by the | ||
Schematron specification. Only <val>exslt</val>, | ||
<val>stx</val>, <val>xslt</val>, <val>xslt2</val>, | ||
<val>xslt3</val>, <val>xpath2</val>, and <val>xpath3</val> are | ||
defined by the specification. Most processors only support one | ||
or more of <val>xslt</val>, <val>xslt2</val>, and | ||
<val>xslt3</val>.</p> | ||
</remarks> | ||
</attDef> | ||
</attList> | ||
<exemplum xml:lang="en"> | ||
<egXML xmlns="http://www.tei-c.org/ns/Examples"> | ||
<constraintDecl scheme="schematron" queryBinding="xslt3"> | ||
<sch:ns prefix="wwp" uri="http://www.wwp.northeastern.edu/ns/textbase"/> | ||
</constraintDecl> | ||
</egXML> | ||
</exemplum> | ||
<listRef> | ||
<ptr target="#TDTAGCONS"/> | ||
</listRef> | ||
</elementSpec> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,44 +15,38 @@ source or sources from which it was derived.</desc> | |
<desc versionDate="2007-12-20" xml:lang="ko">전자 텍스트와 그것의 원전 텍스트 혹은 텍스트들 사이의 관련성을 기록한다.</desc> | ||
<desc versionDate="2007-05-02" xml:lang="zh-TW">記錄電子文件和其ㄧ個或多個文件來源之間的關係。</desc> | ||
<desc versionDate="2008-04-05" xml:lang="ja">電子テキストとその元資料との関係を示す。</desc> | ||
<desc versionDate="2016-11-17" xml:lang="de">dokumentiert das Verhältnis zwischen dem elektronischen Text und seiner Quelle oder den Quellen, von denen er sich ableitet.</desc> | ||
<desc versionDate="2016-11-17" xml:lang="de">dokumentiert das Verhältnis zwischen dem elektronischen Text und seiner Quelle oder den Quellen, von denen er sich ableitet.</desc> | ||
<desc versionDate="2007-05-04" xml:lang="es">documenta la relación entre un texto electrónico y la fuente o fuentes de las que este deriva.</desc> | ||
<desc versionDate="2007-01-21" xml:lang="it">documenta la relazione fra un documento elettronico e la o le fonti da cui è derivato.</desc> | ||
<classes> | ||
<memberOf key="att.global"/> | ||
<memberOf key="model.teiHeaderPart"/> | ||
</classes> | ||
<content> | ||
|
||
|
||
<alternate minOccurs="1" maxOccurs="unbounded"> | ||
<classRef key="model.encodingDescPart"/> | ||
<classRef key="model.pLike"/> | ||
</alternate> | ||
|
||
|
||
<alternate minOccurs="1" maxOccurs="unbounded"> | ||
<classRef key="model.encodingDescPart"/> | ||
<classRef key="model.pLike"/> | ||
</alternate> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest interleaving a reference to an optional constraintDecl here. <sequence preserveOrder="false">
<alternate minOccurs="1" maxOccurs="unbounded">
<classRef key="model.encodingDescPart"/>
<classRef key="model.pLike"/>
</alternate>
<elementRef key="constraintDecl" minOccurs="0" maxOccurs="1"/>
</sequence> |
||
</content> | ||
<exemplum xml:lang="en"> | ||
<egXML xmlns="http://www.tei-c.org/ns/Examples"> | ||
<encodingDesc> | ||
<p>Basic encoding, capturing lexical information only. All | ||
hyphenation, punctuation, and variant spellings normalized. No | ||
formatting or layout information preserved.</p> | ||
hyphenation, punctuation, and variant spellings normalized. No | ||
formatting or layout information preserved.</p> | ||
</encodingDesc> | ||
</egXML> | ||
</exemplum> | ||
<exemplum xml:lang="fr"> | ||
<egXML xmlns="http://www.tei-c.org/ns/Examples"> | ||
<encodingDesc> | ||
<projectDesc> | ||
<p>Corpus de | ||
textes sélectionnés pour la formation MISAT, Frejus, | ||
juillet 2010. | ||
</p> | ||
<p>Corpus de textes sélectionnés pour la formation MISAT, | ||
Frejus, juillet 2010.</p> | ||
</projectDesc> | ||
<samplingDecl> | ||
<p>Corpus | ||
d'échantillons de 2000 mots pris au début de chaque texte. </p> | ||
<p>Corpus d'échantillons de 2000 mots pris au début de | ||
chaque texte.</p> | ||
</samplingDecl> | ||
</encodingDesc> | ||
</egXML> | ||
|
@@ -61,4 +55,4 @@ formatting or layout information preserved.</p> | |
<ptr target="#HD5"/> | ||
<ptr target="#HD11"/> | ||
</listRef> | ||
</elementSpec> | ||
</elementSpec> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't do if we want to make this element only be used once, as #2330 required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want 1
<constraintDecl>
per scheme (rather than allowing multiples and using decarable/decaring mechanism), but we still have to allow multiples in case there is more than one scheme. E.g.(I have no idea if that is syntactically correct PROLOG; I kinda doubt it. But it does not matter for our purposes.)
That said, it might be a good idea to have a
<constraintSpec>
for<constraintDecl>
that constrained use to only 1 per scheme. 😄