XPath for consistency checking in oXygen
Posted by mholmes on 14 Aug 2007 in Activity log
The @target attribute on <ref> tags should always (so far, I think) point to the @xml:id attribute on a <biblStruct> tag in the bibliography. The editor doesn't check this automatically. There may be a way to force it to do so, using the schema, but I haven't figured that out yet. In the meantime, this piece of XPath evaluated as XPath 2.0 in oXygen will do the trick:
//ref/@target[not(substring(., 2)=//biblStruct/@xml:id)]
It gives back a list of any @target attributes that don't point to a <biblStruct> (a condition which suggests they're mistyped, or that a <biblStruct> is missing or has the wrong xml:id).