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

Created constraintDecl #2596

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions P5/Source/Guidelines/en/TD-DocumentationElements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,22 @@ to mark any technical term, thus:
</constraintSpec>
</egXML>
</p>
<p>Schematron schemas can use a variety of query languages for its expressions, such as XSLT or XQuery.
To declare which query language binding is in use, you may add a <gi>constraintDecl</gi> to
<gi>encodingDesc</gi> or <gi>schemaSpec</gi>.
<include xmlns="http://www.w3.org/2001/XInclude" href="../../Specs/constraintDecl.xml"/>
<specList><specDesc key="constraintDecl" atts="scheme queryBinding"/></specList>
</p>
<p>This element can also be used to provide additional declarations pertaining to formal constraints
expressed <gi>constraintSpec</gi> elements, such as the declaration of a namespace and its prefix.</p>
<egXML xmlns="http://www.tei-c.org/ns/Examples">
<encodingDesc>
<p>Some information about the encoding</p>
<constraintDecl scheme="schematron" queryBinding="xslt3">
<sch:ns prefix="wwp" uri="http://www.wwp.northeastern.edu/ns/textbase"/>
</constraintDecl>
</encodingDesc>
</egXML>
<p>Constraints can be expressed using any convenient language.
The following example uses a pattern matching language called
SPITBOL to express the requirement that title and author should
Expand Down
83 changes: 83 additions & 0 deletions P5/Source/Specs/constraintDecl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright TEI Consortium.
Dual-licensed under CC-by and BSD2 licences
See the file COPYING.txt for details
$Date$
$Id$
-->
<?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"/>
</classes>
<content>
<sequence>
<alternate minOccurs="0" maxOccurs="unbounded">
<classRef key="model.identEquiv"/>
<classRef key="model.descLike"/>
</alternate>
<anyElement minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</content>
<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> 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 a
subset 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>
15 changes: 7 additions & 8 deletions P5/Source/Specs/encodingDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ source or sources from which it was derived.</desc>
<memberOf key="model.teiHeaderPart"/>
</classes>
<content>


<alternate minOccurs="1" maxOccurs="unbounded">
<classRef key="model.encodingDescPart"/>
<classRef key="model.pLike"/>
</alternate>


<sequence preserveOrder="false">
<alternate minOccurs="1" maxOccurs="unbounded">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this seems to result in relaxng that does not represent the ODD's model, but it may be a separate issue.

Expected:

<interleave>
  <choice>
    <oneOrMore>
      <ref name="model.encodingDescPart"/>  
    </oneOrMore>
    <oneOrMore>
      <ref name="model.pLike"/>
    </oneOrMore>
  </choice>
  <optional>
    <ref name="constraintDecl"/>
  </optional>
</interleave>

Actual:

<interleave>
   <oneOrMore>
      <choice>
         <ref name="model.encodingDescPart"/>
         <ref name="model.pLike"/>
      </choice>
   </oneOrMore>
   <optional>
      <ref name="constraintDecl"/>
   </optional>
</interleave>

<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">
Expand Down
3 changes: 2 additions & 1 deletion P5/Source/Specs/schemaSpec.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
<classRef key="model.identEquiv"/>
<classRef key="model.descLike"/>
</alternate>
<elementRef key="constraintDecl" minOccurs="0" maxOccurs="1"/>
<alternate minOccurs="0" maxOccurs="unbounded">
<classRef key="model.oddRef"/>
<classRef key="model.oddDecl"/>
<elementRef key="listRef"/>
<elementRef key="listRef"/>
</alternate>
</sequence>
</content>
Expand Down