home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / text / sgml / 1263 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  5.3 KB

  1. Path: sparky!uunet!ralvm13.VNET.IBM.COM
  2. From: drmacro@ralvm13.VNET.IBM.COM
  3. Message-ID: <19930106.155234.608@almaden.ibm.com>
  4. Date: Wed, 6 Jan 93 18:51:16 EST
  5. Newsgroups: comp.text.sgml
  6. Subject: Re: SGML for data querying
  7. Disclaimer: This posting represents the poster's views, not those of IBM
  8. News-Software: UReply 3.0
  9. References: <1993Jan6.221136.27780@twg.com>
  10. Lines: 96
  11.  
  12. In <1993Jan6.221136.27780@twg.com> "David Herron" <david@twg.com> writes:
  13.  
  14. >Taking the `forms' example.  A tag might be `<NAME>' and the value at
  15. >that tag is the persons name.  Or a purchase requisition form might
  16. >have <AMOUNT-REQUIRED> <ITEM-DESCRIPTION> <CATALOG-NUMBER> <UNIT-PRICE>
  17. >and <PRICE> tags, with associated values.  Is there a concept wherein
  18. >some `tags' have `values'?  Or does a tag only create a context, and the
  19. >data within that context is interpreted in a particular way?
  20.  
  21. The SGML markup only defines a structural context, e.g., Ammount-Required
  22. must precede Item-Description, or Name contains <lastname> followed
  23. by <firstname>.  It is up to a particular processing application to
  24. define what those elements mean, which they do by associating some
  25. processing with the elements and their data.  This processing can be
  26. anything you can program.  SGML neither defines nor constrains the
  27. purpose to which you put SGML-encoded data.
  28.  
  29. Elements (tags are the syntactic constructs that delimit element
  30. boundaries) can have values in a sense.
  31. All elements (except one special case we can ignore for simplicity)
  32. can be plain text (PCDATA or "parsed character data"), other
  33. elements only, or elements and PCDATA ("mixed content").  When elements
  34. only take PCDATA as their content, the PCDATA is generally intended
  35. as that element's "value" in the way you mean.  Note that in
  36. SGML, elements always contain things, they do not simply represent
  37. start and end flags, and that containment is tracked and reported
  38. by the SGML parser, and knowledge of that containment structure can
  39. be used by applications to make decisions based on the containment
  40. hierarchy for any element or data.
  41.  
  42. >In any case it appears that for `querying' type applications the
  43. >SGML parser must build up some data structure, and that the application
  44. >program must then be able to probe the data structure at its leisure.
  45. >For a normal text processing application (SGML -> TeX -> PS conversion)
  46. >you can get away with creating and destroying the data structures on
  47. >the fly.  But to be consulted at the applications leisure the data
  48. >structures must stay around for a long time.
  49. >
  50. >So... Are there any SGML programming toolkits available which allow
  51. >for this sort of thing?  Is the ARCSGML/JClark suitable in this way?
  52. >(I'm on a small budget)
  53.  
  54. Someone has provided a Rexx interface to ARCSGML for use with
  55. Personal Rexx under MS-DOS.  With this, you could fairly easily
  56. write "query" applications.  The basic idea is
  57. to first define the data structures you need to hold the data
  58. you want, just as you would for any other data processing
  59. application.  You then process the document, grabbing data
  60. off of the relevant elements as they go by and putting it into your data
  61. structures.  The rest you just let flow through and ignore.
  62.  
  63. When you're done processing the document, you do whatever needs
  64. to be done with the data you've collected, such as create
  65. reports, load databases, etc.  This should be fairly straight-forward
  66. processing.
  67.  
  68. <digression>
  69.  
  70. The examples above, and most SGML applications in existence today,
  71. process SGML documents sequentially from start to finish.  However,
  72. SGML does not require sequential processing, and it can make just
  73. as much sense to define applications that work with SGML documents
  74. wholistically as a tree, rather than sequentially, at
  75. least in the abstract.  In this processing model, access is
  76. via queries, rather than sequential access by waiting for the
  77. element you want to flow by.  Some SGML-based online presentation
  78. systems, such as EBT's Dynatext, present this sort of view of
  79. documents, providing query-based direct access to elements and
  80. and data, which makes sense in a dynamic, direct access application
  81. like online presentation.
  82.  
  83. You can also define processing models that use both sequential
  84. and query-based processing.  For example, you might use a query
  85. to access the root of some subtree within a document, and then
  86. process that subtree sequentially to build some output, or in
  87. the course of sequential processing, you might use a query to
  88. do lookahead to resolve a cross reference (as opposed to
  89. doing some sort of two-pass process).  This sort of system might
  90. make the most sense when your documents are already stored in
  91. an SGML-knowledgeable database system that provides the retrieval
  92. function you need.
  93.  
  94. The point is that even though bytehead hackers like myself who
  95. knock together quick programs to do pragmatic stuff tend to
  96. think about processing SGML sequentially, especially because
  97. that's what our tools give us, SGML processing is not limited
  98. to that one processing model, and that by thinking of SGML documents
  99. as databases against which you can do queries, you might start
  100. to think of very interesting and useful ways to use your
  101. SGML documents you might not have thought of before.
  102.  
  103. Eliot Kimber                      Internet:  drmacro@ralvm13.vnet.ibm.com
  104. Dept E14/B500                     IBMMAIL:   USIB2DK9@IBMMAIL
  105. Network Programs Information Development     Phone: 1-919-543-7091
  106. IBM Corporation
  107. Research Triangle Park, NC 27709
  108.