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

odd2lite drops <desc> child of <graphic>, leaving invalid PCDATA #444

Closed
sydb opened this issue Jun 15, 2020 · 5 comments · Fixed by #512
Closed

odd2lite drops <desc> child of <graphic>, leaving invalid PCDATA #444

sydb opened this issue Jun 15, 2020 · 5 comments · Fixed by #512
Assignees
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

@sydb
Copy link
Member

sydb commented Jun 15, 2020

On ticket #328 @joeytakeda raised an issue that @peterstadler and I think deserves to be a separate ticket, so here it is. My next comment is just a copy of @joeytakeda’s comment on that ticket.

@sydb
Copy link
Member Author

sydb commented Jun 15, 2020

[From @joeytakeda]

odd2lite.xsl also seems to drop child <desc>s in <graphic>. This:

<p>Here is the TEI badge: <graphic url="http://www.tei-c.org/wp-content/uploads/2016/11/I-use-TEI.png"><desc>The TEI Badge</desc></graphic></p>

Becomes

        <p>Here is the TEI badge: <graphic
                    url="http://www.tei-c.org/wp-content/uploads/2016/11/I-use-TEI.png">The TEI
                    Badge</graphic></p>

@sydb sydb added resp: StylesheetsGroup Issue is suitable for the group-learning approach taken in the Stylesheets Coop Working Group. type: bug A bug report. conversion: odd labels Jun 15, 2020
@npcole
Copy link

npcole commented Nov 28, 2020

Assignments copied from the parent ticket.

sydb added a commit that referenced this issue Feb 12, 2021
Found a template for the 'desc' element that copied only the contents, did not preserve the element itself; changed it to copy the entire element. Seems to work.
@sydb
Copy link
Member Author

sydb commented Feb 12, 2021

We (@martindholmes, @npcole, and I) found a likely cuprit in the template that matches tei:desc in common/common_tagdocs.xsl. (It was just doing <apply-templates>, no more.) We changed it so it copied the <desc> itself and all its attributes. Change passed the tests of Stylesheets/Test/, Stylesheets/Test2/, and TEI/P5/Test/, so we are reasonably confident this is a fix.

@sydb sydb closed this as completed Feb 12, 2021
@sydb sydb reopened this Feb 12, 2021
@sydb
Copy link
Member Author

sydb commented Feb 12, 2021

Oy vey.
This fix turns out to break the build. I have put an hour or so into figuring this out, and what I have determined is I am probably not going to fix it today, and thus I am going to back out the change made in 668331b and re-open this ticket.

The problem seems to be that there are several places in the build process (or, at least, 2 obvious places in the building of ePubs) where the new <desc> elements (“new” in the sense that yesterday the were just invalid PCDATA) are copied through rather than properly processed.

I found what I think is the first of these: The program P5/Utilities/expand.xsl generates the “tab-content-models” table by looking for //macroSpec and (among other things) applying-templates to the first <desc> child. (This is problematic in itself — it should not be the 1st <desc> child, it should be processing the <desc> child of the currently-being-processed language.) There is no template for <desc> in this stylesheet, so I just added one. Seemed like a good idea at the time. But no. Instead of a dozen errors just in the ePub portion of the build, there were thousands all over the build, because the p5odds.rng file itself is invalid (due to the <desc> showing up as text there).

I have no idea how that happened. Goes to remind us all this is a very fragile system.

@martindholmes
Copy link
Contributor

@sydb and I looked at this ahead of the Stylesheets meeting and determined that instead of modifying the template for tei:desc, we should add one for tei:graphic/tei:desc, that copies the desc. Then we will have to deal with any fallout downstream, where tei-to-other-things is not expecting a desc inside graphic. Those downstream things might choose to drop the desc, or turn it into an attribute, or similar.

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

Successfully merging a pull request may close this issue.

6 participants