[MEI-L] @copyof and @sameas

TW zupftom at googlemail.com
Wed Jul 27 12:12:38 CEST 2011


The issue of IDs is of course problematic.  With Johannes and Perry,
we didn't come up with a good solution other than leaving it up to the
application what to do with the IDs.  In this case, I'm simply
stripping them and can be sure to get a valid MEI document, as long as
an element of the same name is referenced by @copyof.  You're of
course right, it would be desirable to preserve pointers that remain
within the context and avoid unintentional pointers to elements of the
copied element.  Any good solution for this?

Thomas


2011/7/27 Raffaele Viglianti <raffaeleviglianti at gmail.com>:
> Hi Thomas,
>
> I think your definition of @copyof and @sameas from your first email is
> accurate.
>
> 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.
> A possible solution is to generate new ids for the elements being copied and
> adjust references within the copied context.
> 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.
> 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)
>
> Creating a tools/MEIron directory in SVN for XSLTs like this is an excellent
> idea. Are you already a committer on googlecode?
>
> Best,
> Raffaele
>
> On Jul 27, 2011 7:56 AM, "TW" <zupftom at googlemail.com> wrote:
>> In other words: Is this an appropriate resolution for elements with
>> @copyof:
>>
>>
>>
>> <?xml version="1.0"?>
>> <stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform"
>> xmlns:mei="http://www.music-encoding.org/ns/mei">
>> <!-- Why doesn't the following work, at least not with all processors? -->
>> <!--<key match="mei:*" name="id" use="@xml:id"/>-->
>> <key match="mei:*" name="id" use="@*[local-name()='id' or
>> local-name()='xml:id']"/>
>>
>>
>> <template match="/">
>> <apply-templates select="*"/>
>> </template>
>>
>> <template match="*">
>> <copy>
>> <apply-templates select="@*|node()"/>
>> </copy>
>> </template>
>>
>> <template match="@*">
>> <copy-of select="."/>
>> </template>
>>
>> <template match="mei:*[@copyof]">
>> <copy>
>> <apply-templates select="key('id', at copyof)/@*" mode="copy-without-ids"/>
>> <!-- Attributes on the current node override those from referenced node.
>> This stylesheet leaves the @copyof attribute in place as it does no
>> harm and makes it possible to go back to the original
>> unresolved form -->
>> <apply-templates select="@*"/>
>> <apply-templates select="key('id', at copyof)/node()"
>> mode="copy-without-ids"/>
>> </copy>
>> </template>
>>
>> <template mode="copy-without-ids" match="*">
>> <copy>
>> <apply-templates select="@*|node()" mode="copy-without-ids"/>
>> </copy>
>> </template>
>>
>> <template match="@*" mode="copy-without-ids">
>> <copy-of select="."/>
>> </template>
>> <template match="@xml:id" mode="copy-without-ids"/>
>>
>> </stylesheet>
>>
>>
>>
>> This could be a first small contribution to MEIron, but it doesn't
>> record anything in changedesc and appinfo. What should be added to
>> those elements? Shall we create a tools folder with an meiron
>> subfolder in the MEI_2011_dev branch to commit things like this?
>>
>> Thomas Weber
>>
>>
>> 2011/7/25 TW <zupftom at googlemail.com>:
>>> We discussed the meaning of @copyof and @sameas during the meeting in
>>> Detmold.  Just to reassure myself that my understanding of what we
>>> finally agreed on is correct:
>>>
>>> Elements with @copyof should not have content as the content is
>>> replaced by the content of the referenced element.  (Virtually
>>> replaced, or when "ironing", really replaced.)  The attributes are
>>> also copied, but only those that weren't already set.  IDs have to be
>>> changed or stripped to avoid duplicate IDs.
>>>
>>> @sameas means that two elements are actually (musically?) the same,
>>> but still have to be present twice (or more) in the MEI data.  Most
>>> common example is a rest that is shared by two voices on a single
>>> staff and has to be present in both layers.
>>>
>>> Is that about correct?
>>> Thomas Weber
>>>
>>
>> _______________________________________________
>> mei-l mailing list
>> mei-l at lists.uni-paderborn.de
>> https://lists.uni-paderborn.de/mailman/listinfo/mei-l
>
> _______________________________________________
> mei-l mailing list
> mei-l at lists.uni-paderborn.de
> https://lists.uni-paderborn.de/mailman/listinfo/mei-l
>
>



More information about the mei-l mailing list