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

<code> in <desc> gets dropped in rng #399

Closed
raffazizzi opened this issue Oct 14, 2019 · 5 comments
Closed

<code> in <desc> gets dropped in rng #399

raffazizzi opened this issue Oct 14, 2019 · 5 comments
Labels
conversion: odd resp: StylesheetsGroup Issue is suitable for the group-learning approach taken in the Stylesheets Coop Working Group. type: bug A bug report.

Comments

@raffazizzi
Copy link
Contributor

The text gets entirely dropped, e.g.

<desc versionDate="2019-09-14" xml:lang="en">
    Person who is a <soCalled>source</soCalled> of information 
    (for statements such as qāla fulān b. fulān). 
    Corresponds to code <code>@SRCXX</code>.
</desc>

results in:

<a:documentation xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
    Person who is a source of information
   (for statements such as qāla fulān b. fulān). 
   Corresponds to code .
</a:documentation>

Note how the content of <soCalled> is kept (though without adding quotation marks).

@raffazizzi raffazizzi added the type: bug A bug report. label Oct 14, 2019
@martindholmes
Copy link
Contributor

I think this is handled in common/functions.xsl's tei:makeDescription() function, which has this:

<xsl:when test="tei:desc[@xml:lang=$firstLang]">
          <xsl:for-each select="tei:desc[@xml:lang=$firstLang]">
            <xsl:apply-templates select="." mode="inLanguage"/>
          </xsl:for-each>
        </xsl:when>

So the actual processing is all done in "inLanguage" mode. That brings us back to the teiodds.xsl file, where we find this:

  <xsl:template match="tei:desc" mode="inLanguage">
    <xsl:apply-templates/>
  </xsl:template>

So I think it's possible that if we just add handlers for <tei:soCalled> and <tei:code>(and anything else pertinent) to teiodds.xsl, without a mode attribute, we may solve the problem.

@martindholmes martindholmes added the resp: StylesheetsGroup Issue is suitable for the group-learning approach taken in the Stylesheets Coop Working Group. label Nov 1, 2019
@sydb
Copy link
Member

sydb commented Nov 2, 2019

Here is a little ODD we can use for testing this. It is the same ODD as on ticket #393. (So if you have already downloaded that one, you may not need to download this. But in either case, remember to strip the “.txt” off the end.)

@sydb
Copy link
Member

sydb commented Dec 3, 2019

TEI Stylesheets group tried attacking this. We changed teiodds.xsl line 2467 to apply templates in mode glossDescTitle instead of the default mode. This has the desired effect of keeping the content of <code> (and also put scare quotes around <soCalled>), but the undesired side effect of losing the current processing of other phrase level elements like <gi>, which were becoming <html:code>.
We then reverted that change and (per @peterstadler’s suggestion) tried changing functions.xsl line 1135 to just apply templates in mode glossDescTitle in the first place. That had no effect at all, which initially surprised us (a lot). But @peterstadler realized that the problem was that that point in the processing is only being hit if there is an @xml:lang present on the <desc>. So we should try line 1130 instead.
Here is the test ODD we used, a mild modification of the one above. (We added a <desc> that included phrase level elements for testing to the definition of <hyphenation>.)

@martindholmes
Copy link
Contributor

@npcole, @sydb and I figured out a fix which is coming in branch issue_399_rng_annotations...

martindholmes added a commit that referenced this issue Jun 25, 2021
sydb pushed a commit that referenced this issue Aug 20, 2021
* First fix for issue #399: output code element contents with backticks.

* Fix expected results for issue #399 fix.

* Fixing tests for issue #399 fix.
@HelenaSabel
Copy link
Member

Issue fixed in PR #514

@martinascholger martinascholger added this to the Release 7.55.0 milestone Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conversion: odd resp: StylesheetsGroup Issue is suitable for the group-learning approach taken in the Stylesheets Coop Working Group. type: bug A bug report.
Projects
None yet
Development

No branches or pull requests

6 participants