Skip to content

add processing of an <rng:ref> child of an <attList> - #823

Merged
ebeshero merged 1 commit into
devfrom
NA_ticket_grp_process_rngref_in_attList
Nov 23, 2026
Merged

ebeshero merged 1 commit into
devfrom
NA_ticket_grp_process_rngref_in_attList

Conversation

@sydb

@sydb sydb commented Nov 18, 2026

Copy link
Copy Markdown
Member

This is part of addressing TEIC/TEI#2282. We have decided that an ODD-writer who wants to refer to a RELAX NG pattern (which theoretically defines an attribute) from within an <attList> needs to use <rng:ref>, not <attRef>. Thus these changes add processing of attList//rng:ref for schemas and HTML output.

Passes both Test/ and Test2/. Output schemas seem correct. Output HTML is not pretty, but does the job.

Outstanding problems which should not, IMHO, prevent merging of this PR as it is:

  • In the output of odd2lite (FILENAME.odd.oddprocessed, if you use the bin/teitohtml --odd cmd) there is an extra <ref> element generated at the top of the <html:table rend="attList">. These are empty, so not visible when reading the HTML in a browser.
  • In the HTML the attributes grabbed by <rng:ref> are indicated with some boilerplate text (“a RELAX NG pattern imported directly“ from common_tagdocs.xsl line 2133). It shouldn’t, of course; it should be a call to tei:i18n('…') so that it can be internationalized and localized easily.
  • It would be nice to provide at least the name of the RNG file from which the pattern comes, if not a link to it.
  • We have not investigated what happens if the <rng:ref> is not just in an <attList>, but in an <attList> which is itself the child of another <attList>.

Reviewers: If you want to create a test ODD, you might use TEI/Exemplars/tei_its.odd as an example. (But use <rng:ref>, not <attRef> for the RELAX NG patterns. The tei_its ODD currently uses the latter, but will switch to the former as soon as that PR is merged.)

processing of an rng:ref child of an attList for TEI issue 2850.
@ebeshero

Copy link
Copy Markdown
Member

I've just been testing this PR against TEIC/TEI#2999 , and the tests + build + additional test with the its_odd that @sydb suggests. This works to prepare the HTML documentation: for tei_its.html appears thus for att.global:

Screenshot 2026-11-23 at 15 30 01

I'm trying one more test before merging: Let's see if the <rng:ref> actually works in validation...

@ebeshero

Copy link
Copy Markdown
Member

I've confirmed that a file using its markup validates against the built schema with the Relax NG patterns. (Had to look up how it's done at https://www.w3.org/TR/its/ and dig into the RNG output to see the attributes and expected patterns.) In my test file its: elements sit in the TEI and the attributes like @translate and @locNote validate just fine.
ebbTest-RNGAtts.xml

@ebeshero ebeshero left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When we build the Guidelines with this PR and TEIC/TEI#2999, tests pass, the Guidelines build, HTML output for ITS test schema builds and validates.

@ebeshero
ebeshero merged commit 5b3fad0 into dev Nov 23, 2026
4 checks passed
@ebeshero
ebeshero deleted the NA_ticket_grp_process_rngref_in_attList branch November 23, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants