[tei-council] Precision

James Cummings James.Cummings at oucs.ox.ac.uk
Fri Jun 5 13:27:49 EDT 2009


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