Re: Does it make sense to move this XML to a database?

From: Trevor Jenkins <Trevor.Jenkins_at_suneidesis.com>
Date: 30 Jan 2003 16:51:15 GMT
Message-ID: <slrnb3im02.11v.Trevor.Jenkins_at_suneidesis.com>


On 30 Jan 2003 08:32:13 -0800, Figz <efeigenb_at_alumni.tufts.edu> wrote:
> We keep a list of error numbers which each map to a user-friendly text
> description. Example:

We had a similar requirement and encountered the same issues recently when working on an API manual.

> <ErrorDescriptor>
> <ErrorCode>1002</ErrorCode>
> <ErrorDescription>
> You entered a dollar amount less than zero.
> </ErrorDescription>
> </ErrorDescriptor>

Rather than invent our own DTD we used DocBook. Also edited the XML in the emacs psgml mode.  

> ....and so on, for every error. This list is now in the hundreds of
> errors. We're starting to look at better ways to store and map these
> error codes.

Ours approached the thousands. (One specific module had 1,000 messages of its own.) Plus there were multi-lingual error messages.

> My questions are: Is it better to move this into a database table?

Decision was made early on to store the error code/message data in a text retrieval system. Makes searching for free-text simple. Strictly we stored XML fragments in the text retrieval system. When we needed to create a copy of the document's XML instance we searched the database for each API function name and printed out all releveant entries from database as XML entities. Some errors are reported by multiple routines.

> At what point does the size of the xml file begin to degrade the
> performance?

Do you mean degrade the performance of the database or of subsequent XML processing?

> The problems with moving to a database table would include:
> · Time consuming to import all of them and make necessary database
> changes (Probably are a couple of ways to automate this though)

As our error texts were already stored in the same text retrieval system it was a short job to copy the records to the documentation projects database.

> · Will have to search and replace all existing use of error codes with
> calls to the database

For our selected text retireval system this was trivial.

> · More hits on our database

Use a database optimised for text.

> Suggestions for designing a better error code/description system would
> be greatly appreciated. Any tips on what you have done in your
> experiences would be great. Thanks a lot!

If you mean the markup scheme then I'd go with DocBook. Freely available and already contains (more than) the elements you'll need.

Regards, Trevor

British Sign Language is not inarticulate handwaving; it's a living language. Support the campaign for formal recognition by the British government now! Details at http://www.fdp.org.uk/

-- 

<>< Re: deemed!
Received on Thu Jan 30 2003 - 17:51:15 CET

Original text of this message