TEIC / Stylesheets

TEI XSL Stylesheets
232 stars 124 forks source link

oddtoodd stylesheet generates invalid ODD source #319

Open lb42 opened 6 years ago

lb42 commented 6 years ago

As noted in #212 the current oddtoodd process generates invalid ODDs. Specifically:

Compiling the ODD for teisimplePrint,odd exhibits all these problems; there may of course be others.

martindholmes commented 6 years ago

Re the second point: I've never understood why the order of children in an elementSpec or attDef is constrained. Is there a reason?

lb42 commented 6 years ago

No ampersand connector in XML.

martindholmes commented 6 years ago

Eh?

lb42 commented 6 years ago

Constraining the order of components in an element we are defining doesn't seem such a problem to me. The order is arbitrary, obviously, but requiring that it always be the same makes validation an awful lot simpler. Especially in the absence of features like the ampersand connector, or interleave.

lb42 commented 6 years ago

see also #210 for other ways of getting an invalid schema out of an apparently correct ODD

lb42 commented 1 year ago

This issue is now 5yrs old

bwbohl commented 1 year ago

Today I also stumbled over the invalid empty attList generated when I was compiling my ODD with odds/odd2odd.xsl. It's inline element statements that simply create the attList elements, no matter what the $ORIGINAL or elementSpec in the customisation state, e.g.:

https://github.com/TEIC/Stylesheets/blob/2b130e0b1faa400ad648c5bc7c0b9a6a32b391ae/odds/odd2odd.xsl#L972-L978

For a simple local fix I just wrapped it in:

<xsl:if test="tei:attList or $ORIGINAL/tei:attList">
…
</xs:if>

And voilà :-)

sydb commented 11 months ago

Thank you, @bwbohl. I think that fix looks right, but (as you point out on the PR) this should also happen for an <attList> in a <classSpec>. (And the tests are failing, although I suspect that has nothing to do with your code.) I am pessimistic about getting this into the upcoming release, but have high hopes we can get it into the one after.

lb42 commented 11 months ago

It has been waiting 5 years...

HelenaSabel commented 11 months ago

I took the liberty of assigning this ticket to @trishaoconnor. She can merge PR https://github.com/TEIC/Stylesheets/pull/630 without problem and that fixes the empty <attList> issue. What it’s missing now is to determine which other of the issues raised by @lb42 are still present.

trishaoconnor commented 6 months ago

@sydb and I investigated the issue described in point two, that the constraintSpec element was appearing before the datatype element. We believe we found the section in the odd2odd.xsl that was causing the problem and resolved it by reversing the order in the template, see PR #675.

We didn't find any instances to support the third point "a <p> inside a <specGrp> is invalid".