[tei-council] @pattern/@target language

James Cummings James.Cummings at oucs.ox.ac.uk
Sun Jun 7 18:19:58 EDT 2009


Daniel Paul O'Donnell wrote:
> 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>

"wherever it appears in the document":  Then you must give it 
pattern="//*/@resp"

> <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>

"wherever it appears in the document": Then you must give it as 
pattern="//*/@resp='#LB'"

> <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>

"wherever it appears in the document": Then you must give it as 
pattern="//*[@resp='#LB']




-- 
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