<p>Hi Thomas,</p>
<p>I think your definition of @copyof and @sameas from your first email is accurate. </p>
<p>Your XSLT seems correct too (I haven't ran it, though), but removing ids might not be ideal. If an entire measure is copied, for example, there could be some elements (say, slur) with @startid and @endid pointing at @xml:ids within the measure. Removing the ids would break these references. <br>
A possible solution is to generate new ids for the elements being copied and adjust references within the copied context.<br>
Even in this case, some references might remain ambiguous. Think of a slur with an @endid that points to an element in the following measure. If the measure with the slur is copied, but not the following, also the copied slur will refer to the same element as the original, surely creating an error.<br>
Would it make sense to try to build some awareness of references that go over the copied context? (the same problem applies to values expressed in timestamp)</p>
<p>Creating a tools/MEIron directory in SVN for XSLTs like this is an excellent idea. Are you already a committer on googlecode?</p>
<p>Best,<br>
Raffaele</p>
<div class="gmail_quote">On Jul 27, 2011 7:56 AM, "TW" <<a href="mailto:zupftom@googlemail.com">zupftom@googlemail.com</a>> wrote:<br type="attribution">> In other words: Is this an appropriate resolution for elements with @copyof:<br>
> <br>> <br>> <br>> <?xml version="1.0"?><br>> <stylesheet version="1.0" xmlns="<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>"<br>
> xmlns:mei="<a href="http://www.music-encoding.org/ns/mei">http://www.music-encoding.org/ns/mei</a>"><br>> <!-- Why doesn't the following work, at least not with all processors? --><br>> <!--<key match="mei:*" name="id" use="@xml:id"/>--><br>
> <key match="mei:*" name="id" use="@*[local-name()='id' or<br>> local-name()='xml:id']"/><br>> <br>> <br>> <template match="/"><br>> <apply-templates select="*"/><br>
> </template><br>> <br>> <template match="*"><br>> <copy><br>> <apply-templates select="@*|node()"/><br>> </copy><br>> </template><br>
> <br>> <template match="@*"><br>> <copy-of select="."/><br>> </template><br>> <br>> <template match="mei:*[@copyof]"><br>> <copy><br>
> <apply-templates select="key('id',@copyof)/@*" mode="copy-without-ids"/><br>> <!-- Attributes on the current node override those from referenced node.<br>> This stylesheet leaves the @copyof attribute in place as it does no<br>
> harm and makes it possible to go back to the original<br>> unresolved form --><br>> <apply-templates select="@*"/><br>> <apply-templates select="key('id',@copyof)/node()"<br>
> mode="copy-without-ids"/><br>> </copy><br>> </template><br>> <br>> <template mode="copy-without-ids" match="*"><br>> <copy><br>> <apply-templates select="@*|node()" mode="copy-without-ids"/><br>
> </copy><br>> </template><br>> <br>> <template match="@*" mode="copy-without-ids"><br>> <copy-of select="."/><br>> </template><br>
> <template match="@xml:id" mode="copy-without-ids"/><br>> <br>> </stylesheet><br>> <br>> <br>> <br>> This could be a first small contribution to MEIron, but it doesn't<br>
> record anything in changedesc and appinfo. What should be added to<br>> those elements? Shall we create a tools folder with an meiron<br>> subfolder in the MEI_2011_dev branch to commit things like this?<br>> <br>
> Thomas Weber<br>> <br>> <br>> 2011/7/25 TW <<a href="mailto:zupftom@googlemail.com">zupftom@googlemail.com</a>>:<br>>> We discussed the meaning of @copyof and @sameas during the meeting in<br>>> Detmold. Just to reassure myself that my understanding of what we<br>
>> finally agreed on is correct:<br>>><br>>> Elements with @copyof should not have content as the content is<br>>> replaced by the content of the referenced element. (Virtually<br>>> replaced, or when "ironing", really replaced.) The attributes are<br>
>> also copied, but only those that weren't already set. IDs have to be<br>>> changed or stripped to avoid duplicate IDs.<br>>><br>>> @sameas means that two elements are actually (musically?) the same,<br>
>> but still have to be present twice (or more) in the MEI data. Most<br>>> common example is a rest that is shared by two voices on a single<br>>> staff and has to be present in both layers.<br>>><br>
>> Is that about correct?<br>>> Thomas Weber<br>>><br>> <br>> _______________________________________________<br>> mei-l mailing list<br>> <a href="mailto:mei-l@lists.uni-paderborn.de">mei-l@lists.uni-paderborn.de</a><br>
> <a href="https://lists.uni-paderborn.de/mailman/listinfo/mei-l">https://lists.uni-paderborn.de/mailman/listinfo/mei-l</a><br></div>