[tei-council] @pattern/@target language

Daniel Paul O'Donnell daniel.odonnell at gmail.com
Sun Jun 7 16:50:54 EDT 2009


Here's my suggestion I reordered the introductory paragraphs and added 
alternate was of getting at the example defined by #d001:

<p>The pattern attribute used in these and other examples is a powerful mechanism which can be used to indicate precision for a large number of assertions throughout an encoded document in an economical way. The value of the <att>pattern</att> attribute is an XSLT2 pattern, using the syntax defined in <ptr target="#XSLT2"/>. Optionally, <att>target</att> can be used to define the context within which <att>pattern</att> is to be evaluated. The value of <att>target</att> (if defined) is a pointer. If no value is supplied for the                   target attribute, the context for <att>pattern</att> is the document root.</p>
<p>Some simple
examples follow:</p>

<egXML xmlns="http://www.tei-c.org/ns/Examples">
<certainty pattern="@resp" locus="value" degree="0.2"/>
</egXML>
This encoding indicates that there is only a 0.2 certainty that any
value for the <att>resp</att> attribute is correct, wherever it
appears in the document.</p>

<p><egXML xmlns="http://www.tei-c.org/ns/Examples">
<certainty pattern="//*[xml:id='d001']/@resp" locus="value" degree="0.2"/>
</egXML>
This encoding indicates that there is only a 0.2 certainty that the
value for the <att>resp</att> attribute of the element indicated by
the pointer <val>#d001</val> is correct. This same certainty can be expressed using the following combination of <att>target</att> and <att>pattern</att>:
<egXML xmlns="http://www.tei-c.org/ns/Examples">
<certainty target="#d001" pattern="@resp" locus="value" degree="0.2"/>
</egXML>
</p>

<p><egXML xmlns="http://www.tei-c.org/ns/Examples">
<certainty pattern="@resp='#LB'" locus="value" degree="0.2"/>
</egXML>
This encoding indicates that there is only a 0.2 certainty that the
value <val>#LB</val> for the <att>resp</att> attribute is correct, 
wherever it
appears in the document.</p>

<p><egXML xmlns="http://www.tei-c.org/ns/Examples">
<certainty pattern="*[@resp='#LB']" locus="value" degree="0.2"/>
</egXML>
This encoding indicates that there is only a 0.2 certainty that the
content of any element the <att>resp</att> attribute of which has the
value <val>#LB</val> is correct, wherever it
appears in the document.</p>


-- 
Daniel Paul O'Donnell
Associate Professor of English
University of Lethbridge

Chair and CEO, Text Encoding Initiative (http://www.tei-c.org/)
Founding Director, Digital Medievalist Project (http://www.digitalmedievalist.org/)
Chair, Electronic Editions Advisory Board, Medieval Academy of America

Vox: +1 403 329-2377
Fax: +1 403 382-7191 (non-confidental)
Home Page: http://people.uleth.ca/~daniel.odonnell/



More information about the tei-council mailing list