Beginning some XML proofing and integrity checks
Posted by mholmes on 11 Aug 2009 in Activity log
Started checking the Varin XML file. The XML was valid, but the XHTML output showed 72 validation errors. These were a couple of the causes I found and fixed:
- The XQuery that bundles the reference
<div>
s fromreferences.xml
into the document XML file before rendering includes one reference<div>
for each distinct-value ofref/@target
, selecting the<div>
by using the section of the@target
following the hash to find thediv/@xml:id
. If, therefore, the portion of the@target
attribute preceding the hash is wrong, then two copies of the same reference<div>
may be retrieved -- for instance, if there is<ref target="refefences.xml#blah">
and<ref target="references.xml#blah">
, there will be two instances of the<div xml:id="blah">
in the output, an error which will be flagged by the W3C HTML validator. This amounts to an integrity check which throws up lots of typos in the target attribute, and I fixed many of those in the original XML. - In
references.xml
, the<list>
element is used with@type="bulleted"
and without an@type
attribute value, neither of which situations was allowed for by my XSLT, which expects@type="unordered"
for an unordered list. Rather than rewrite the XML, I tweaked my XSLT to output all TEI<list>
elements whose@type
attribute is not equal to "ordered" as XHTML<ul>
elements.
I also ran some XQuery to find a list of all <ref>
tags whose @target
doesn't match an existing element in the references.xml
file, for whatever reason, and sent that to LCC for her to check through the list, fix typos, and put in empty reference <div>
elements in the references file for any missing items.
This entry was posted by Martin and filed under Activity log.