[tei-council] Precision

O'Donnell, Dan daniel.odonnell at uleth.ca
Fri Jun 5 13:39:28 EDT 2009


Thanks James. You're right: I did get Lou wrong and the choice for @path='@to' is indeed either tei/@to or, if there is a target, (value of target)/@to.

Anyway, I'm willing to go along if others think having the two atts optionally work together like this is a good idea. I still think there is room for confusion and poor practice, and so would prefer asking for *either* @target *or* @path expressions. But it doesn't seem to me to be a hill worth dying on. And  the breakthrough remains: we can now get at what Gabby wants and do more interesting things as Lou points out.

-----------
Daniel O'Donnell
University of Lethbridge
(From my mobile telephone)

--- original message ---
From: "James Cummings" <James.Cummings at oucs.ox.ac.uk>
Subject: Re: [tei-council] Precision
Date: June 5, 2009
Time: 11:27:58 

O'Donnell, Dan wrote:
> So
> sometimes path='@to' means '//*/@to', and other times it means
> '(value of @target)/@to'

No. That isn't what Lou said.  He said:

> 3. If there is no @target, then the @path is interpreted relative to the 
> document root

So if you just give path='@to' without a target then it means (for a TEI 
document) '/@to' or '/tei:TEI/@to' (or I suppose tei:teiCorpus).  If you 
want to say 'any @to attribute in the document you'd have to expressly 
put '//*/@to' without a @target.

Some of you might be wondering how to process this of course.  Because 
it is difficult in XSLT to process strings and turn them into XPaths.

Lots of XSLT processors have extensions to do just this sort of thing. 
So for example saxon:evaluate(.) is really easy to use.  I did a quick 
proof-of-concept as a blog post at:

http://FAQingPerplXd.wordpress.com/2009/06/05/evaluate-a-string-as-an-xpath/

Showing at least one way to process a string that you've found in a 
document as a XPath.

-James

-- 
Dr James Cummings, Research Technologies Service, University of Oxford
James dot Cummings at oucs dot ox dot ac dot uk


More information about the tei-council mailing list