On 24/06/2015 22:39, Martin Holmes wrote:
> I have a feeling this might now be possible in Oxygen -- check with 
> their support -- but up to now, we've been doing this in a sort of 
> roundabout way: I have ant build files which rebuild our ODD file 
> using all the values of personography @xml:ids as a valList for the 
> attribute concerned, and then build the schema for it. Then Oxygen 
> does prompt for the correct values. It's slightly annoying because it 
> means you have to run that job every time you modify the personography 
> before you can use a new id in the pointer attribute, but it does work.

I think I have found a slightly more flexible approach using Schematron 
Quick Fixes (, which are 
supported since Oxygen 17 (see

For example, this rudimentary Schematron file could do the job (untested!):

     <ns prefix="tei" uri=""/>
   <xsl:variable name="person.index" select="doc('person-index.xml')//tei:person"/>
     <rule context="tei:name">
       <report role="warning" test="not(@ref)" sqf:fix="add.ref">
         A name should have a @ref attribute pointing to a person definition.
       <let name="" value="$person.index[matches(tei:persName, normalize-space(current()))]/@xml:id"/>
       <sqf:fix id="add.ref">
             Add a @ref pointing to a person definition.
         <sqf:add match="." node-type="attribute" target="ref" select="concat('#', $"/>


The $person.index variable loads all person definitions from an index 
file; the Schematron rule matching <tei:name> elements will try to look 
up a person definition in $person.index matching the current name. Next, 
the SQF will propose to add a @ref attribute to the <tei:name> pointing 
to the the @xml:id value of the matching <tei:person> element in 

Though this example is very rudimentary, you could add some degree of 
'dynamism' to offer multiple suggestions, should multiple possible 
person definitions be found (see the discussion at

While I think this is slightly more flexible than Martin's approach in 
that the ODD file doesn't have to be regenerated over again, the 
definition of $person.index in my example still requires a precompiled 
index file containing all unique names found in a TEI document or 
collection. While it is theoretically possible to do a live search over 
a collection (by swapping the doc() function with a collection() call 
over the entire collection), this would probably hardly be workable 
since each new Schematron validation run (basically after each keystroke 
in an XML document being validated against this Schematron in Oxygen) 
will have to scan the collection again for each name in that document. 
But perhaps Oxygen allows for database integration with e.g. an eXist-db 
instance that could boost performance of the $person.index lookup; I 
don't know if that's possible (if it is possible, I'd be interested to 
learn more).