-
Notifications
You must be signed in to change notification settings - Fork 123
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
can't add mode="replace" to attribute class #370
Comments
That is, specifying
It shouldn’t. |
@sydb and @martindholmes have narrowed down the problem to what's happening in the odds/classatts.xsl file, where some clever processing takes place to handle cases where attDefs in elementSpecs override those inherited from classSpecs of which the elementSpec is a member. This process is not done for classSpecs (yet). Simply editing the match attribute to cause classSpecs to be processed as well as elementSpecs fails because it generates another kind of error, whereby nested attribute classes end up duplicated on elements, so that simple fix doesn't work. However we think that it is possible to fix this by passing classSpecs through the same process, with some modification to the process. |
@sydb and @martindholmes went back through the commits and tested the build, and determined that the problem was introduced by the merge at #343; that particular merge contains lots of individual commits, but only one file seems to have been changed: |
Stylesheets group comes up w/ the following replacement for a template in odds/odd2odd.xsl: <xsl:template match="tei:elementSpec[@mode eq 'change']
|tei:classSpec[@mode eq 'change']
|tei:macroSpec[@mode eq 'change']
|tei:dataSpec[@mode eq 'change']"
mode="pass0">
<xsl:variable name="myGI" select="local-name(.)"/>
<xsl:variable name="myIDENT" select="@ident"/>
<xsl:variable name="odd2odd-CHANGE-key-replacement"
select="ancestor::tei:schemaSpec//
(tei:elementSpec|tei:classSpec|tei:macroSpec|tei:dataSpec)
[ @mode eq 'change']
[ $myGI eq local-name(.) ]
[ @ident eq current()/@ident ]"/>
<xsl:choose>
<xsl:when test="count( $odd2odd-CHANGE-key-replacement ) gt 1">
<xsl:if test=". is $odd2odd-CHANGE-key-replacement[@ident eq $myIDENT][1]">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:for-each select="$odd2odd-CHANGE-key-replacement[ @ident eq $myIDENT ]">
<xsl:apply-templates select="node()" mode="pass0"/>
</xsl:for-each>
</xsl:copy>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="*|text()|comment()|processing-instruction()" mode="pass0"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template> |
The above function didn't actually work, but subsequent tests show that the problem with simplePrint is that it consists initially only of specGrpRefs, and those refs are not expanded early enough in the process. So we need a pass before pass0 which will expand all specGrpRefs. |
Quick summary of where we stopped the meeting: We were constructing a variable as a document-node() with guidance from the Kay book, to store the expanded specGrpRefs and pass them to the |
Do tell, @ebeshero, y’all are talking about using the XSLT 2.0 |
Oh, but that’s silly, isn’t it — this ticket is about mode="replace" in attribute classes other than simplePrint. We were just using simplePrint as a test case yesterday. (Possibly a red-herring test case, though.) |
We should definitely fix simplePrint, and add some Schematron to prevent this duplication. It makes no sense in a single ODD file. |
@sydb and @martindholmes have added fixes (TEIC/TEI/#6589fca) (along with @lb42 ) to simplePrint to avoid cases where there are multiple *Spec elements with the same |
This change does cause the make to fail a little further on: something is apparently going wrong in the generation of the -examples.rng file, or the nvdl file which calls it. I can't reproduce the problem using the current "bleeding edge" framework in oXygen, which obstinately goes on doing the right thing, so I am still puzzled.
|
On closer inspection, these are all genuine errors, or at least discrepancies between what the prose of the TEI Simple doc says is possible, or exemplifies, and what the schema supports. I've opened a separate ticket for that at #383 (and closed it again, having fixed the problems) |
Note: there is a work-around for this problem att.entryLike: instead of being a member of att.typed, att.entryLike gets its |
@sydb and @martindholmes coming back to this: the attached test file reproduces the core problem. |
Stylesheets group looked again at this, and determined that the approach of changing |
Assigning to @trishaoconnor for the purpose of testing to see what is left to do on this ticket. Quick survey seems to say that the main remaining problem is the HTML output of the test ODD does not correctly reflect that the attribute ( |
Tested this with @sydb and the results indicated that the schema is correct but the HTML output does not reflect that |
Trying to make changes for TEIC/TEI#1867. This works for the one element,
<constraintSpec>
which has@mode="replace" and '@mode="change"
seems to work for several other elements. but compile fails when new class is added and attribute definition is given `mode="replace".The text was updated successfully, but these errors were encountered: