This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: Testing that xrefs point to xreflabels
- From: martin dot gautier at myrnham dot co dot uk
- To: docbook-apps at lists dot oasis-open dot org
- Date: Mon, 07 Oct 2002 08:33:49 +0100
- Subject: DOCBOOK-APPS: Re: Testing that xrefs point to xreflabels
Norm
I regularly convert Word docs and other types of XML docs to Docbook. This
process usually requires and series of steps and, due to the nature of the
conversions (especially with RTF to XML), errors in the Docbook XML appear
- hence the "noise" on my parsers...
I try to automate as much of the conversion process as possible and try to
avoid stepping through my Parser results fixing each item one at a time.
One such "error" I regularily come across during the conversion process is
<xref> tags pointing to invalid IDs. To help with me in the conversion
process, I'm looking to test my Docbook XML for the presence of an <xref>,
then look for the corresponding ID tag, the results being a nice little
list of just the problematic <xref> tags - using the list, I'd then be
able to manually check the source document, work out what the <xref>
should actually be doing and fix it in the Docbook XML.
I suppose I could leave this step until last so the only errors raised by
the parser are the <xref> related ones - not an ideal solution since I
might get other problems down the line which may need me to follow a
similar diagnosic path.
Since my posting hasn't generated any other comments (BTW - thanks for the
interest) - I'm assuming my problem hasn't been visited by others. I'll be
working on a solution over the next few days. I could write something that
searched for <xref>, grabs the linkend and then searches the XML for it
raising a flag if it's not found. I suppose I could also try parsing my
Parser results and filter out the noise to produce my list...
I'll post whatever I come up with.
Mart
>>What sort of errors is your parser producing? Usually that means
>>you've got errors in your document, and that's going to cause problems
>>later on.What sort of errors is your parser producing? Usually that means
>>you've got errors in your document, and that's going to cause problems
>>later on.