[tei-council] tei: prefix in @match attribute

Martin Holmes mholmes at uvic.ca
Thu Oct 16 12:01:37 EDT 2014


I've never really understood why we decided that the context for the @match attribute should be the parent element of the element containing the @match -- in other words:

<seg type="thing">
  <certainty match="@thing".../>
</seg>

points to the @thing attribute on the parent <seg>. That's not intuitive at all to me; I would say that the simplest thing is that the starting context is the @match attribute itself, so you would go:

<seg type="thing">
  <certainty match="../../seg/@thing".../>
</seg>

(up to <certainty>, up to <seg>, then down to @thing).

But I can see good arguments for the context being the <certainty> element itself:

<seg type="thing">
  <certainty match="../seg/@thing".../>
</seg>

One way or another, we need to decide, and bring all our examples into line with what we decide.

Cheers,
Martin

Martin Holmes
mholmes at uvic.ca
martin at mholmes.com
mholmes at halfbakedsoftware.com

________________________________________
From: tei-council-bounces at lists.village.Virginia.EDU [tei-council-bounces at lists.village.Virginia.EDU] on behalf of Hugh Cayless [philomousos at gmail.com]
Sent: October 16, 2014 6:22 AM
To: TEI Council ‎[tei-council at lists.village.Virginia.EDU]‎
Subject: Re: [tei-council] tei: prefix in @match attribute

Quite right. I'd forgotten that. Agreed on the need for standardizing this.
Another question which occurs to me: now that TEI XPointers are (I hope)
viable, should we recommend using them in @target instead of @match? Does
@match do anything @target can't now do?

Hugh

On Thu, Oct 16, 2014 at 8:43 AM, Martin Holmes <mholmes at uvic.ca> wrote:

> On 14-10-15 06:07 PM, Hugh Cayless wrote:
>
>> Yeah, that can’t be right. I think we should assume the @match XPath
>> relies on the namespace declarations available in its context. If we
>> *wanted* to use that prefix, I think the example would have to be
>> something like:
>>
>>  <certainty xmlns:tei="http://www.tei-c.org/ns/1.0"
>>> match="parent::tei:gap/@reason" locus="value" cert="low"/>
>>>
>>
>> (or to make clear that the tei prefix had been declared on some
>> ancestor element). It’s not a great XPath anyway…wouldn’t ../@reason
>> be more idiomatic?
>>
>
> Actually, according to other bits of the Guidelines, the default context
> IS the parent element, so @reason should be fine. We need to look at
> standardizing all this.
>
> Cheers,
> Martin
>
>
>> On Oct 15, 2014, at 19:13 , Martin Holmes <mholmes at uvic.ca> wrote:
>>
>>  Hi all,
>>>
>>> This example:
>>>
>>> <certainty match="parent::tei:gap/@reason" locus="value"
>>> cert="low"/>
>>>
>>> which appears in this spec:
>>>
>>> <http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-certainty.html>
>>>
>>>
>>>
>>>  uses a tei: prefix in the @match attribute, to point to the parent
> element. Why does it do that? Do we assume that the default element
> namespace in the XML document is not inherited by the XPath context for the
> match expression? Even if that's the case, doesn't it require that a tei:
> prefix be defined somewhere before it can be used?
>
>>
>>> Cheers, Martin -- tei-council mailing list
>>> tei-council at lists.village.Virginia.EDU
>>> http://lists.village.Virginia.EDU/mailman/listinfo/tei-council
>>>
>>> PLEASE NOTE: postings to this list are publicly archived
>>>
>>
>>
--
tei-council mailing list
tei-council at lists.village.Virginia.EDU
http://lists.village.Virginia.EDU/mailman/listinfo/tei-council

PLEASE NOTE: postings to this list are publicly archived


More information about the tei-council mailing list