TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
276 stars 88 forks source link

which namespaces shall be magic? #2454

Closed sydb closed 1 year ago

sydb commented 1 year ago

For the foreseeable future, Schematron uses a different mechanism of binding a namespace prefix to a namespace URI than does XML. So a Schematron schema that processes a TEI ODD file is likely to need to have something like

<sch:ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
<sch:ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
<sch:ns prefix="rng" uri="http://relaxng.org/ns/structure/1.0"/>
<sch:ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>
<sch:ns prefix="teix" uri="http://www.tei-c.org/ns/Examples"/>

in it. The question is, which namespaces, if any, should the processor insert for the user, and which namespaces should the user be forced to explicitly declare?. Which is the same as asking which namespace prefixes should “work” by magic, and which ones should cause an error until the poor user figures out how to declare them? I believe that at the moment the TEI Stylesheets only insert a declaration for one namespace automagically (the "tei:" prefix). Furthermore, the TEI Guidelines explicitly declare the "tei:", "xs:", "rng:", "sch:", and "s:" prefixes (that last one is for old Schematron). Thus any user using ODD for customizing (or writing) TEI P5 does not need to declare those. (Note: I added one more in a branch just recently, but I forget which branch. Sigh.) I think there are three possible avenues, with some variation:

  1. ATOP should not declare any prefixes automagically. A user of the ODD system simply must declare any prefixes that are used.
  2. ATOP should insert declarations for as many so-called “standard” prefixes (like tei:, rng:, sch:, xs: or xsd:, rnga:, xsl:, teix:, mets:, mods:, xd:, etc.) as we can come up with.
  3. ATOP should insert declarations for only those prefixes that are necessary for standard ODD usage (tei:, rng:, sch:, teix:, I guess).

Remeber that this will mostly impact people like the TEI Council and those who write languages like MEI. They will need to express <sch:ns> elements in their <constraintDecl> element (see #2330). Users who are customizing a language like TEI or MEI would only need to declare prefixes that are not declared in the main languages’ <constraintDecl>.

I was wobbly on this issue in the past, but now that I have spent time thinking about it while writing it down here, I am pretty strongly in favor of (1).

martindholmes commented 1 year ago

The ATOP group discussed this today, and we all agree that no magic (1) is the best approach.

ebeshero commented 1 year ago

As of 11 August 2023, Council quietly agrees with the wisdom of ATOP on this ticket.