Thread View: comp.text.sgml
1 messages
1 total messages
Started by "Dr. "Eliot Kimber" Macro"
Mon, 14 Sep 1992 12:52
SGML query program
Author: "Dr. "Eliot Kimber" Macro"
Date: Mon, 14 Sep 1992 12:52
Date: Mon, 14 Sep 1992 12:52
52 lines
3186 bytes
3186 bytes
References: <3602@bcstec.ca.boeing.com> Paul Hardiman asks about query mechanisms for SGML documents. I don't know of any off-the-shelf query engines, but HyTime (ISO 10744) defines a query language (HyQ) specifically for doing queries into SGML documents. It shouldn't be too hard to write a HyQ server on top of any reasonably-sophisticated SGML parser. If you need special purpose queries to meet a specific application, you could do it pretty easily using a system like the IBM SGML Translator and a fairly small amount of REXX code, on the order of a few hundred lines. I've said a few things in this forum about SGML documents as databases. In fact, I've started to think about all processing done against SGML documents as retrieval, in the sense that the processing application retrieves elements from the SGML source for the purpose of creating the output object. The simplest retrieval query is "retrieve all elements in the order they occur in the document.", but that is only one of many possible retrieval strategies. I find that this way of thinking about SGML documents breaks me out of the sequential processing for formatting paradigm that most document processing systems use, and frees me to think of more interesting and powerful ways of using SGML documents. Also, if retrieval is a basic processing function of your application, it gives you a base on which to build all sorts of useful functions such as retrieval of specific elements based on element properties. If you think of your document source as a general-purpose database of information intended to be used and re-used in many ways, then retrieval is the natural mechanism for accessing that data, just as you would use retrieval to access data in any other kind of database. One interesting aspect of this way of thinking is that if you have a processing system that uses retrieval as its model for data access and provides mechanisms for controlling retrieval based on properties of elements, then very nutty problems like multiversioning become very easy to solve, because they are reduced to specific query specifications made using a general-purpose query and retrieval mechanism. For example, assuming I've defined the property element "VERSION=" for all GIs, I can modify the basic query above to "retrieve all elements that have the property value VERSION=1 in the order they occur." This would retrieve only elements of the correct version (and any elements they contain). Eliot Kimber Internet: drmacro@ralvm13.vnet.ibm.com Dept E14/B500 IBMMAIL: USIB2DK9@IBMMAIL Network Programs Information Development Phone: 1-919-543-7091 IBM Corporation Research Triangle Park, NC 27709
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads