In our P4 world, pointing attributes (in particular corresp's, which we
have a great deal of traffic with) were IDREF's and were thus validated
relatively easily.
In the P5 world, the schema doesn't validate these in the same way.
We're now starting to get P5 documents back from the encoders and find
them with the usual assortment of random errors, including those in the
pointing attributes.
I've written the schematron rule below to deal with the case the case
we've run up against, but I was wondering whether anyone had done
something like this in a more systematic fashion? I've looked in the
wiki, but there doesn't seem to be anything.
cheers
stuart
<sch:pattern name="pointers #" id="pointers">
<sch:rule context="@corresp | @scheme | @target | @decls |
@spanTo | @sameAs | @prev | @next | @ref | @hand | @resp ">
<sch:assert test="starts-with(.,'http://') or
starts-with(.,'https://') or (starts-with(.,'#') and
//@xml:id=translate(.,'#','') )">ERROR: pointing item of '<sch:value-of
select="."/>' is bad. A '@<sch:value-of select="name()"/>' needs to
start with 'http://' or 'https://' or start with '#' and point to an
xml:id in the current document. </sch:assert>
</sch:rule>
</sch:pattern>
--
Stuart Yeates
http://www.nzetc.org/ New Zealand Electronic Text Centre
http://researcharchive.vuw.ac.nz/ Institutional Repository
|