home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / sphydir3.zip / sphydir.INF (.txt) < prev    next >
OS/2 Help File  |  1995-06-26  |  240KB  |  3,665 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. The SpHyDir Project ΓòÉΓòÉΓòÉ
  3.  
  4. SpHyDir is an Object Oriented tool that builds documents for Web Browsers such 
  5. as Netscape, Mosaic, and Web Explorer. With SpHyDir the user concentrates on 
  6. the important issues of content and overall document structure. Since SpHyDir 
  7. automatically generates the HTML (Hypertext Markup Language), it is possible to 
  8. generate flawless Web documents without studying obscure syntax diagrams. 
  9.  
  10. A Web document is an ordinary text file that contains formatting instructions 
  11. in the form of HTML "tags". Normally, these tags are processed by a Web Browser 
  12. (such as Netscape Navigator) and are then viewed on a computer screen. If the 
  13. final image "looks right" then many authors are satisfied. This is resonable 
  14. when producing a single personal home page. 
  15.  
  16. A library of information should adopt a common document structure. Similar 
  17. information should have a common format. The same type of information should be 
  18. presented in the same way on all files. The reader should be able to jump to 
  19. releated information, or to view a sequence of documents covering a larger 
  20. topic. Traditional printed books solve this problem with chapters, page 
  21. numbers, a table of contents, an index, and the editorial control of a 
  22. professional publisher. 
  23.  
  24. SpHyDir is the Structured Professional Hypertext Directory Manager. 
  25.  
  26.      It is Structured because it sees a Library that contains Documents that 
  27.       are made up of interlinked HTML Files. Each File contains Sections 
  28.       (Chapter, Topic, Appendix) which in turn contain figures, paragraphs, 
  29.       lists, and tables. Each of these document elements is presented as an 
  30.       Object and the overall document is structured as a tree of such Objects. 
  31.  
  32.      It is Professional because it makes it easy for the author to control 
  33.       more of the advanced Web features than any other tool. Simple HTML 
  34.       editors and Word Processing packages insert only the most basic tag 
  35.       options. A professional job requires more: alternate text should be 
  36.       provided if the user chooses not to fetch images automatically, image 
  37.       sizes should be included in each reference so the browser can operate at 
  38.       maximum efficiency, parameters should be used to generate special effects 
  39.       efficiently rather than transmitting images, etc. 
  40.  
  41.      It is Hypertext because links between documents and to other files can be 
  42.       made through simple Drag-and-Drop. To build a link to a remote Web 
  43.       resource, just display the resource in Web Explorer. SpHyDir will pick 
  44.       the URL reference out of the WE window and attach it to text or to an 
  45.       image in the document under construction. 
  46.  
  47.      The Directories of an HTML library contain related files. An editor or 
  48.       word processor handles one file at a time. SpHyDir manages the structure 
  49.       of interrelated files and automatically generates navigational 
  50.       information such as Next and Previous pointers. 
  51.  
  52.  SpHyDir runs in OS/2 Warp and follows the Workplace model of its user 
  53.  interface. The user drags a document into the workarea. New elements are added 
  54.  to the document by dragging empty paragraph, image, list, or forms objects and 
  55.  dropping them into the document. Hypertext links are created by dragging files 
  56.  from the library or URL references from a Web Browser and dropping them on 
  57.  existing text or images. 
  58.  
  59.  SpHyDir only reads Web (HTML) documents. However, after editing it produces 
  60.  both a revised *.HTM file and a second *.IPF file that is input to the OS/2 
  61.  Help compiler. IPF source can be used to generate INF documentation and HLP 
  62.  program help files. INF files can be viewed in OS/2 and (with a tool from IBM) 
  63.  in Windows. Viewing information from a local hypertext file is faster, and 
  64.  there are additional keyword search functions not available through the Web. 
  65.  The document you are now viewing (and its related files) are also available as 
  66.  SPHYDIR.INF. Since this represents a useful example of many SpHyDir features, 
  67.  the source is available for download along with the SpHyDir program. 
  68.  
  69.  
  70. ΓòÉΓòÉΓòÉ 2. Project Status ΓòÉΓòÉΓòÉ
  71.  
  72. SpHyDir is updated irregularly.  Generally something is posted at the start of 
  73. the week and critical bug fixes can be posted at any time.  Check here for the 
  74. latest information. 
  75.  
  76.  
  77. ΓòÉΓòÉΓòÉ 2.1. June 26 ΓòÉΓòÉΓòÉ
  78.  
  79. On request, the IPF generation has been brought back to its prior level of 
  80. support.  SpHyDir should be able to generate INF files for HTML 2.0 constructs. 
  81. At this time there is no attempt to map HTML 3.0 attributes to IPF or to try to 
  82. deal with Tables and other new features.  The SpHyDir.INF file is now up to 
  83. date. 
  84.  
  85. Characters that are in the Latin-1 set (and therefore in Code Page 850) should 
  86. display correctly in the INF file.  If someone configures the ENTITIES, CHARIN, 
  87. and CHAROUT tables for another code page, sets CODEPAGE in CONFIG.SYS, runs 
  88. IPFC, and does not get proper display of characters in any standard Latin IBM 
  89. code page, please report back to the author. 
  90.  
  91.  
  92. ΓòÉΓòÉΓòÉ 2.2. June 21 ΓòÉΓòÉΓòÉ
  93.  
  94. [Note: a defective version of the June 21 code was posted between Midnight and 
  95. 11:00 EDT on that date. Please replace it with the corrected version] 
  96.  
  97.  
  98. ΓòÉΓòÉΓòÉ 2.2.1. Editing Internation Character Sets ΓòÉΓòÉΓòÉ
  99.  
  100. A World Wide Web has to deal with international character sets. Unfortunately, 
  101. there are more characters in the World than can be easily handled in any simple 
  102. one-byte encoding. Three solutions are available. 
  103.  
  104.    1. Unicode provides a two-byte character set that can handle all the Western 
  105.       languages and Chinese, Japanese, and Korean. This is the ultimate 
  106.       solution, but it is new and there are no good tools available. 
  107.  
  108.    2. There are a family of one-byte character sets that provide coverage for 
  109.       most languages. Since no single code can include the Western "Latin" 
  110.       alphabet and Hebrew, Arabic, and Cyrillic, the ISO proposed a set of 
  111.       8859-x (where x=1...n) character sets covering each major alphabet group. 
  112.       The 8859-1 (also called "Latin 1") character set covers all the languages 
  113.       of Western Europe (and America, Australia, etc.). Starting with HTML 2.0, 
  114.       the Web standards hold that an HTML document is assumed to be in 8859-1 
  115.       unless stated otherwise. The HTTP and some of the HTML <HEAD> area 
  116.       conventions may provide for the use of other 8859-x tables for other 
  117.       alphabets, though the Netscape Browser, for example, only supports 8859-1 
  118.       and Japanese. 
  119.  
  120.    3. Since a complex document may include characters (including Math and other 
  121.       special symbols) from different 8859-x character sets, HTML has a 
  122.       notation for "Entities". An Entity reference begins with the "&" escape, 
  123.       then contains the character name, and ends in a semicolon. For example, 
  124.       it is becoming widely accepted that the copyright symbol Γòò can be 
  125.       represented by the Entity reference "©". 
  126.  
  127.  From the beginning, SpHyDir read and created Entity references for the three 
  128.  special control characters "<", ">", and "&" (< > and &). The 
  129.  Entities were converted to the native character for easy display and editing. 
  130.  When HTML was generate, these characters were converted back to Entities. 
  131.  
  132.  Starting with the May 28th release, SpHyDir supported foreign language Entity 
  133.  names, but without any translation. The "&" character was simply converted to 
  134.  a Smiley Face dingbat character (so that the real "&" character could be 
  135.  treated as normal text in expressions like "PC Lube&Tune"). A user could 
  136.  create new Entity references by entering the Smiley Face character in the Text 
  137.  Edit Window (you can enter any character in the PC set by typing its decimal 
  138.  value on the keypad while holding down the Alt key. Since Smiley Face is 1, 
  139.  hold down Alt, type "1" on the numeric pad, and release Alt). 
  140.  
  141.  This made the entry of foreign characters possible, but not natural. The name 
  142.  of a landmark in the Stuttgart area had to be rendered with the Entity 
  143.  reference to the German sharp s (ß) as Schloßkirche (castle 
  144.  church) 
  145.  
  146.  The best approach would be to display foreign characters natively, just as 
  147.  SpHyDir translates the < > and & characters natively. After trying 
  148.  unsuccessfully to come up with some magic application that would solve the 
  149.  problem SpHyDir now caves in and handles the problem with the OS/2 standard 
  150.  Code Page Solution. Now Schlo╤ükirche will display in its native format in the 
  151.  SpHyDir Workarea and in the Text Edit window, provided that you are using Code 
  152.  Page 850 or convert the supplied tables to work with some other Code Page. 
  153.  
  154.  The original PC character set is known today as Code Page 437. It is the 
  155.  default and is the set you get if you don't know enough to change it in 
  156.  CONFIG.SYS. The 437 set does not have all the characters in the "Latin 1" 
  157.  group. However, it does have the most important Western European characters. 
  158.  Although SpHyDir recommends and supplies tables for the improved Code Page 850 
  159.  (along with instructions to change the CODEPAGE statement in CONFIG.SYS to 
  160.  make it the default), a user who insists on keeping the old 437 Code Page 
  161.  could change the supplied tables to support it. 
  162.  
  163.  SpHyDir ships files named ENTITIES.850, CHARIN.850, and CHAROUT.850. They 
  164.  should be copied to the root directory of the HTML library. ENTITIES.850 
  165.  provides a mapping between the Entity names and the code assignments for the 
  166.  corresponding characters in the 850 Code Page. This is just a text file and it 
  167.  can be used as a model to produce an ENTITIES.437 if you insist on using the 
  168.  old defective 437 Code Page. It can also be changed to any other national use 
  169.  Code Page supported by OS/2. The other two files provide translate tables 
  170.  between the ISO 8859-1 encoding and the Code Page locations of the 
  171.  corresponding characters in the IBM numbered Code Page. This is a bit more 
  172.  tedious to edit, but it can be done. 
  173.  
  174.  SpHyDir doesn't do anything special about the keyboard. The assumption must be 
  175.  that a user has already selected a Code Page and Keyboard layout that allow 
  176.  the entry of characters to the ordinary editors and windows of the system. 
  177.  Rather than trying to duplicate (or worse to override) that support, SpHyDir 
  178.  simply provide a simple mechanism completely under the user's control to 
  179.  translate HTML entities into the standard operating system character support. 
  180.  
  181.  If a file is encoded in the ISO 8859-1 standard, the SpHyDir supplied 
  182.  translate tables will convert it to Code Page 850 as it is read in. This 
  183.  version of SpHyDir is biased to Entity notation, so when SpHyDir generates 
  184.  HTML it will use Entity notation for all characters that have values with 
  185.  defined Entity names. It will convert back to ISO 8859-1 only the characters 
  186.  that do not have Entity names. This version of SpHyDir will not display as 
  187.  native characters anything entered with the "numeric" entity notation. Only 
  188.  named characters will be translated for native display. 
  189.  
  190.  A new section of the SpHyDir document describes Code Pages in general and the 
  191.  ENTITIES definition file in particular. 
  192.  
  193.  
  194. ΓòÉΓòÉΓòÉ 2.3. June 20 ΓòÉΓòÉΓòÉ
  195.  
  196. Saw a request on the net for JPEG support. Added JPG and JPEG (case 
  197. insensitive) to the list of extensions regarded as IMG file types. At this 
  198. time, SpHyDir does not know how to find the size of JPEG files, so it does not 
  199. add WIDTH and HEIGHT attributes as it does for GIF. 
  200.  
  201. Discovered a user was still using TARGET. It was reported that if you drag the 
  202. TARGET object from the toolbar (which was by the way blank now for some reason) 
  203. and try to save the file, SpHyDir crashes. Well the TARGET object isn't 
  204. supposed to be there, which is why the tool is blank. However, there really 
  205. still was a TARGET tool under that blank face, and yes when you insisted on 
  206. using it the HTML generation failed. This, however, also exposed a problem with 
  207. the ToolChest, since SpHyDir would fail if the user created a tool with an 
  208. unsupported type. Anyone who ran SpHyDir in the last few weeks has a TARGET 
  209. tool in the ToolChest that won't go away until the TOOLDEF.TXT file is deleted 
  210. from the root directory of the HTML Library. So HTML Generation is now 
  211. protected against invalid object types. 
  212.  
  213.  
  214. ΓòÉΓòÉΓòÉ 2.4. June 15 ΓòÉΓòÉΓòÉ
  215.  
  216. Corrected a bug deleting Links. Added most remaining Netscape non-standard 
  217. extensions. 
  218.  
  219. Note: Netscape has this terrible idea to make BORDER an attribute of IMG taking 
  220. a numeric value. This contrasts to the use of BORDER in TABLE which is just a 
  221. Yes or No. SpHyDir II doesn't currently have the ability to distinguish valid 
  222. ranges of values when the same attribute has different types of values in 
  223. different tags. Reluctantly, BORDER is now defined as taking any type of value. 
  224. So while it was possible previously to simply select BORDER from the Properties 
  225. popup menu of a TABLE object and it would be set to the right thing, now when 
  226. you select BORDER you will get a dialog box and you have to type in "Yes" and 
  227. press OK. 
  228.  
  229.  
  230. ΓòÉΓòÉΓòÉ 2.5. IMG and FIG ΓòÉΓòÉΓòÉ
  231.  
  232. SpHyDir has been struggling with the problem of Image Objects. The HTML 2.0 
  233. standard allows IMG tags to appear in the middle of sentences, headers, and 
  234. captions. An IMG is regarded as a large letter. This is why the official ALIGN 
  235. options for IMG (TOP, MIDDLE, BOTTOM) relate to how the image is aligned 
  236. vertically with the characters immediately preceeding and following it. 
  237.  
  238. That is not the way that most people want to treat large images. Netscape 
  239. proposed two additional alignments (LEFT, RIGHT) that allow text to flow around 
  240. the margin of an image, much as word processors handle inserted graphics. HTML 
  241. 3.0 also includes these values for ALIGN, but for the most part it wants to use 
  242. FIG. 
  243.  
  244. A Figure is enclosed in the <FIG>..</FIG> tags. The FIG tag contains a SRC 
  245. attribute that points to a graphic file, much as IMG. FIG has a number of 
  246. extensions over IMG that might prove useful if any browser supported it. 
  247. However, at this point no mainstream Web browser knows about FIG and all ignore 
  248. it. Of course, they do not ignore the markup inside the FIG tag, just the tag 
  249. itself. 
  250.  
  251. The ordinary text content of the FIG tag is supposed to be displayed on 
  252. non-graphic browsers as an alternative to the image: 
  253. <FIG SRC=monalisa.gif> 
  254. A famous painting of a woman smiling. 
  255. </FIG> 
  256. The IMG tag has an ALT attribute that contains alternate text for the same 
  257. purpose. However, the FIG tag can contain much larger descriptions with 
  258. paragraphs, lists, headings, and all other document elements. A major objective 
  259. is to allow detailed description of diagrams for readers who are visually 
  260. impaired and use text-to-speech browsers. 
  261.  
  262. Currently, however, no major browser supports the FIG tag. Following standard 
  263. practice, a browser ignores tags that it does not understand, but does not 
  264. ignore their contents. This makes it difficult in the near term to use the FIG 
  265. contents for its intended purpose since it will be displayed by graphic 
  266. browsers like Netscape, Web Explorer, and Mosaic. 
  267.  
  268. However, FIG appears to be a way out of the hole that SpHyDir in which SpHyDir 
  269. has fallen. That hole was caused by the desire to have an Image Object. An 
  270. Object is a nice big thing. You can drop GIF files on it. You can link to it 
  271. easily. You can parameterize it with properties. The problem, of course, is 
  272. that an object cannot occur between a couple of words, and since HTML 2.0 wants 
  273. to regard the IMG tag as part of the ordinary paragraph text, this in the long 
  274. run produced all sorts of problems. 
  275.  
  276. The FIG is a much more suitable starting point for a Document Object. It stands 
  277. along, like a paragraph. It even aligns LEFT, CENTER, RIGHT, and JUSTIFY like a 
  278. paragraph. It cannot appear in the middle of a sentence or in a Heading. 
  279.  
  280. Since FIG isn't currently supported by browsers, there has to be a migration 
  281. strategy. As with "<CENTER><P ALIGN=CENTER>", the SpHyDir approach to HTML 
  282. migration is to do the thing "every which way" it can be done so that every 
  283. browser must precisely what is intended. Of course, there is no way to fake the 
  284. advanced features that caused FIG to be invented in the first place. The 
  285. browsers will just have to catch up. However, it is possible right now to 
  286. generate a FIG that can replace standalone and text-wraparound images: 
  287. CODE<FIG SRC=monlisa.gif ALIGN=LEFT> 
  288. <IMG SRC=monalisa.gif ALIGN=LEFT ALT="A famous painting of a woman smiling"> 
  289. </FIG>/CODE 
  290.  
  291.    1. An HTML 3.0 graphical browser will understand FIG, display the GIF file, 
  292.       and ignore the contents. 
  293.  
  294.    2. An HTML 2.0 graphical browser will not understand FIG and will ignore it. 
  295.       It will not ignore the contents, and so will process the IMG tag. Again 
  296.       the GIF file is displayed. 
  297.  
  298.    3. A non-graphical browser may or may not understand FIG, but in any case 
  299.       will ignore it because the browser doesn't display images. It will then 
  300.       look at the IMG tag and again decide not to display the GIF, but it will 
  301.       print the ALT text. 
  302.  
  303.  Although the GIF file appears in both the FIG and IMG tags, the two are 
  304.  mutually exclusive. One or the other will be processed, but not both. As to 
  305.  the ALIGN=LEFT, this is valid for a FIG in HTML3 and is a widely supported 
  306.  Netscape extension of IMG in HTML 2. 
  307.  
  308.  SpHyDir 1 did not deal with IMG tags that were embedded in the middle of a 
  309.  paragraph or Heading. SpHyDir II accomodated such IMG tags by creating another 
  310.  "dingbat" sequence in the text. The 0x08 character, which looks like a box 
  311.  with a hole, or roughly "[o]", is used to start and end an IMG reference. 
  312.  Between these two dingbats are the name of the GIF file, then optionally a 
  313.  blank and the alternate text. 
  314.  
  315.  However, in the first cut SpHyDir II continued to extract IMG tags from the 
  316.  start of a paragraph (or when they form a paragraph by themselves). They 
  317.  become IMG objects. Later on, SpHyDir II tries to decide if they should be 
  318.  merged back into the paragraph that follows them. 
  319.  
  320.  The intent is to change this. Images that are contained in a paragraph of 
  321.  their own, or that have ALIGN values LEFT or RIGHT will be extracted as before 
  322.  to for a separate object. However, the object will then be regenerated as a 
  323.  FIG+IMG construct as described above. This will allow the Image Object to 
  324.  begin to have Properties derived from the more powerful FIG tag, instead of 
  325.  limiting it to the current IMG Properties. Conversely, IMG tags that fall at 
  326.  the start of a paragraph containing other text, and that have ALIGN values of 
  327.  TOP, MIDDLE, or BOTTOM, will be treated as embedded images and will be 
  328.  represented by the 0x08 dingbat character sequence. 
  329.  
  330.  
  331. ΓòÉΓòÉΓòÉ 2.6. June 14 Update ΓòÉΓòÉΓòÉ
  332.  
  333. The Text Edit Window now allows drag and drop. Position the cursor or select a 
  334. phrase of text. Now 
  335.  
  336.      Drag and Drop a GIF file anywhere on the Text Edit Window. This will 
  337.       generate an "embedded IMG". If no text is selected, the dingbat character 
  338.       and file name will be placed at the cursor position. If text is selected, 
  339.       then the selected text will become ALT alternate text within the 
  340.       dingbats. 
  341.  
  342.      Select some text. Hold down Ctrl-Shift and drop any file from the HTML 
  343.       library on the Text Edit Window. The previously selected text becomes a 
  344.       hypertext link to the file. Previously it was necessary to save the text, 
  345.       Link-Drop a file on the Paragraph Object in the workarea, and then select 
  346.       the text from the Hotword Selection window. Allowing links to be formed 
  347.       directly in the Text Edit window simplifies this process. Note that links 
  348.       created this way are saved only if the rest of the edited text is saved. 
  349.       Pressing the Cancel Button or closing the Text Edit window cancells the 
  350.       new Links as well. 
  351.  
  352.      Select text and drop a URL Object created by Web Explorer from the 
  353.       Workplace on the Text Edit Window. The selected text will be converted to 
  354.       a Link to the remote resource represented by the URL. 
  355.  
  356.      Do not select text. Leave the cursor at an insertion point in the 
  357.       paragraph (usually after a blank). Drop a URL Object created by WE on the 
  358.       Text Edit Window. The title of the remote resource is inserted at the 
  359.       point of the cursor and becomes a hotlink to the document itself. 
  360.  
  361.      Unfortunately, it is not possible to drop Link Manager list items on the 
  362.       Text Edit Window. To maintain the integrity of the data being edited, the 
  363.       Text Edit Window locks up the underlying Workarea until the edit 
  364.       completes. This also blocks the Link Manager from functioning. So links 
  365.       have to come from the WPS environment, or save the text and use the Link 
  366.       Manager as it has traditionally been used. 
  367.  
  368.  Extra blank spaces and lines after the <LI>, <TH>, and <TD> tags were removed. 
  369.  They were errors picked up by Netscape producing undesired results. 
  370.  
  371.  SpHyDir now declines to insert some of ending tags that nobody else bothers to 
  372.  generate. Tables generated too many </TH>, </TD>, and </TR> tags. It made the 
  373.  HTML ugly and hard to read. 
  374.  
  375.  The temporary dialog for new Tables has been replaced by a more polished 
  376.  dialog box. Enter the number of rows and columns and select by a checkbox if 
  377.  they are to be labelled. 
  378.  
  379.  Select a Table Row Object. Click the Second Mouse Button. Select Create 
  380.  Another from the popup menu. A new row is created with the same number of 
  381.  label and cell objects as the previous row. [Adding a new column is harder and 
  382.  is left to a later date.] 
  383.  
  384.  When generating an Ordered or Unordered list, SpHyDir II has added an extra 
  385.  step because List Points no longer contain text. One might have to drop a new 
  386.  Point on the list, then go back and drop a new Paragraph on the Point. A 
  387.  shortcut is to popup the Second Mouse Button window for the previous Point and 
  388.  choose Create Another. This not only creates another Point object, but it also 
  389.  creates another Paragraph under it and opens the Text Edit window directly. 
  390.  More generally, Create Another populates the new Point with another object of 
  391.  the same type as the first object contained in the old point, so the trick 
  392.  works for Points of Images as well. 
  393.  
  394.  Forms bugs caused by rewrite: TYPE did not default to TEXT, NAME attribute 
  395.  generate twice, SUBMIT incorrectly genned as HIDDEN. 
  396.  
  397.  
  398. ΓòÉΓòÉΓòÉ 2.7. June 12 SpHyDir II ΓòÉΓòÉΓòÉ
  399.  
  400. SpHyDir II now appears stable enough to remove some of the disclaimers. There 
  401. are certain to be problems with the new HTML 3.0 tags that nobody is using, but 
  402. more bugs have been fixed in the old code than seem to be problems with the 
  403. new. SpHyDir II is now the "standard" distribution. Where the old code is 
  404. mentioned, it is called "SpHyDir 1". The documentation has been updated. 
  405.  
  406. A user had problems with the small characters. SpHyDir now remembers the WPS 
  407. font that has been dropped on the Workpace, Properties Table, Edit Windows, and 
  408. Link Manager. The Link manager window can now be widened. 
  409.  
  410.  
  411. ΓòÉΓòÉΓòÉ 2.7.1. Entity Syntax ΓòÉΓòÉΓòÉ
  412.  
  413. Newer versions of the HTML standards pointed out a number of details about 
  414. Entities. An ampersand is only regarded as a possible entity if it is followed 
  415. by letters or numbers. The sequence "A & P" is legal. An entity doesn't require 
  416. an ending ";" except to separate it from characters that could be part of the 
  417. entity name. "A & P" is also valid. SpHyDir now recognizes these forms, 
  418. though on output it always generates the full "A & P" in the output HTML. 
  419.  
  420.  
  421. ΓòÉΓòÉΓòÉ 2.7.2. Target Objects become ID Property ΓòÉΓòÉΓòÉ
  422.  
  423. After an initial false start, SpHyDir 1 support for Targets (the object 
  424. corresponding to the HTML <A NAME=xxx> tag) became stalled. The problem is that 
  425. HTML standards and use permitted the <A> tag to include text and Headings. 
  426. Unfortunately, this might mean a construct of the form: 
  427. CODE<A NAME=FUZZY>the end of one topic. 
  428. <H2>Now for Something Completely Different</H2> 
  429. On a completely unrelated matter, </A>/CODE 
  430. This is perfectly legal HTML, but any attempt to make structural sense out of 
  431. it is hopeless. 
  432.  
  433. HTML 3.0 presented a much better idea. Labels can be assigned to headers or 
  434. paragraphs with the ID attribute. This presents a Hypertext label whose 
  435. location and purpose is unambiguous. Unfortunately, ID is not widely supported. 
  436.  
  437. SpHyDir II takes its inspiration from the "Recommended" syntax of HTML 2 and 3. 
  438. "Recommended" practice holds that an anchor should go inside a Header rather 
  439. than including the header. This would produce 
  440. CODE<H2><A NAME="Python Introduction"> 
  441. Now For Something Completely Different</A></H2>/CODE 
  442. One big advantage is that this syntax is effectively interchangeable with the 
  443. preferred (but currently not widely supported) HTML 3 construct: 
  444. CODE<H2 ID="Python Introduction"> 
  445. Now For Something Completely Different</H2>/CODE 
  446.  
  447. Now a reasonable strategy appears. It eliminates ambiguity, gets rid of the 
  448. Target object (which was cute but a problem), and provides for the sane 
  449. migration from HTML 2 to 3. First, ambiguous structure is resolved by asserting 
  450. that legacy HTML should have been following the Recommended practice. The <A 
  451. NAME=xxx> tag is logically associated with the very next thing that follows it 
  452. no matter where the </A> is located. The Name, however, becomes an attribute of 
  453. the object that contains the next thing that follows the <A>. 
  454.  
  455.      "CODE<A NAME=X>Fred. <H2>Mary/CODE" assigns the name X to the 
  456.       Paragraph or other text object containing "Fred". The name has nothing to 
  457.       do with the following Mary section. 
  458.  
  459.       "CODEFred.<A NAME=X><H2>Mary/CODE" - Assigns the name X to the 
  460.       Section associated with the Header for Mary. Although the <A> tag is 
  461.       "outside" and "before" the Header, nothing else comes between the tag and 
  462.       the start of the Header. The name applies to the first thing that follows 
  463.       the <A> tag, not the superficial location of the <A> tag itself. 
  464.  
  465.       "CODEFred.<H2><A NAME=X>Mary/CODE" - HTML 2.0 Recommended practice. 
  466.       SpHyDir will convert the previous case to this when generating new HTML. 
  467.       That is, SpHyDir will move the <A> tag inside the <H2> tag. 
  468.  
  469.       "CODEFred.<H2 ID=X>Mary/CODE" - Recommended HTML 3.0 practice. 
  470.       Unfortunately, many browsers don't support this yet. SpHyDir will 
  471.       recognize it and "backlevel it" to the previous case of Recommended HTML 
  472.       2.0 practice. Later on, when the browsers catch up, this will become the 
  473.       syntax that SpHyDir will produce and SpHyDir will "upgrade" HTML 2 to 3. 
  474.  
  475.  The Target button has now been restored to the Link Manager window. This time 
  476.  it works. Pressing the target button displays all the target lables in the 
  477.  current document tree. They can be dragged and dropped onto Images and text to 
  478.  form hyperlinks as previous Link Manager entries were used. SpHyDir does not 
  479.  intend to extende the reach of the target button outside the current document. 
  480.  Rather, XSpO programs will be developed to identify targets in other documents 
  481.  or databases. 
  482.  
  483.  Although it is common practice to give short names to targets, HTML allows the 
  484.  ID/NAME value to be long and to have multiple words if it is quoted. Note that 
  485.  names are case sensitive. Using somewhat more descriptive names is helpful 
  486.  when a hypertext link must be selected from a long list of available labels. 
  487.  
  488.  
  489. ΓòÉΓòÉΓòÉ 2.7.3. CENTER Again ΓòÉΓòÉΓòÉ
  490.  
  491. CENTER and ALIGN=CENTER should be handled correctly in most cases. There is one 
  492. area where problems can arise. When an IMG appears at the start of a paragraph, 
  493. SpHyDir tries to break it out as a separate object. Objects are easier to 
  494. change, since you can update properties with the table and can drop a new GIF 
  495. file on the icon. Thus 
  496. CODE<P><IMG SRC=xxx ALIGN=MIDDLE>This is typical.</P>/CODE 
  497. is processed by SpHyDir to produce an Image Object and a Paragraph Object. The 
  498. ALIGN=MIDDLE on the Image is the flag that warns SpHyDir to shuffle the image 
  499. back "inside" the paragraph when HTML is generated. 
  500.  
  501. This is even harder to code than it is to describe. It becomes impossible, 
  502. however, when you add CENTER: 
  503. CODE<CENTER> 
  504. <P><IMG SRC=xxx ALIGN=MIDDLE>This is typical.</P> 
  505. </CENTER>/CODE 
  506. The problem is that CENTER is not an attribute of IMG tags. The "MIDDLE" value 
  507. means to align the image vertically so that the text that follows is at the 
  508. middle of the image. It has nothing to do with CENTER which is horizontal 
  509. alignment. An IMG can have ALIGN values of TOP, MIDDLE, BOTTOM, and with 
  510. extensions LEFT and RIGHT. However, the way to center an IMG is to put it 
  511. inside a centered paragraph as above (Netscape) or below (HTML 3.0): 
  512. CODE<P ALIGN=CENTER><IMG SRC=xxx ALIGN=MIDDLE>This is typical.</P>/CODE 
  513.  
  514. SpHyDir is left with three bad choices. One approach is to give up entirely on 
  515. Image Objects. This reduces the drag and drop functionality of the system. A 
  516. second approach is to allow Paragraphs to be "opened" to expose embedded images 
  517. as objects. This would be a major revision of current use. So SpHyDir will try 
  518. to salvage the current approach from the onslaught of new HTML features that 
  519. make it more difficult. 
  520.  
  521.  
  522. ΓòÉΓòÉΓòÉ 2.7.4. Groupies ΓòÉΓòÉΓòÉ
  523.  
  524. Suppose you want to center two lines. One HTML 3.0 approach is to apply the 
  525. center attribute to each separately: 
  526. CODE<P ALIGN=CENTER>Tastes Great!</P> 
  527. <P ALIGN=CENTER>Less Filling!</P>/CODE 
  528. This does the job, but if you change your mind it becomes necessary to uncenter 
  529. each separately. The Netscape extension does the job: 
  530. CODE<CENTER>Tastes Great!<P>Less Filling!</CENTER>/CODE 
  531. but there are a number of technical semantic problems with the CENTER tag that 
  532. make it unlikely to survive standarization. The HTML 3.0 view is to group the 
  533. lines: 
  534. CODE<DIV CLASS=BUDLITE ALIGN=CENTER> 
  535. <P>Tastes Great!</P> 
  536. <P>Less Filling</P> 
  537. </DIV>/CODE 
  538. Alignment on a DIV applies to everything inside it. The best use of CLASS names 
  539. in this context is unclear. 
  540.  
  541. SpHyDir tries to migrate everything in the direction of the formal standard. To 
  542. that purpose, SpHyDir introduces the Group Object which is logically associated 
  543. with a DIV tag. The Insert - Structure - Group option of the Second Mouse 
  544. Button popup will create an empy group. Alternately, Mark a range of objects 
  545. and select Group from the popup to create a group containing all the marked 
  546. objects (leaving them where they were). 
  547.  
  548. However, the final use of Group and DIV is not clear. The standard provides 
  549. little direction, and there is no body of use on the Net to point to the right 
  550. direction. Clearly the current SpHyDir casual approach to Section Objects 
  551. should be formalized by creating <DIV CLASS=xxx> markups. However, if a 
  552. document spans multiple files in a tree, how does one determine the CLASS names 
  553. (VOLUME, CHAPTER, SECTION, SUBSECTION, APPENDIX, etc). It should also be 
  554. possible to convert a Group object into a Section Object (by adding a Title) or 
  555. demote a Section to a plain group. What other transformations are needed? 
  556.  
  557.  
  558. ΓòÉΓòÉΓòÉ 2.8. June 5 SpHyDir II Beta ΓòÉΓòÉΓòÉ
  559.  
  560. SpHyDir II supports most of the HTML 3.0 and Netscape extended functions. 
  561. Anything missing will be added quickly. This code is Beta because a large 
  562. amount of core logic had to be ripped up and reorganized. There has not been 
  563. enough time to test everything. 
  564.  
  565. For the next few weeks, before using this code make an archive copy of the 
  566. original file. Check carefully for any individual element that might have been 
  567. dropped out of the document because of a bug. Please report problems back to 
  568. the author. 
  569.  
  570. Rewriting the documentation is one of the tasks ahead. As a result, SpHyDir II 
  571. Beta is available only by FTP from pclt.cis.yale.edu in the sphydir 
  572. subdirectory of /pub. Source will temporarily be unavailable to Professional 
  573. uses, though the key that enables Professional features on SpHyDir 1 continues 
  574. to work on II. 
  575.  
  576.  
  577. ΓòÉΓòÉΓòÉ 2.8.1. Properties Table ΓòÉΓòÉΓòÉ
  578.  
  579. An HTML tag has attributes. SpHyDir II document objects have properties. There 
  580. is largely a one to one correspondence between attributes and properties. 
  581.  
  582. HTML 3.0 adds a ton of attributes to previously fairly simple tags. Even the 
  583. <P> tag can now become 
  584. CODE<P ID="HomeTown" ALIGN=CENTER CLEAR=ALL>/CODE 
  585. SpHyDir II needs a way to display and change all these new properties for each 
  586. object. 
  587.  
  588. The Properties Table is modelled after similiar windows in Visual Basic and 
  589. Delphi. Since PM doesn't exactly have the same kind of controls, SpHyDir 
  590. settles for a Container (the same type of object as an open WPS folder or the 
  591. Workarea) set to Details View. There are two columns in the table, a property 
  592. description and a value. 
  593.  
  594. It seemed to be confusing to list all the properties that every object might 
  595. have, so the table lists only those with a significant value. However, if you 
  596. point to the whitespace of the table (below the last entry) and click the 
  597. second mouse button, a popup menu will list all the properties known to be 
  598. valid for this type of object. During the Beta period, SpHyDir may be a bit 
  599. fuzzy about this selection and may include a few properties that belong to a 
  600. larger class of objects of which the current object is a particular case. For 
  601. example, the properties of all the forms objects are jumbled together and need 
  602. to be sorted out. 
  603.  
  604. The value column of the table can be directly edited. Since this is a 
  605. container, changing the value this way uses the same technique for renaming a 
  606. file in WPS. Hold down Alt and click on the old value. A box appears around the 
  607. old value and it can be edited. Clicking elsewhere in the table completes the 
  608. process and saves the new value. As with WPS file renaming, this interface is 
  609. not ideal. 
  610.  
  611. Since the value column may be narrow and awkward, an alternative strategy is to 
  612. doubleclick the property. This pops up a box with a bit more room to change the 
  613. old value, and some edit rules that are a bit nicer to use. 
  614.  
  615. If a property has a list of possible values, the list can be displayed by 
  616. clicking on the property with the second mouse button. The possible values 
  617. popup as a menu. SpHyDir II does not feel strongly that it really knows the 
  618. absolutely correct list of possible values. First, the HTML 3.0 standard 
  619. changes a lot. Secondly, the same attribute name can have different possible 
  620. values in different contexts. So the user is free to type in values that are 
  621. not in the list. Its just that the second mouse button popup menu cannot be 
  622. used to set other values. 
  623.  
  624. It is a restriction for the near term that the values "Yes" and "No" may not be 
  625. used for any property other than a logical switch. So don't try to title a 
  626. section "No" cause that won't work. Switches correspond to attributes whose 
  627. presence signals a option, such as "COMPACT" in a list. Setting a logical 
  628. switch to "No" is eventually going to delete it from the properties table, 
  629. because "No" is the default setting for a switches and corresponds to the 
  630. attribute not being present in the tag. 
  631.  
  632. A few properties are changed implicitly by the dropping things on an object. 
  633. For example, dropping a GIF file on the Document object changes the Background 
  634. property and produces Netscape/HTML3 backgrounds. The Title of the Document or 
  635. of a Section appears both as a property and as the caption of the Workarea 
  636. Object. It can be edited by doubleclicking the Section object. 
  637.  
  638.  
  639. ΓòÉΓòÉΓòÉ 2.8.2. New Features ΓòÉΓòÉΓòÉ
  640.  
  641. The HEAD tags are now parsed. Along with the attributes of the BODY tag, they 
  642. generate attributes of the document. Support is provided for BASE, ISINDEX, 
  643. LINK (REV=HOME,TOC,INDEX, GLOSSARY, HELP, BOOKMARK), and the BODY Netscape 
  644. attributes for background and color control. META attributes will be added if 
  645. anyone can send me a list. 
  646.  
  647. CODE<BLOCKQUOTE> 
  648. What, Me Worry? 
  649. <CREDIT>Alfred E. Newman 
  650. </BLOCKQUOTE>/CODE 
  651. This construct should be properly supported. At this time, SpHyDir accepts both 
  652. BLOCKQUOTE and BQ but it currently generates BLOCKQUOTE to the output file. 
  653. Although BQ is recommended, it is not supported by all current browsers, while 
  654. BLOCKQUOTE is universal. It has been observed that <CREDIT> is not supported by 
  655. WE. 
  656.  
  657. The sequence: 
  658. CODE<UL>Some text. 
  659. <LI>One. 
  660. <LI>Two. 
  661. </UL>/CODE 
  662. is upgraded so that the isloated text is rendered as 
  663. CODE<LH>Some text.</LH>/CODE 
  664. List header text is displayed as the caption of the List Object and can be 
  665. changed by doubleclicking the object. 
  666.  
  667. Similarly, the construct 
  668. CODE<Table>Some text. 
  669. <TR> etc./CODE 
  670. is upgraded to 
  671. CODE<CAPTION>Some text.</CAPTION>/CODE 
  672. In general, SpHyDir II will put ending tags in all output even when the tags 
  673. can be legally omitted. In general, SpHyDir will put all text in some block, 
  674. with <P>...</P> as the default. In the previous case the <P> is not appropriate 
  675. because <CAPTION> (and <CREDIT>,<LH>, and a few other such things) are 
  676. themselves the block container and are not allowed to contain other blocks. 
  677.  
  678. SpHyDir 1 tried to promote all IMG references to objects. There is a certain 
  679. simplicity when this can be done, because you can drop a GIF file on an IMG 
  680. object to set the file association. However, SpHyDir 1 was therefore unable to 
  681. place IMG references in a Heading or in the middle of a sentence. An IMG can 
  682. now appear in the previously usupported places. In this context, the IMG is 
  683. treated as "honorary text". A dingbat (corresponding to the PC character for 
  684. the value 8) appears before and after the embedded image. Between the dingbats, 
  685. the first word is the name of the GIF file and the remaining text is treated as 
  686. ALT text. 
  687.  
  688. There is currently no nice support for creating new embedded images. It will be 
  689. added by the end of the beta period. For now, you can always type this stuff in 
  690. manually. In the Text editor window, position the insert where you want the 
  691. image to go. Hold down Alt, press the "8" key on the numeric pad, and release 
  692. the Alt key. The dingbat appears. Type the name of the file in the ususal HTML 
  693. format, say "../icons/face.gif". Type alternate text if you choose. End by 
  694. repeating the Alt trick to create a second dingbat. (This can also be used to 
  695. enter other unsupported tags and markup). 
  696.  
  697. No attempt has or will be made to do HTML 3.0 Math markup. No support is 
  698. provided for the horizontal tab <TAB> tag. 
  699.  
  700. FIG has not been attempted this week. It should not be hard, but needs a bit of 
  701. study to get it just right. 
  702.  
  703. It is not clear just how many of the proposed new forms of character emphasis 
  704. should be supported. <DFN>, <Q>, <LANG>, <AU>, <PERSON>, <ACRYONYM>, <INS>, 
  705. <DEL>, <BIG>, and <SMALL> seem to be stretching things a bit. It is not clear 
  706. that all of them will actually survive the standardization process, expecially 
  707. since few browsers do anything particularly meaningful with the HTML 2.0 
  708. character formatting tags that already exist. 
  709.  
  710. Most of the attributes in the HTML 3.0 standard are supported. A bunch of 
  711. Netscape stuff was added, but a few more things are needed before the end of 
  712. the Beta. To know what is supported, select an object of the appropriate type, 
  713. then click the second mouse button on the whitespace of the Properties Table. 
  714. If the attribute doesn't show up in the list, its not supported. Write me about 
  715. it. 
  716.  
  717.  
  718. ΓòÉΓòÉΓòÉ 2.8.3. Table ΓòÉΓòÉΓòÉ
  719.  
  720. A major feature of HTML 3.0 is tables. They allow information to be layed out 
  721. in columns. The rows and columns may have labels. Each cell of the table 
  722. contains any type of document element (paragraphs, images, buttons, etc). 
  723. Architecturally, a table is a two dimensional version of an Unordered List. 
  724.  
  725. Viewed as HTML, Tables involve a large number of confusing tags. They are hard 
  726. to edit by hand. SpHyDir allows you to construct specialized tables, but it 
  727. will automate the process of building simple N by M tables. Even if you want 
  728. something special, like a heading that spans two columns, it may be easier to 
  729. let SpHyDir start by generating the normal table and then change or delete the 
  730. automatically generated entries that you don't need. 
  731.  
  732. When you use the Table Object, a dialog box pops up. During the Beta it is a 
  733. bit cheezy. You can abort the dialog, leave a bare Table object, and add 
  734. elements yourself (or you will if all the elements are available in some 
  735. toolbar). Alternately, specify the number of rows and columns and choose 
  736. whether lables are to be generated or not for each. 
  737.  
  738. A simple 2x3 table might look like: 
  739. CL0 CL1 CL2 CL3 
  740. RL1 X11 X12 X13 
  741. RL2 X21 X22 X23 
  742. Where CL# are the column labels, RL# are the row labels, and X## are the cells. 
  743. HTML is going to ravel this out row by row. The nasty part is getting the tags 
  744. right. If SpHyDir II is asked to construct this table, it will produce a Table 
  745. Object containing three Row Objects. The first Row Object contains the four 
  746. Label Objects for the columns. The second and third Row Objects contain one 
  747. Label Object (the row label) and three Cell objects. Initially, all are empty. 
  748.  
  749.  
  750. TABLE 
  751. ROW 
  752. LABEL (CL0) 
  753. LABEL (CL1) 
  754. LABEL (CL2) 
  755. LABEL (CL3) 
  756. ROW 
  757. LABEL (RL1) 
  758. CELL (X11) 
  759. CELL (X12) 
  760. CELL (X13) 
  761. ROW 
  762. LABEL (RL1) 
  763. CELL (X11) 
  764. CELL (X12) 
  765. CELL (X13) 
  766.  
  767. The table is then filled in by dropping Paragraph Objects (or Image or any 
  768. other document) on each Label and Cell object to provide contents for that 
  769. label or cell. The twelve objects that need to be assigned contents are all at 
  770. the third level of the tree (under the three Row Objects that are in turn under 
  771. the one Table Object). It is fairly easy to see what needs to be done. 
  772.  
  773. During the Beta period, SpHyDir II may not support all the defined table 
  774. attributes. VALIGN, COLSPEC, ROWSPEC need some study. Currently SpHyDir doesn't 
  775. have tools to create new Rows or cells. This is by design. It is the intent of 
  776. the design that the table be expanded by selecting an exising object, clicking 
  777. the second mouse button, and then choosing Create Another from the menu popup. 
  778. If SpHyDir can dope out the table, it would then be able (after asking for your 
  779. intention) to create all of the objects needed for another column or row. 
  780. However this is not currently available. 
  781.  
  782.  
  783. ΓòÉΓòÉΓòÉ 2.8.4. Things ΓòÉΓòÉΓòÉ
  784.  
  785. After learning more about HTML details, it became clear that SpHyDir 1 had made 
  786. a big mistake. List Points should not contain text. Semantically, a proper list 
  787. is of the form: 
  788. <UL> 
  789. <LI><P>First point.</P></LI> 
  790. <LI><P>Second point.<P></LI> 
  791. </UL> 
  792. Nobody ever actually codes a list this way, so it is easy to miss. In HTML 2.0, 
  793. the <LI> and <P> tags have no attributes, so they appear to be redundant. Then 
  794. along comes HTML 3.0. Now proper construction of the list is "Recommended", and 
  795. any tool that plans to read in HTML had better understand this implied 
  796. structure because <LI> and <P> tags now have meaningful attributes. The SpHyDir 
  797. 1 view that a List Point object contained the text of the implied paragraph has 
  798. now become unworkable. 
  799.  
  800. When SpHyDir II reads a document with lists, it creates a second level of tree 
  801. indentation. The List object contains Point objects, and each Point object now 
  802. contains paragraphs and stuff. You can no longer doubleclick a Point to get the 
  803. Text Edit window. 
  804.  
  805. Since the opportunity presented itself, a Point in a definition list has as one 
  806. of its properties the term from the <DT> clause. This can be changed with the 
  807. Properties Table. 
  808.  
  809. This mess had to get cleared up before it was possible to do tables. A Table 
  810. looks like a List. The Points of the Table are Rows which are themselves like a 
  811. nested List. The Labels and Cells act like points. If this thing was going to 
  812. be added, then the original List Points had to get cleared up. 
  813.  
  814. This produces a generalization about Things that contain Stuff. In addition to 
  815. the obvious Things (the Document, Section objects, and the three types of 
  816. Lists) there are ten other Things that contain other objects: Points, Table 
  817. Cells, ADDRESS, BLOCKQUOTE, DIV, FIG, FN, NOTE, BANNER, and CENTER. It did not 
  818. seem to make sense to structurally distinguish DIV and BANNER (a few months ago 
  819. they were merged in an earlier version of the HTML proposal). CENTER is an 
  820. obsolete construct that has not been cleanly replaced. Points, Cells, Address, 
  821. and BlockQuote seem to need their own objects. The rest SpHyDir II will try to 
  822. collect under the category of a GROUP object. The icon for a group is a 
  823. brightly colored Folder. It is an objective that Group become an option of the 
  824. second mouse button popup menu for the workarea when items are marked. Choosing 
  825. Group will create a new Group item and place all the marked objects in the 
  826. group. The collection can then be assigned properties by assigning the property 
  827. to the Group that contains in. In particular, this is the preferred way to 
  828. center a collection of things. 
  829.  
  830. There may be a transition during the Beta period for anyone using the previous 
  831. SpHyDir 1 haphazard approach to <CENTER>. In a few weeks, SpHyDir will have dug 
  832. itself out of the hole. Lacking any Group object, SpHyDir 1 assigned a Centered 
  833. attribute to every object between <CENTER> and </CENTER>. The new thinking 
  834. holds that if you chose to center a collection of objects, then the objects 
  835. must collectively form a group with common properties. So SpHyDir will create 
  836. the group for you and will use both new <DIV ALIGN=CENTER> and old <CENTER> 
  837. syntax. Currently, however, CENTER may not work right. 
  838.  
  839.  
  840. ΓòÉΓòÉΓòÉ 2.8.5. Internal Reorganization ΓòÉΓòÉΓòÉ
  841.  
  842. There were two key decisions in SpHyDir II. The first was to completely 
  843. reorganize key areas in order to make them ready for Object Oriented 
  844. technology. The second was the choice to stick with existing Rexx and not use 
  845. Object Rexx quite yet. 
  846.  
  847. SpHyDir uses the services of VX-Rexx to store information. The Workarea that 
  848. the user sees is a VX-Rexx container in Tree-Name view. What the user doesn't 
  849. see is that the records in that container contain all the text and attributes. 
  850.  
  851. SpHyDir 1 was designed around the HTML 2.0 standard. Since it was slowly moving 
  852. toward formal adoption, it seemed that any design that handled 2.0 would be 
  853. good enough to last for years. Then the Netscape folks captured a big share of 
  854. the market and pushed the 3.0 features to the front. This added a whole bunch 
  855. of attributes that would break the SpHyDir 1 design for storing information. 
  856. One solution would be to build real Object Rexx classes and store the 
  857. information there. 
  858.  
  859. Instead, SpHyDir II ripped out a lot of ugly, bug prone logic and created a 
  860. simpler (though possibly slightly less efficient) general purpose data store 
  861. within the existing VX-Rexx support. Internal control structures were 
  862. generalized by more agressive use of Stem variables. 
  863.  
  864. SpHyDir 1 processed HTML input and generated HTML output from large SELECT/WHEN 
  865. blocks. SpHyDir breaks this logic into a mass of small subroutines. The 
  866. subroutine names are registered in stem tables indexed by the tag name, the 
  867. attribute name, or the object type. 
  868.  
  869. Rexx doesn't make it easy to initialize large syntax tables. Some tables are 
  870. handled by simply listing all possible words in a character string. Rexx has 
  871. some very nice WORDxxx functions that make it easy to manipulate such strings. 
  872.  
  873. However, such wholesale changes will produce bugs when an isolated piece of the 
  874. old code is missed during the update. A few routines handle most of the logic 
  875. for creating new objects. However, initial debugging discovered that the New 
  876. button in the Text Edit window was a special case that created a new paragraph 
  877. without drag-and-drop or menus. That logic had to be updated also. The Beta 
  878. period should identify any other special cases that slipped through the cracks. 
  879.  
  880.  
  881. ΓòÉΓòÉΓòÉ 2.9. May 28 Release ΓòÉΓòÉΓòÉ
  882.  
  883. IBM release Web Explorer Beta (5/25) Friday. It creates URL-file objects that 
  884. can be dragged from WE to a disk directory to save interesting Web locations in 
  885. WPS. You can drag these URL objects from WPS and drop them on SpHyDir objects 
  886. to create Links, just as you previously dropped Link Manager URLs and XSpOs. 
  887.  
  888. A ToolChest Window has been added. The ToolChest is a container that is 
  889. intended to provide an extension or alternative to the current Toolbar. 
  890. Currently, however, the ToolChest simply duplicates a subset of the Toolbar 
  891. objects (though it adds descriptive captions missing from the Toolbar). 
  892.  
  893.  
  894. ΓòÉΓòÉΓòÉ 2.9.1. Preserve Entities in HTML ΓòÉΓòÉΓòÉ
  895.  
  896. In HTML, an "entity" is a special character represented by a name preceeded by 
  897. "&" and ending in ";". Because they have special significance to the syntax, 
  898. "<", ">", and "&" must be represented in HTML documents as "<", ">", and 
  899. "&". SpHyDir previously supported only these three entities, based on the 
  900. incorrect assumption that all the other entities existed only to support ISO 
  901. accented characters that would be better displayed using the international 
  902. character set. However, ISO editing got put off, and a more careful examination 
  903. of HTML 3.0 entities shows that they will include ISO, Greek, math, dingbats, 
  904. and many other characters not found in any single code page. To allow simple 
  905. editing of the "&" character, SpHyDir has to change the introducer to some 
  906. funny character. Therefore, as HTML is parsed in an the leading "&" is 
  907. converted to the 0x01 ("smiley face") PC character and it is converted back to 
  908. "&" on output. There is no explict GUI support for entities, but as with any 
  909. funny character you can enter it from the keyboard. To get a copyright symbol Γòò 
  910. hold down ALT, press the 1 key on the numeric pad, then release ALT (now you 
  911. have a smiley face) then type the name "copy" and a trailing ";". Funny 
  912. characters can be deleted or edited just like any other character. 
  913.  
  914.  
  915. ΓòÉΓòÉΓòÉ 2.9.2. ../ICONS/tiger.gif Image Left of Heading ΓòÉΓòÉΓòÉ
  916.  
  917. Although it doesn't solve the entire problem, SpHyDir now has limited support 
  918. for putting an image in a Section title. It allows one image to appear in front 
  919. of the title. Worse, except for the H1 at the start of the document, you cannot 
  920. create this construction with normal SpHyDir drag and drop but instead have to 
  921. (ick) edit the HTML file with a plain text editor. Clearly there is room for 
  922. improvement. In HTML terms, the construct looks like the following (from the 
  923. PCLT home page): 
  924. <H1 > 
  925. <IMG SRC="exitsign.gif" ALIGN=MIDDLE WIDTH="218" HEIGHT="171"> 
  926. Welcome to PC Lube and Tune </H1> 
  927. The <IMG> tag has to come after the <Hn> and it must have an ALIGN value 
  928. (MIDDLE generally looks best). To put an image in front of the H1 tag in the 
  929. document, drag the Image Object from the toolbar and drop it on the Document 
  930. Object. The Image Object will be created just before the first Section object. 
  931. Now drop a GIF file on the Image Object and set its ALIGN attribute to MIDDLE 
  932. (or TOP or BOTTOM). 
  933.  
  934. Once the Image is set up, it will be read in by SpHyDir and regenerated 
  935. properly. So the worst case it to manually set it up once. 
  936.  
  937.  
  938. ΓòÉΓòÉΓòÉ 2.10. SpHyDir II - Statement of Direction ΓòÉΓòÉΓòÉ
  939.  
  940. When SpHyDir was first created, some objectives were announced in the 
  941. documentation. Subsequent developments have show some of these claims to be ill 
  942. advised. It seems appropriate to provide users with advance warning of a change 
  943. in direction. The term "SpHyDir II" is now being introduced to reflect some new 
  944. ground rules that will be required to make further progress. 
  945.  
  946. The biggest mistake was to promise that SpHyDir would generate HTML that would 
  947. pass through a validator. Effectively, that ties it to HTML 2.0 syntax (for 
  948. which there are standards) at a time when eveyone is moving rapidly to HTML 3.0 
  949. or "Netscape" extensions long before rigourous validation is possible. SpHyDir 
  950. users, or at least the more vocal of them, want the extensions now. 
  951.  
  952. There seems to be no limit on the number of structures that HTML can include, 
  953. nor the number of attributes that will be added to HTML tags. There is no room 
  954. at the top of the screen in the Toolbar or entry fields for everthing that the 
  955. new language features support. If the number of features grows much larger, 
  956. than simple icons will not be enough to remember what's what. Furthermore, 
  957. users are asking for specialized features that may require user customization. 
  958.  
  959. At the same time, HTML remains a poorly specified language. Important syntax 
  960. changes occur from one version to the next. There are some differences between 
  961. the "human" explanation of what is going on and the formal syntax descriptions. 
  962. But the most important feature is that there is an enormous amount of invalid 
  963. HTML on the Web that is accomodated because the mistakes don't prevent the 
  964. browsers from displaying the correct image to users, and the final image is the 
  965. only thing than seems to count. Worse, the standards documents explicitly 
  966. mention common invalid constructions and urge browsers to accomodate them. 
  967.  
  968. When people are first learning C, it is a common mistake to code 
  969. if (a=5) ... 
  970. when the correct statement is 
  971. if (a==5) ... 
  972. Yet no matter how common the error is, nobody would expect a C compiler to 
  973. accomodate the user and automatically "correct" the program. Yet Web tools are 
  974. expected, perhaps even required, to accomodate HTML syntax violations. Yet 
  975. SpHyDir cannot advance to support more complicated syntax without some rigour. 
  976.  
  977. Sphydir has to resolve a conflict between two goals: 
  978. <UL> 
  979. <LI>To support the common use of ordinary people. 
  980. <LI><P>To encourage "recommended" practice</P></LI> 
  981. </UL> 
  982. HTML has levels of conformance. "HTML.Recommended" holds that text should be 
  983. contained in a block (P, PRE, BQ) instead of standing alone. The "<LI>text" 
  984. construction is thus not "Recommended" but is widely used. There is an 
  985. important difference between the human explanation of what is going on here and 
  986. the semantic difference. 
  987.  
  988. Books and articles on the "Complete Moron's Guide to HTML" will divide tags 
  989. into those that create paragraphs breaks (P, H1..H6, CENTER, UL, OL, DL, LI, 
  990. HR, etc.) and those that don't (B, I, A, IMG). BR creates a line break but not 
  991. a paragraph break, though <BR><BR> might be hard to distinuish visably on most 
  992. browsers. The non-rigourous explanation would be that <LI><P> seems redundant 
  993. because <LI> itself generates the necessary break. 
  994.  
  995. HTML is rigourously defined in a document called the "DTD". The DTD defines a 
  996. %block as a P, UL, OL, DL, PRE, BQ, FORM, etc. At the Recommended level, a UL 
  997. contains LI structures, and an LI contains %blocks. At the Recommended level, 
  998. ordinary text is not supposed to be in the document BODY or in a list or list 
  999. element. It is only supposed to appear as the contents of a P, PRE, BQ, header, 
  1000. etc. The DTD identifies "<LI>text" as not Recommended, but it doesn't specify 
  1001. what to do about it. 
  1002.  
  1003. The DTD allows some ending tags to be omitted. The effect of a previous tag 
  1004. ends when a new tag is encountered that cannot be contained within the current 
  1005. structure. Thus "<LI> [stuff] <LI>" implies "<LI> [stuff] </LI><LI>" because 
  1006. one list item cannot occur within the previous list item. 
  1007.  
  1008. Having said this, there is not one shred of usable standard to transform 
  1009. tolerated HTML into Recommended HTML. 
  1010. <LI>Speak softly and carry a big stick</LI> 
  1011. <LI><P>Speak softly and carry a big stick</P></LI> 
  1012. Once the leading <P> is added, the ending </P> can be deduced because the </LI> 
  1013. cannot be inside the paragraph. However, no amount of DTD will every explain 
  1014. why the free text in the list item should have been turned into a paragraph in 
  1015. the first place. This is reasonable, because the reader could argue that 
  1016. BLOCKQUOTE is a justifiable alternative to the P tag in the case of this 
  1017. particular famous phrase. 
  1018.  
  1019. SpHyDir can only accomplish its original objective if its HTML parsing is 
  1020. heuristic. A parse that is driven simply by syntax tables will not be quite 
  1021. enough. This means that SpHyDir will keep, though it ought to clean up, its 
  1022. current logic in the Read_HTML and Parse_Block routines. 
  1023.  
  1024. At the same time, SpHyDir won't really work as an object oriented environment 
  1025. unless users can create their own objects. Sometimes people want to support new 
  1026. or experimental tags. Sometimes an author uses the same special construction in 
  1027. all documents. There have been requests, for example, for a document toolbar 
  1028. object of the form: 
  1029. <P><A HREF= ><IMG SRC= ></A>...<A HREF= ><IMG SRC= ></A></P> 
  1030. One can imagine creating this with an XSpO (an external Rexx 
  1031. program dropped onto the Workarea), but it would then lose its identity. HTML 
  1032. 3.0 provides the solution with the CLASS attribute. 
  1033. <P CLASS="TOOLBAR"> 
  1034. <A HREF= ><IMG SRC= ></A>... 
  1035. <A HREF= ><IMG SRC= ></A> 
  1036. </P> 
  1037. CLASS allows most block tags to be assigned a user specified category name. 
  1038. CLASS definitions are intended to be hierarchical and there is some implication 
  1039. in the standard of one class being derived from another with inheritance. 
  1040.  
  1041. SpHyDir can also make object distinctions based on the value of other 
  1042. attributes in the tag. For example, the current code distinguishes between 
  1043. <BR>, which is treated as part of paragraph text, and <BR CLEAR=ALL> which is 
  1044. treated as an document object like <HR>. 
  1045.  
  1046. The proposal, then, is to allow new SpHyDir objects to be defined externally. 
  1047. The new objects would appear in the ToolChest Container window (maybe in the 
  1048. menu popup if it can be changed dynamically). New objects would be recognized 
  1049. as the HTML is read in by a new Tag name, the presence of an attribute or a 
  1050. special value assigned to an attribute on an existing tag, or a CLASS attribute 
  1051. specification. This is not designed to allow SpHyDir to assign user defined 
  1052. objects to raw HTML from external sources. The only claim is that SpHyDir 
  1053. should be able to read back HTML that it had previously written and recognize 
  1054. and redisplay extended constructions. 
  1055.  
  1056. Simple user objects could be defined based on the fundamental attributes that 
  1057. SpHyDir currently potentially assigns to each object (an icon, caption, text 
  1058. content, name, variable name, variable value, etc.). Objects could also be 
  1059. define that contain other objects from a certain set of types. In its simplest 
  1060. version, this will be used to create "macros". For example, a SECTION-like 
  1061. object could be created named CHAPTER. It would be managed like an ordinary 
  1062. SECTION, but it would generate something more complicated: 
  1063. <DIV CLASS="CHAPTER" CLEAR="ALL"> 
  1064. <HR SIZE=6> 
  1065. <H1 ALIGN="CENTER">This is the ordinary Section title</H1> 
  1066. [ordinary section contents] 
  1067. </DIV> 
  1068. The second time through, SpHyDir II will recognize its own construction by the 
  1069. DIV tag with the CHAPTER class. It will match up the </DIV> ender to determine 
  1070. the scope. It then has to suck up and discard the boilerplate tags (the HR 
  1071. SIZE=6 in this case). Although there is a HR object in the SpHyDir vocabulary, 
  1072. this particular HR is part of the formal expansion of a CHAPTER object and 
  1073. should not generate a separate object. Except in the HTML that it generates, 
  1074. the CHAPTER object would then behave in every way as if it were the existing 
  1075. SECTION object. 
  1076.  
  1077. Now comes the trickey part. Programmers should instantly recognize that, in 
  1078. object oriented lingo, this example creates the CHAPTER class as a subclass of 
  1079. the SECTION class inheriting SECTION's methods (mostly the way to edit titles 
  1080. and its behavior as a container) but overriding a few methods (HTML parsing and 
  1081. generation). It seems likely that many new objects will have behavior exactly 
  1082. modelled on Paragraph, Section, or Image objects. SpHyDir might add a few new 
  1083. built-in objects on which new things can be constructed. However, full 
  1084. implementation of the concept will require that everything be rewitten in 
  1085. Object Rexx, and that will be disruptive enough to be put off until it is 
  1086. unavoidable. 
  1087.  
  1088. SpHyDir has not dependencies on other programs, through it is distributed with 
  1089. a few utilities (GBM, RCS) that have proven useful. However, the new release of 
  1090. GOSERVE (2.30) is getting too slick to ignore. Since GOSERVE uses Rexx, and 
  1091. SpHyDir is written in Rexx, a closer relationship should be worked out between 
  1092. the two programs. 
  1093.  
  1094. Currently, when SpHyDir wants to test a document, it calls Web Explorer or 
  1095. Netscape with its local file name. However, hyperlinks from this first document 
  1096. will not work if they are designed for another server and have fully qualified 
  1097. URL's or if the document contains a BASE statement with the production server's 
  1098. name. This made support for BASE a long requested but seemingly impossible 
  1099. objective. 
  1100.  
  1101. Any machine running SpHyDir can probably run GOSERVE in the background. GOSERVE 
  1102. can be told to serve documents out of the HTMLLIB directory tree. The final 
  1103. trick is to override the name of the production server machine with a pointer 
  1104. to the local loopback IP address. This can be accomplished by adding an entry 
  1105. in the \TCPIP\ETC\HOSTS file with values like: 
  1106. 127.0.0.1 sphydir 
  1107. 127.0.0.1 pclt.cis.yale.edu 
  1108. If TCP/IP is set to check the HOSTS file first, then with this entry any URL 
  1109. for "http://pclt.cis.yale.edu/pclt/sphydir/status.htm" will be redirected to 
  1110. the GOSERVE running on the local machine, which will then fetch 
  1111. pclt/sphydir/status.htm out of the HTMLLIB directory. BASE will then work, and 
  1112. all the URL's that point back to PCLT work. Of course, to FTP files to the real 
  1113. PCLT server I need to use a different alias for that machine (or temporarily 
  1114. change the HOSTS file). 
  1115.  
  1116. GOSERVE also provides an environment to test FORMS and CGI-like programming. 
  1117. Some days it seems like an HTML form displayed on the Web Explorer window would 
  1118. be a more flexible way to choose options and configure SpHyDir or document 
  1119. objects than popup VX-Rexx windows. 
  1120.  
  1121. In any event, future releases of SpHyDir may move toward almost requiring that 
  1122. GOSERVE and either Web Explorer or seamless Netscape be running. 
  1123.  
  1124.  
  1125. ΓòÉΓòÉΓòÉ 2.11. May 15 Release ΓòÉΓòÉΓòÉ
  1126.  
  1127. Document Objects now have a popup menu. Click the second mouse button to 
  1128. display Open, Settings, Insert, Create Another, Mark, Delete, etc. Insert 
  1129. provides a quick way to add a new Paragraph, Image, Point, or List without 
  1130. going to the Toolbar. You can also Insert a Horizontal Rule for which there is 
  1131. no tool (though you have been able to generate it with ALT-H for quite some 
  1132. time). Create Another creates a second object like the current object (say 
  1133. another paragraph or point). Mark duplicates the old Alt-L. Delete duplicates 
  1134. the old Ctrl-D. Currently you can only Open the contents of the object 
  1135. (duplicates current DoubleClick function). Settings is under construction. 
  1136.  
  1137.  
  1138. ΓòÉΓòÉΓòÉ 2.12. May 8 Release ΓòÉΓòÉΓòÉ
  1139.  
  1140. SpHyDir now refreshes the title of a subdocument as it reads the parent file 
  1141. in. Thus if you change the title of a subdocument, the pointer to it will be 
  1142. changed the next time that the parent (or the entire tree) is processed. 
  1143.  
  1144.  
  1145. ΓòÉΓòÉΓòÉ 2.12.1. Test (F5) ΓòÉΓòÉΓòÉ
  1146.  
  1147. The File-Test (F5) operation now dynamically communicates to running copies of 
  1148. popular browsers. SpHyDir first generates a temporary copy of the document in 
  1149. TEMPDOC.HTM in the HTMLLIB root directory. In previous releases it then started 
  1150. Web Explorer to view the document. Now this is the last alternative. Before 
  1151. launching a new WE, SpHyDir now tries two things: 
  1152.  
  1153.    1. SpHyDir first attempts to establish a DDE link with a running copy of 
  1154.       Netscape. For this to be useful, Netscape should be running in seamless 
  1155.       WINOS2 mode. SpHyDir passes Netscape a request to display the Tempdoc 
  1156.       file. 
  1157.  
  1158.    2. If Netscape is not found, then SpHyDir looks through the windows on the 
  1159.       screen for a running version of Web Explorer. If one is found and it is 
  1160.       already viewing an older version of TEMPDOC, then SpHyDir sends it a F5 
  1161.       to refresh the document. If it is running and viewing something else, 
  1162.       SpHyDir enters the name and path of TEMPDOC in its entry area and sends 
  1163.       an Enter key. 
  1164.  
  1165.  Netscape has known problems running seamless on OS/2. Fortunately, the most 
  1166.  serious issues involve user interaction with the menus. By controlling 
  1167.  Netscape from SpHyDir, interaction is minimized. However, the code to control 
  1168.  both Netscape and WE is new and may require some fine tuning. 
  1169.  
  1170.  
  1171. ΓòÉΓòÉΓòÉ 2.12.2. The BR Object ΓòÉΓòÉΓòÉ
  1172.  
  1173. The design of a <BR> object finally became clear when a user reported by EMail 
  1174. that he was having trouble with Netscape extensions. Normally, an Image either 
  1175. appears by itself or is aligned with a single line of text. The Netscape 
  1176. ALIGN=LEFT (which SpHyDir has "supported" from the start) causes multiple lines 
  1177. of text to flow through the space left to the right of the image. 
  1178. Unfortunately, this option doesn't just flow text. it also "sucks up" any 
  1179. following images. The Netscapism for breaking this pattern and starting the 
  1180. next line under the image is to add a <BR CLEAR="ALL"> tag. 
  1181.  
  1182. I have previously noted the need for a <BR> object to separate buttons in a 
  1183. form. The problem ws to distinguish when reading in the HTML a <BR> acting as 
  1184. an object from a <BR> in the middle of a paragraph that acts instead like a 
  1185. character or as a CR/LF pair. Although SpHyDir has tried to avoid non-standard 
  1186. HTML, it seems very compact to declare that <BR CLEAR="ALL"> would be 
  1187. recognized as the Object and plain <BR> as the character. 
  1188.  
  1189. Browsers should ignore attributes they don't understand. The only problem 
  1190. occurs if you try to validate HTML that contains Netscape extensions with a 
  1191. validator looking for HTML 2.0. If you don't want <BR CLEAR="ALL">, then don't 
  1192. create the object. Incidentally, to create such a tag, position at the next 
  1193. object and press Alt-B. The BR Object will be positioned in front of the 
  1194. currently selected object. For the most part, the BR and HR objects are very 
  1195. similar. Neither has a specific icon at the moment. 
  1196.  
  1197.  
  1198. ΓòÉΓòÉΓòÉ 2.12.3. Backup using RCS ΓòÉΓòÉΓòÉ
  1199.  
  1200. Backup of HTML files has been a serious issue. First, SpHyDir cannot be subject 
  1201. to terribly aggressive testing between weekly releases. If a syntax error 
  1202. occurs, SpHyDir can abort in the middle of writing a file. If SpHyDir 
  1203. encounters HTML that it doesn't recognize, information can be lost. The 
  1204. previous strategy of saving the old copy of the file in the BACKUP directory 
  1205. addressed only part of the problem. SpHyDir now introduces the heavy artillery. 
  1206.  
  1207. For other text files, the most powerful free software system is the RCS version 
  1208. control package from Unix. When fully exploited, it allows several people to 
  1209. check out and work on files in a shared library. It remembers changes to the 
  1210. file and who made the changes. It is possible to reconstruct older versions of 
  1211. the data if something goes wrong. 
  1212.  
  1213. Use of RCS is optional. If it is not used, SpHyDir continues to make a copy of 
  1214. the previous version of the file in the BACKUP subdirectory. 
  1215.  
  1216. For each original data file, RCS builds a control file that keeps a copy of its 
  1217. current contents and the information needed to recover any previous versions. 
  1218. The first version is "1.1" and each time the file is changed a new version 
  1219. number is generated. 
  1220.  
  1221. By default, RCS will archive f:\pclt\sphydir\status.htm in a control file named 
  1222. f:\pclt\sphydir\RCS\status.htmv. That is, it stores files in the RCS 
  1223. subdirectory of the path where the data file is found, and it adds the suffix 
  1224. character "v" to the file type. 
  1225.  
  1226. Some future version of SpHyDir may maintain enough variables for a document to 
  1227. allow individual decisions about what to manage under RCS. Currently, however, 
  1228. if you use RCS at all you have to use it as the backup for the entire library. 
  1229. SpHyDir is triggered to use it if there is an RCS subdirectory under the 
  1230. HTMLLIB root. On my machine, "f:\pclt" is the the HTMLIB for PCLT articles, so 
  1231. SpHyDir looks for "f:\pclt\RCS" to decide to use RCS, for all of the documents 
  1232. in all of the directories under f:\pclt. 
  1233.  
  1234. Unexpectedly, RCS will not create the needed subdirectory automatically, and it 
  1235. will not quite work correctly if the subdirectory doesn't exist. A future 
  1236. version of SpHyDir may fix this, once I develop more confidence about the best 
  1237. arrangement. For now, manually create RCS subdirectories throughout your 
  1238. HTMLLIB tree if you intend to use this facility. If you forget, RCS will create 
  1239. the control file in the same directory as the data file and you can create the 
  1240. RCS subdirectory and move the file to it later on. This is not a problem on 
  1241. HPFS volumes, but it could present an issue on FAT directories where "HTMV" 
  1242. might get truncated to "HTM". RCS backup is probably not a good idea for 
  1243. SpHyDir users with only FAT directories. 
  1244.  
  1245. Before generating new HTML, SpHyDir backs up the previous version of a file by 
  1246. issuing the command: 
  1247. ci -xv -l - m"backup" -t-"backup" xxxx.htm(l) 
  1248. This runs CI.EXE (Check In) of the RCS version control system. The -m and -t 
  1249. parameters provide dummy log messages so the program does not prompt for a 
  1250. description of changes or of the file. The -l parameter checks the file back 
  1251. out immediately (so that it remains in the library and can be rewritten). The 
  1252. -xv adds a "v" letter on the end of the file type (htmv or htmlv) to provide 
  1253. the file type of the RCS control file. 
  1254.  
  1255. SpHyDir does not check the PATH for a copy of the RCS executables. It tries to 
  1256. use RCS based on the existence of a directory in HTMLLIB. It is the user's 
  1257. responsibility to install RCS on the OS/2 system before using this facility. 
  1258. Unzip the RCS567PC.ZIP distribution file and copy the contents of the BIN32 
  1259. subdirectory to a library in your PATH. RCS is now available on the same FTP 
  1260. file servers as SpHyDir itself. 
  1261.  
  1262. SpHyDir is using RCS to provide a super safe backup, not to do true version 
  1263. control. There is no provision to check out locked files, or to check in and 
  1264. unlock a final version. However, the user can build real version control 
  1265. outside SpHyDir by issuing RCS commands before or after running SpHyDir to 
  1266. provide real parameters and version numbers. 
  1267.  
  1268. RCS is a serious system with some heavy duty manuals. SpHyDir's only direction 
  1269. function is to call CI.EXE to generate the backup. Comparing different versions 
  1270. of a file, or recovering old versions from the backup, requires direct use of 
  1271. the other RCS commands. RTFM. If RCS appears to be too complicated, feel free 
  1272. to continue to use the old SpHyDir BACKUP. 
  1273.  
  1274. Use of RCS was requested in E-mail by a user several weeks ago. Initially it 
  1275. seemed like a really bad idea. The problem is that RCS and all the other 
  1276. version control systems have this view of tracking changes by line. Since 
  1277. SpHyDir only puts a CR/LF line break at the end of paragraphs, it appears to 
  1278. have really, really long lines. Change one word, and RCS regards the entire 
  1279. paragraph as changed. Flowing the text into 80 character lines would not make 
  1280. much difference, because any change in one section will flow changes onto all 
  1281. the subsequent lines of the paragraph. However, there are no better version 
  1282. control mechanisms, and after some consideration the long lines do not appear 
  1283. to be unworkable. 
  1284.  
  1285. Before reporting any bugs, please realize that the version being "checked in" 
  1286. to RCS is not the version on the screen. What is being checked in is the old 
  1287. version on disk from before the current edit session. So if you read a file in, 
  1288. make a ton of changes, press F2 to save it, and look at the Console window, do 
  1289. not be surprised it it reads: 
  1290. F:\PCLT\sphydir\RCS/STATUS.HTMv <-- F:\PCLT\sphydir\STATUS.HTM 
  1291. file is unchanged; reverting to previous revision 1.3 
  1292. It is not saying that there are no changes in the current version, just that 
  1293. there were no changes in the old version that you are just about to replace. 
  1294.  
  1295. RCS is a Unix utility that has been ported to the OS/2 environment using the 
  1296. EMX package. EMX is a version of the GNU development tools and the GCC 
  1297. complier. These tools are normally found in the /unix subdirectory of the OS/2 
  1298. files at ftp.cdrom.com and ftp-os2.nmsu.edu. The minimum files needed are the 
  1299. EXM runtime DLL library (emxrt.zip) and the RCS distribution (rcs567pc.zip). 
  1300. They will also be added to the SpHyDir FTP directory. 
  1301.  
  1302. This facility is currently more "experimental" than the rest of SpHyDir, so its 
  1303. output is not captured. The CI command writes to "standard output" and VX-Rexx 
  1304. captures that file and displays it in the VX-Rexx Console window. If the 
  1305. service seems to work well, this output will be supressed in a future release. 
  1306. Meanwhile, the Console window will have to be manually closed when SpHyDir 
  1307. ends. 
  1308.  
  1309.  
  1310. ΓòÉΓòÉΓòÉ 3. SpHyDir Project Objectives ΓòÉΓòÉΓòÉ
  1311.  
  1312.     
  1313.  
  1314.        Produce the highest quality HTML documents automatically. Upgrade 
  1315.       obsolete syntax to current "Recommended" practice. Add additional markup 
  1316.       to get the best possible results on all known viewers. Provide a 
  1317.       transition to new standard features. 
  1318.  
  1319.     
  1320.  
  1321.        Build larger documents from many small, structurally interrelated 
  1322.       hypertext files. Easily generate links to other files, to target lables 
  1323.       in certain files, and to remote documents (by extracting URL references 
  1324.       while a Browser displays the remote file). 
  1325.  
  1326.     
  1327.  
  1328.        Present an entirely different approach to Web document construction. 
  1329.       Microsoft and Word Perfect have interfaces from their Word Processors. 
  1330.       Oracle promises an interface from Oracle Book. HTML editors are being 
  1331.       written all the time. If SpHyDir isn't completely different (and IMHO 
  1332.       better) then it isn't worth the effort. 
  1333.  
  1334.     
  1335.  
  1336.        Automatically generate navigational links, copyright notices, and other 
  1337.       standard features at the beginning or end of every document. 
  1338.  
  1339.     
  1340.  
  1341.        Support all the features of HTML 3.0 and common Netscape extensions. 
  1342.       Provide for user extensions both to document structure and library 
  1343.       management. 
  1344.  
  1345.     
  1346.  
  1347.        Provide direct links to Netscape and Web Explorer to test document 
  1348.       changes. SpHyDir is not WYSIWYG, but you can immediately format what you 
  1349.       are structurally editing to see how it will look. 
  1350.  
  1351.     
  1352.  
  1353.        Simplify the construction of data entry forms (entry fields, check 
  1354.       boxes, radio buttons, push buttons) and tables. 
  1355.  
  1356.   SpHyDir II supports all the tags and attributes of the current HTML 3.0 draft 
  1357.  standard. SpHyDir should be able to process any Web document that uses these 
  1358.  features correctly and in context. However, HTML is a formatting language and 
  1359.  SpHyDir is a document structure tool. Incorrect syntax, or the use of a tag 
  1360.  out of context to achieve a particular effect, can confuse the analysis. In 
  1361.  particular, the use of <H6> to get "fine print" where no heading is actually 
  1362.  intended will certainly produce bad results. 
  1363.  
  1364.   SpHyDir II is Object Oriented. It examines an input HTML document and 
  1365.  produces a tree of Objects that corresponds to the apparent document 
  1366.  structure. The simplest Object is a paragraph that contains text. Other 
  1367.  objects include the Image (for inserted graphics), order and unordered Lists, 
  1368.  Tables, Forms, Horizontal Rules, etc. 
  1369.  
  1370.   Each object has properties. There is a fairly close tie between the 
  1371.  Properties of an Object (in SpHyDir) and the Attributes of a Tag (in HTML). 
  1372.  When an object is selected in the tree, its properties are displayed in the 
  1373.  Properties Table. This behavior is intentionally modelled on tools like Visual 
  1374.  Basic and Delphi. However, since most HTML attributes have default values that 
  1375.  can be ignored, the SpHyDir properties table only shows the items that have 
  1376.  been assigned an explict value. 
  1377.  
  1378.   The casual user can concentrate on text, graphics, and basic document 
  1379.  structure (sections, lists of points, hypertext links). If more advanced 
  1380.  features become needed, SpHyDir can display all the legal properties that any 
  1381.  object is permitted. For example, any Paragraph can have an ID (jump-to 
  1382.  label), ALIGN (LEFT|CENTER|RIGHT|JUSTIFY), CLEAR (LEFT|RIGHT|ALL), and NOWRAP. 
  1383.  SpHyDir will list the common standard values but allows the user to type in 
  1384.  other values (such as entering "100 pixels" as the value of the CLEAR 
  1385.  property). 
  1386.  
  1387.   With this approach, SpHyDir doesn't require the user to be familiar with 
  1388.  HTML, but it also doesn't prevent the HTML expert from using the more obscure 
  1389.  language options. The author can "ease into" advanced features. 
  1390.  
  1391.  
  1392. ΓòÉΓòÉΓòÉ 4. The SpHyDir Idea ΓòÉΓòÉΓòÉ
  1393.  
  1394.  To create a personal home page or an ad layout, one must concentrate on 
  1395. graphic layout. To publish a large body of useful, interrelated information on 
  1396. the Web, it is more important to focus on content and the organization of the 
  1397. entire library. This is the purpose of PC Lube & Tune and so it is the design 
  1398. objective of SpHyDir. 
  1399.  
  1400.  The SpHyDir program icon is configured with the path to a library of Web 
  1401. files. SpHyDir will only edit files and build links to the subdirectories that 
  1402. fall under that starting point (the "HTML Library"). To edit a file, drop its 
  1403. icon into the SpHyDir workarea window. 
  1404.  
  1405.  SpHyDir reads in the HTML and converts it to a sequence of Document Objects. 
  1406. These Objects correspond to paragraphs, images, sections (chapters, topics), 
  1407. numbered lists, bullet lists, tables, and so on. The Objects are arranged in a 
  1408. tree, because the document contains chapters, the chapters contain paragraphs, 
  1409. images, and lists, the lists contain points, and so on. 
  1410.  
  1411.  Most of the objects that SpHyDir creates correspond directly with elements of 
  1412. the HTML language. A few have to be invented and several more have to be 
  1413. guessed. The future HTML standard (3.0) will include Divisions that break the 
  1414. document up into chapters. Current HTML (2.0) doesn't support this, and few Web 
  1415. documents include the HTML 3 features. So SpHyDir has to invent the "Section" 
  1416. object by looking for Header tags that are part of the 2.0 standard. The 
  1417. assumption is that a Header normally starts something. Therefore, everything 
  1418. after a Header (up to the next Header of the same type) must be a Section of 
  1419. the document. 
  1420.  
  1421.  At first the SpHyDir objects may seem a bit awkward. Dividing everything up 
  1422. formally into paragraph objects and list objects is more precise than normal 
  1423. word processing. However, once SpHyDir has decomposed the original HTML into 
  1424. document objects, and those objects have been updated, SpHyDir is now in a 
  1425. position to generate a document with flawless, precise HTML syntax. There are a 
  1426. lot of erroneous documents in the Web. Some documents display correctly on one 
  1427. browser but are wrong on another browser. Few Web authors are HTML experts, and 
  1428. there are many misunderstandings. SpHyDir converts the HTML to something that 
  1429. most people instinctively understand (chapters, paragraphs). In many cases it 
  1430. will upgrade obsolete or "deprecated" HTML elements to current "recommended" 
  1431. use. 
  1432.  
  1433.  
  1434. ΓòÉΓòÉΓòÉ 5. SpHyDir is not for Everyone ΓòÉΓòÉΓòÉ
  1435.  
  1436.  HTML marks up documents so that they look good. SpHyDir assumes that the 
  1437. markup corresponds to valid document structure. Some things display nicely but 
  1438. are impossible to structure. For example, because <H6> produces very tiny text, 
  1439. it is sometimes used to get "fine print": 
  1440. <H2>Lease a new car for $200 a month<H2> 
  1441. <H6>engine not included<H6> 
  1442. SpHyDir requires that all H1..H6 tags be used to start sections. Also SpHyDir 
  1443. doesn't preserve the heading numbers, just their relative position compared to 
  1444. each other. In the previous example, SpHyDir would change the H6 to an H3 
  1445. because that is the next number down from H2. 
  1446.  
  1447.  A large number of Web documents have invalid HTML. They display as intended 
  1448. because the browsers don't complain about errors that do not effect formatting. 
  1449. For example, when someone wants to print in big letter, they frequenly use 
  1450. heading tags: 
  1451. <H1>Get Rich Quick<P>Act Now<P>Limited Time Offer</H1> 
  1452. <P> tags are not permitted inside a header, but most browsers tolerate this 
  1453. construction, using H1 to change font and /H1 to revert back to normal size. 
  1454. SpHyDir expects Headings to be a simple character string as the standard 
  1455. specifies. Paragraphs are other types of objects, and headings cannot contain 
  1456. objects. 
  1457.  
  1458.  SpHyDir II attempts to include almost all the valid syntax in HTML 3.0 and 
  1459. Netscape. The Math support will be omitted for a very long time. The FIG 
  1460. structure will be supported when it is more widely used by browsers. Netscape 
  1461. extensions will not be supported when they seem to directly overlap more 
  1462. appropriate HTML 3.0 constructs. 
  1463.  
  1464.  HTML goes through revisions. Old constructions that have been replaced are 
  1465. called "deprecated" in the standard. An even tighter reading of the standard is 
  1466. called "recommended." SpHyDir reads the HTML in, understands it, and then 
  1467. generates new HTML based on the structure. It can automatically upgrade old 
  1468. "deprecated" files to "recommended". For example, it will automatically convert 
  1469. <MENU> and <DIR> to <UL> and will convert <XMP> and <LISTING> to <PRE>. If you 
  1470. want to keep the old stuff as is, then SpHyDir is not the right choice. 
  1471.  
  1472.  There are some constructions that the HTML standard permits, but maybe only 
  1473. because the DTD language in which the standard is written cannot express 
  1474. certain rules well. SpHyDir requires that a Definition List have sequences of 
  1475. one term (DT) and one definition (DD). The Definition can have multiple 
  1476. paragraphs. The sequence: 
  1477. <DT>canned 
  1478. <DD>packaged in a can 
  1479. <DD>fired from a job 
  1480. appears to be techically valid. It even has a certain obvious meaning (one term 
  1481. with two definitions). The HTML DTD standard says that a <DL> tag can only have 
  1482. <DT> or <DD> contents, but it doesn't specify how many or in what order. Some 
  1483. very bad HTML uses <DL><DD> <DD> </DL> to get a certain level of indentation. 
  1484. If you like this sort of thing, find another editor. 
  1485.  
  1486.  SpHyDir "understands" tag names and attributes. The name is the part of the 
  1487. tag that follows "<" and the attributes follow the name as either a keyword or 
  1488. keyword, equals sign, and a value. If SpHyDir doesn't explicitly support the 
  1489. tag name, it copies the tag as ordinary text. If it understands the tag name 
  1490. but not the attribute, it discards the attribute. 
  1491.  
  1492.  HTML 3.0 has introduced some attributes whose use is unclear. There is, for 
  1493. example, a LANG attribute that may assign an ISO standard abbreviation for the 
  1494. language and country. According to the standard, "it can be used by the parsers 
  1495. to select language specific choices for quotation marks, ligatures, and 
  1496. hyphenation rules". It is not really clear that this is useful. There is a much 
  1497. stronger requirement, for changing from Latin 1 to other character sets, which 
  1498. is not addressed by this description. SpHyDir may choose to skip features of 
  1499. the HTML 3.0 draft that are unclear or appear poorly thought out. If any user 
  1500. needs an attribute that has been omitted, please E-mail the author with a 
  1501. description of its use. 
  1502.  
  1503.  SpHyDir builds its internal tables keyed to the tag, object, and attribute. 
  1504. Unfortunately, several attribute names have meanings that depend on context. 
  1505. The NAME attribute can be a variable name (in FORMS related objects) or it can 
  1506. be the label of a jump (in the <A> tag). The ALIGN attribute has one set of 
  1507. values for an IMG, a second set for CAPTION, and another set for Paragraphs, 
  1508. Headings, and Divisions. The worst thing, however, is that ALIGN is also a 
  1509. switch that appears with no value in tables. In some contexts SIZE means WIDTH 
  1510. while elsewhere it is HEIGHT. 
  1511.  
  1512.  There is no way that SpHyDir can ever make sense out of this mess, but it will 
  1513. try to "correct" some of these ambiguities for the normal end user who is not 
  1514. an HTML expert. Near term, SpHyDir may offer to generate HTML attribute values 
  1515. that are not valid for the attribute name used in its current context. 
  1516.  
  1517.  SpHyDir is not written tightly enough to trap its own syntax errors and 
  1518. recover. Rexx simply stops the program when it encounters a problem. Since Rexx 
  1519. is an interpreted language, syntax errors may only be detected during 
  1520. execution. When the program aborts, it can leave the output file half-written. 
  1521. This is the primary reason for making a backup of the previous copy of the file 
  1522. before generating a new copy. 
  1523.  
  1524.  
  1525. ΓòÉΓòÉΓòÉ 6. How to Get SpHyDir ΓòÉΓòÉΓòÉ
  1526.  
  1527.  SpHyDir is a copyrighted program which is a personal project and property of 
  1528. the author. It is made available on the network and may be used free of charge 
  1529. under a license terms distributed with the package. Essentially, you agree to 
  1530. leave in all HTML documents produced by SpHyDir the credit that appears at the 
  1531. bottom of all of these Web pages: "This document generated by SpHyDir, another 
  1532. fine product of PC Lube and Tune." 
  1533.  
  1534.  This arrangement is called "Personal SpHyDir." If a large organization wants 
  1535. to generate more professional looking documents and omit the credit, other 
  1536. licensing arrangements can be made with the author. 
  1537.  
  1538.  The following references are correct. They work with Web Explorer and Netscape 
  1539. and conform to current HTTP and HTML standards. If they don't work on your 
  1540. Browser, get a better Browser. Otherwise, you can fetch the files with FTP from 
  1541. pclt.cis.yale.edu. They are in the SPHYDIR subdirectory of PUB. If you have 
  1542. trouble with your browser, then read the trailing tutorial on Web handling of 
  1543. binary files to figure what went wrong. 
  1544.  
  1545.  With a good browser, just select the name of any desired files and save them 
  1546. to disk on your machine. All are compressed with the ZIP utility from the 
  1547. INFOZIP project. 
  1548.  
  1549.     
  1550.  
  1551.        SPHYDIR.ZIP - The basic SpHyDir package. Includes the program, some 
  1552.       sample External Rexx "XSpO" scripts. 
  1553.  
  1554.     
  1555.  
  1556.        VROBJ21C.ZIP - The VX-Rexx 2.1 runtime library at Patch Level C 
  1557.       (VROBJ.DLL). This Dynamic Link Library must be in one of the directories 
  1558.       listed in your LIBPATH statement in CONFIG.SYS. This file is also 
  1559.       required for many other freeware and shareware packages, so you may 
  1560.       already have a copy of this file. After June 23, SpHyDir will be 
  1561.       generated with the "C" version of this module, and may complain if it is 
  1562.       started on a system with only the "B" level of the runtime. Current 
  1563.       information about VX-Rexx is available from the vendor Watcom. 
  1564.  
  1565.     
  1566.  
  1567.        SPHYDOC.ZIP - A copy of all these HTML pages and their associated GIF 
  1568.       files. Unlike other PCLT documents, the SpHyDir documents may be 
  1569.       downloaded and copied. This provides a good example of lots of SpHyDir 
  1570.       use. 
  1571.  
  1572.     
  1573.  
  1574.        GBM.ZIP - A freeware package written by an IBM employee and distributed 
  1575.       through a number of sources. This OS/2 program converts between a number 
  1576.       of popular image formats (GIF, TIFF, XBM, BMP, etc.) and can crop or 
  1577.       resize images. Use this package to convert BMP or Clipboard images into 
  1578.       GIF suitable for including in a Web document. 
  1579.  
  1580.     
  1581.  
  1582.        RCS is a programmer's Revision Control system ported to OS/2 from Unix. 
  1583.       It archives updates to a source file and keeps a change history. You can 
  1584.       display differences and recover any previous version of the file. SpHyDir 
  1585.       doesn't require its use, but a professional HTML editor quickly learns 
  1586.       the value of keeping a history of all document updates. 
  1587.  
  1588.   For a simple and configurable Web server that can run on the same OS/2 
  1589.  machine, PCLT recommends the GOSERVE package from Mike Cowlishaw. There is 
  1590.  also a supplimentary collection of routines named GOHTTP that adds better CGI 
  1591.  and forms support from D. L. Meyer. 
  1592.  
  1593.  
  1594. ΓòÉΓòÉΓòÉ 6.1. Distributing Binaries through the Web ΓòÉΓòÉΓòÉ
  1595.  
  1596.  Fetching a ZIP file through the Web should be a trivial matter. Unfortunately, 
  1597. a number of popular Browsers (particularly NCSA Mosaic) don't do a reasonable 
  1598. job of handling such files. 
  1599.  
  1600.  Web Servers support the HTTP (HyperText Transfer) Protocol. The first version 
  1601. of HTTP (0.9) simply transmitted Web files back to the reader. The current 
  1602. standard (1.0) preceeds each file with a statement of its data type in Internet 
  1603. MIME style. This allows the Browser to distinguish between HTML, plain Text, 
  1604. ZIP binaries, and MPEG movies. 
  1605.  
  1606.  Web Browsers can also read files using the FTP protocol. With FTP, the server 
  1607. doesn't provide any indication of the data type, but the file name contains an 
  1608. extension that usually indicates the type of data (*.ZIP, *.JPG, *.GIF, etc.). 
  1609. In the early days of the Web, HTTP was generally used to distribute HTML files, 
  1610. and FTP was generally used to distribute other binary formats. 
  1611.  
  1612.  No Operating Systems record the MIME file type in the disk directory. So most 
  1613. HTTP servers look at the file type and create a MIME data type based on the 
  1614. extension of the file requested. Thus if a browser fetches SPHYDIR.ZIP using 
  1615. FTP, it will decide that it is a ZIP file because of the *.ZIP extension, but 
  1616. it it fetches the same file using HTTP from the same server, the the Server 
  1617. will look at the *.ZIP extension, decide that it is a ZIP file, send the MIME 
  1618. header with that information, and the Browser will react accordingly. 
  1619.  
  1620.  The problem is that a lot of Web Browsers have developed the convention that 
  1621. anything that comes over HTTP protocol should be either displayed on the screen 
  1622. or played through the speakers, while files that come over FTP can be saved to 
  1623. disk if they have a file extension that makes that seem right. Nothing in the 
  1624. standards says any such thing. Architecturally, a URL can call up ftp:, 
  1625. gopher:, or http: protocols to fetch a file. What you do with the file should 
  1626. then be determined by the type of data and not by the protocol used to fetch 
  1627. it. But it is hard to convince some Browsers to save a ZIP file to disk if it 
  1628. came over HTTP protocol. In most cases, the ZIP file is actually on disk in the 
  1629. Browser's CACHE directory, but it may be hard to find. When it doubt, fall back 
  1630. on plain FTP. 
  1631.  
  1632.  
  1633. ΓòÉΓòÉΓòÉ 7. Using SpHyDir ΓòÉΓòÉΓòÉ
  1634.  
  1635.  This section will explain: 
  1636.  
  1637.     
  1638.  
  1639.        Object content , properties , and links 
  1640.  
  1641.     
  1642.  
  1643.        Steps to install SpHyDir 
  1644.  
  1645.     
  1646.  
  1647.        How to begin editing existing HTML files 
  1648.  
  1649.     
  1650.  
  1651.        How to create a new HTML file 
  1652.  
  1653.     
  1654.  
  1655.        How to edit text in paragraphs or headings 
  1656.  
  1657.     
  1658.  
  1659.        How to delete document objects 
  1660.  
  1661.     
  1662.  
  1663.        How to add new sections, paragraphs, lists, etc. 
  1664.  
  1665.     
  1666.  
  1667.        How to link to other files or remote Web documents 
  1668.  
  1669.     
  1670.  
  1671.        How to save the document and exit 
  1672.  
  1673.     
  1674.  
  1675.        How to move paragraphs and sections around 
  1676.  
  1677.   SpHyDir converts the document to a sequence of objects. Each object has three 
  1678.  attributes: content, properties, and links. 
  1679.  
  1680.   Content 
  1681.  
  1682.             The content of a file is the text or program contained in that 
  1683.            file. A word processing file may also contain formatting 
  1684.            information. The content of a SpHyDir Paragraph Object is the text 
  1685.            of the paragraph, along with all the HTML language features that 
  1686.            operate at the level of words or characters and therefore cannot be 
  1687.            turned into larger objects. To access the content of a file, 
  1688.            doubleclick its icon on the desktop. To access the content of a 
  1689.            SpHyDir paragraph, doubleclick its icon. This opens the SpHyDir Text 
  1690.            Edit Window. 
  1691.  
  1692.             For convenience, it is also possible to doubleclick other objects 
  1693.            that have Headings, Titles, or Captions. This opens a dialog box 
  1694.            that allows the heading to be changed. For example, doubleclicking 
  1695.            the point in a Definition List allows the defined term to be edited. 
  1696.            Although the Heading, Title, Caption, or Term can be opened as if it 
  1697.            was contents, these features are really Properties and can also be 
  1698.            viewed that way. 
  1699.  
  1700.   Properties 
  1701.  
  1702.             In Visual Basic or Delphi, each GUI object has Properties. 
  1703.            Properties include the size, location, font, color, enabled status, 
  1704.            and caption. SpHyDir objects have Properties that derive from HTML 
  1705.            attributes. They may include horizontal alignment (LEFT, MIDDLE, 
  1706.            RIGHT), size, source file (for images), label, shape, and so on. 
  1707.            HTML 3.0 creates all sorts of attributes for each type of object. 
  1708.            The SpHyDir workarea has a Properties Table that displays the 
  1709.            current meaningful values of Properties for the currently selected 
  1710.            document object. Click on a different object, and the table changes 
  1711.            to reflect the new object. 
  1712.  
  1713.             If the user doubleclicks a Property line in the Properties Table, a 
  1714.            dialog box appears that allows the value to be changed. Selecting a 
  1715.            property and clicking the Second Mouse Button pops up a list of the 
  1716.            common values that the Property can take (if it is associated with a 
  1717.            list of alternatives). The doubleclick dialog box allows a property 
  1718.            to be set to values that are not in the popup list if the user is 
  1719.            familiar with extended syntax. 
  1720.  
  1721.             Clicking with the Second Mouse Button in the unused part of the 
  1722.            Properties Table pops up a list of Properties that are valid for the 
  1723.            object. At this time, SpHyDir does not allow the user to add 
  1724.            Property names to an Object, so if SpHyDir doesn't support an HTML 
  1725.            attribute, send a note to the author . 
  1726.  
  1727.   Links 
  1728.  
  1729.             A link connects an Image or section of text in a paragraph to 
  1730.            another file in the library or to a remote network resource. Links 
  1731.            are formed by dropping the shadow of a file, a Web Explorer URL 
  1732.            object, or Link Manager database entry on a document object. If such 
  1733.            an object is dropped on a paragraph, the Hotword Selection window 
  1734.            opens. Highlight the word or phrase associated with the link and 
  1735.            click the OK button. 
  1736.  
  1737.   The SpHyDir user interface has been modelled on the native behavior of the 
  1738.  OS/2 Workplace. A document object can be deleted by dropping it on the OS/2 
  1739.  Shredder. Clicking the Second Mouse Button generates a Popup menu of 
  1740.  operations on the object. However, SpHyDir document objects are not files, so 
  1741.  they cannot be printed by dropping them on a printer, nor can they be moved to 
  1742.  a folder. 
  1743.  
  1744.  
  1745. ΓòÉΓòÉΓòÉ 7.1. How is SpHyDir Installed? ΓòÉΓòÉΓòÉ
  1746.  
  1747.  Although SpHyDir is a big Rexx program, through the magic of the Watcom 
  1748. VX-Rexx Development Environment is it packaged as SPHYDIR.EXE. It can be placed 
  1749. in any program library. The VX-Rexx runtime module VROBJ.DLL must be located 
  1750. somewhere in the LIBPATH, but there are so many VX-Rexx programs in use that 
  1751. this step may have already been performed. 
  1752.  
  1753.  SpHyDir is distributed with a number of useful freeware utilities. The GBM 
  1754. package from IBM can be used to view and convert bitmaps files. The RCS package 
  1755. can be used to maintain a log of changes to the HTML files. Neither is required 
  1756. for SpHyDir to work, but they are helpful. 
  1757.  
  1758.  Make a copy of the production library of HTML files on the OS/2 machine that 
  1759. will be doing the editing. The PCLT library, which appears to be 
  1760. "http://pclt.cis.yale.edu/pclt/" to Web Browsers on the Internet, is 
  1761. "D:\HTTP\PCLT" on the NT machine that acts as the server. The "D:\HTTP" is 
  1762. configured to the server program as the starting point for all HTTP file 
  1763. references. The OS/2 machine on which the files are prepared stores a copy of 
  1764. the files in "F:\HTTP\PCLT" and establishes "F:\HTTP" as the "HTML Library" for 
  1765. SpHyDir editing. This is also configured to GOSERVE as the starting point for 
  1766. HTML service. Files are edited and tested on the OS/2 machine, then transferred 
  1767. to the production server. 
  1768.  
  1769.  The SpHyDir library can be specified with the SET HTMLLIB environment 
  1770. variable. Otherwise, it will be taken as the active directory when SpHyDir 
  1771. starts. SpHyDir can be configured to operate on several different file 
  1772. structures by creating several SpHyDir program objects, each with a different 
  1773. initial current directory. 
  1774.  
  1775.  SpHyDir remembers parameters such as window size and location in the file 
  1776. SPHYDIR.INI in the root directory of the library. Therefore, if there are 
  1777. several SpHyDir program objects with several directories, each will have its 
  1778. own version of the saved parameters. 
  1779.  
  1780.  
  1781. ΓòÉΓòÉΓòÉ 7.2. How to load an HTML document ΓòÉΓòÉΓòÉ
  1782.  
  1783.  There are three ways to start SpHyDir on an existing HTML file. 
  1784.  
  1785.          1.
  1786.  
  1787.        If the SpHyDir Workarea is open and is either empty or the previous file 
  1788.       can now be discarded, then drag the WPS icon of the file over and drop it 
  1789.       in the whitespace of the workarea (not on any individual icon or 
  1790.       caption). SpHyDir will abandon any old file and will read in the new 
  1791.       HTML. 
  1792.  
  1793.          2.
  1794.  
  1795.        If SpHyDir is not running, but a WPS Program Object has been constructed 
  1796.       for it, then drop any WPS Icon for an HTML file on the SpHyDir program 
  1797.       icon. SpHyDir will start up and read in the file. 
  1798.  
  1799.          3.
  1800.  
  1801.        It is possible to associate a Program Object for SpHyDir with files of 
  1802.       the type *.HTM or *.HTML. Then SpHyDir will be automatically launched 
  1803.       when any such file is opened. However, this is not always the right 
  1804.       thing. Sometimes it is useful to launch Web Explorer to view the file 
  1805.       after it has been formatted. It is also sometimes useful to read HTML 
  1806.       files into the System Editor and few the raw tags. So SpHyDir is not the 
  1807.       only tool that can be used to view such files. 
  1808.  
  1809.   There is also one common practice that will not work. The File pulldown menu 
  1810.  does not have an Open option. This is a personal choice of the author and may 
  1811.  be regarded as part of the program design. Choosing a file by name from the 
  1812.  standard file dialog is a lot less attractive than drag and drop from the 
  1813.  Workplace folders. 
  1814.  
  1815.  
  1816. ΓòÉΓòÉΓòÉ 7.3. How to create a new HTML file? ΓòÉΓòÉΓòÉ
  1817.  
  1818.  Drag the first tool (the one that looks like a book) from the upper left 
  1819. corner of the toolbar and drop it on the whitespace of the Workarea. SpHyDir 
  1820. clears the workarea to start a new document. A window pops up asking for the 
  1821. filename. Type the name as though it were a part of a URL. For example, type 
  1822. "sphydir/sample.htm" to create a new file in the "sphydir" subdirectory of the 
  1823. current library. 
  1824.  
  1825.  
  1826. ΓòÉΓòÉΓòÉ 7.4. How to Edit Text (and Stuff) ΓòÉΓòÉΓòÉ
  1827.  
  1828.  In the Workarea, the document is represented by icons. The text is displayed 
  1829. to the right of the paragraph icons as a "caption". OS/2 allows captions to be 
  1830. edited, but this doesn't provide a very nice environment. It is much simpler to 
  1831. "Open" the paragraph by doubleclicking on the icon or on the caption. 
  1832.  
  1833.  Opening the paragraph displays the Text Edit window. The paragraph text is 
  1834. loaded into a Multiline Edit control. Words wrap automatically to the next 
  1835. line. A very large paragraph will activate the vertical scroll bars. Within the 
  1836. Text Edit window, the text is just ordinary ASCII data. It can be Cut or Copied 
  1837. to the OS/2 Clipboard, and characters from other programs can be pasted into 
  1838. the paragraph. All the usual rules about selecting text and using special keys 
  1839. like Del and End hold within the Text Edit window. 
  1840.  
  1841.  Although word processors and the EPM editor can display text in multiple fonts 
  1842. and colors, a simple Multiline Edit control can use only one font. This is not 
  1843. a terribly serious problem, because HTML overpowers the ability of any WYSIWYG 
  1844. editor. Although it is fairly simple to do italics and bold, how can any simple 
  1845. editor distinguish formats labelled EM, STRONG, CODE, SAMP, KBD, VAR, CITE, 
  1846. DFN, PERSON, ACRONYM, ABBREV, BIG, and SMALL. These are the resonable named 
  1847. forms of character emphasis. HTML 3.0 threatens to add another dozen even more 
  1848. obscure types of character tagging. 
  1849.  
  1850.  Special functions are represented in the Text Edit window by special "dingbat" 
  1851. characters that are not part of any standard Web character set. There are four 
  1852. of these dingbat functions: 
  1853.  
  1854.          1.
  1855.  
  1856.        When a file or URL is linked to a "hotword" through the Link Manager, a 
  1857.       pair of inward pointing triangle characters bracket the link. If SpHyDir 
  1858.       could make the triangles Read-Only it would. Editing or deleting these 
  1859.       characters can cause trouble, because the URL for the link is stored 
  1860.       separately. To remove a link, display the Link Manager window, select the 
  1861.       URL for the link, and delete it. However, if the two triangles are left 
  1862.       alone, the text in the middle can be changed to alter the hotword phrase. 
  1863.  
  1864.          2.
  1865.  
  1866.        Character emphasis, and for that matter, any unrecognized tags in the 
  1867.       original HTML, are embedded in the text. Because the "<" and ">" 
  1868.       characters are presented as normal text, they must be replaced with 
  1869.       dingbat characters. Thus "<CITE>Debt of Honor</CITE> by <PERSON>Tom 
  1870.       Clancy</PERSON>" is going to appear pretty much as seen here, except that 
  1871.       each "<" will be replaced by an upward pointing triangle and every ">" 
  1872.       will be replaced by one that ponts down. The simplest way to apply 
  1873.       character emphasis is to select text with the mouse and then use the 
  1874.       "Emphasis" menu in the Text Edit window to generate the appropriate tag. 
  1875.       Unlike the previous case of hotwords, character emphasis has no special 
  1876.       structural significance. These tags can be edited to change the type of 
  1877.       emphasis or the tag can be deleted entirely. 
  1878.  
  1879.          3.
  1880.  
  1881.        HTML defines named sets of foreign, math, and special use characters. In 
  1882.       HTML, such a character is referenced by an Entity. An Entity reference 
  1883.       starts with "&" and then continues with the name of the character. A 
  1884.       semicolon delimits the end of the Entity if it is immediately followed by 
  1885.       normal characters. For example, the copyright symbol Γòò is represented as 
  1886.       "©". SpHyDir wants to allow users to type the "&" character as 
  1887.       needed, so when the HTML is read in the "&" is replaced by the special PC 
  1888.       character that looks like a "smiley face" and has the numeric value 1. As 
  1889.       with all special PC characters, it can be generated from the keyboard by 
  1890.       holding down the Alt key and typing the number on the keypad. So to 
  1891.       generate a copyright character, hold down Alt, press 1, release Alt. A 
  1892.       smiley-face now appears on the screen. Type "copy;". When the paragraph 
  1893.       is written out as HTML, the smiley-face will be turned into an "&" and 
  1894.       the browsers will display the Entity correctly. 
  1895.  
  1896.          4.
  1897.  
  1898.        Small Images can be embedded in the middle of text. Normally this is 
  1899.       used for icons. SpHyDir represents this with a dingbat that looks like a 
  1900.       box with a circle in the middle, something like "[o]". To generate such a 
  1901.       reference, hold down Alt, press "8" on the numeric pad, release Alt. Now 
  1902.       type the file name of the icon/image. Optionally type a space and then 
  1903.       alternate text. End by repeating the Alt "8" sequence. 
  1904.  
  1905.   All other information is a property of the object and appears in the 
  1906.  properties table at the top right corner of the workarea. Each property has a 
  1907.  name and current value. Properties are either character strings, numbers, or 
  1908.  choices. To edit a string or number property, hold the ALT-key and click on 
  1909.  the old value. When a property must have a value from a list, it may be faster 
  1910.  to click on the property with the second mouse button. The list of available 
  1911.  values will then popup as a menu and a new value can be selected. 
  1912.  
  1913.  
  1914. ΓòÉΓòÉΓòÉ 7.5. How to delete objects ΓòÉΓòÉΓòÉ
  1915.  
  1916.  The WPS approach is to drag the object to the desktop Shredder. The keyboard 
  1917. approach is to select the object and press Ctrl-D. The Mouse approach selects 
  1918. the object, presses the second mouse button to popup the menu, and selects 
  1919. "Delete to Clipboard". 
  1920.  
  1921.  It would be reasonable to expect the Del key to delete things. Unfortunately, 
  1922. Del is a character delete key and is used to correct mistyping in other 
  1923. windows. It is difficult to know exactly which window has the focus. A few bad 
  1924. experiences where an attempt to correct a mistyping accidentally deleted whole 
  1925. sections of a document suggested that Del was simply too dangerous as the 
  1926. Object Delete key. 
  1927.  
  1928.  The Delete operation applies to everything contained within the selected 
  1929. object. Delete a list and all the points and paragraphs are also deleted. 
  1930.  
  1931.  A user complained that the Second Mouse Button menu made it too easy to delete 
  1932. objects. To address this problem, a previous simple delete was converted to 
  1933. "Delete to Clipboard". As explained elsewhere, SpHyDir maintains a special 
  1934. Clipboard-like window that is able to hold the special document objects. Delete 
  1935. to Clipboard makes a copy of the objects in the clipboard window and deletes 
  1936. them from the Workarea. If a mistake was made, they can be restored by 
  1937. selecting a location and pressing Shift-Ins. 
  1938.  
  1939.  
  1940. ΓòÉΓòÉΓòÉ 7.6. How to Add to the Document ΓòÉΓòÉΓòÉ
  1941.  
  1942.  At the top left of the workarea window there are a set of icons alternately 
  1943. viewed as the "Toolbar" and as "Templates". They act to the document much like 
  1944. the OS/2 Template folder acts to the rest of the workplace. Drag the icon for a 
  1945. Section, Paragraph, Image, List, or other tool and drop it where you want the 
  1946. new element to go. This creates an empty element that needs to be filled in. 
  1947.  
  1948.  Objects can also be inserted by pressing the Second Mouse Button and choosing 
  1949. Insert from the popup menu. The menu includes the most commonly used objects 
  1950. (paragraphs, points, and lists) and some less common objects for which there 
  1951. was no room in the toolbar. 
  1952.  
  1953.     
  1954.  
  1955.        When the paragraph tool is dropped, the Text Edit Window opens and you 
  1956.       may type text. You can also paste text from the Clipboard. At the bottom 
  1957.       of the Text Edit Window there are buttons. One is labelled "New". 
  1958.       Pressing the New button saves the current text in the current paragraph 
  1959.       and creates a new empty paragraph into which the next information can be 
  1960.       typed. 
  1961.  
  1962.     
  1963.  
  1964.        When the image tool is dropped, it creates an empty Image object. Drag a 
  1965.       GIF file over from one of the OS/2 disk folders and drop it on the object 
  1966.       to assign a file. Add alternate text in the entry field at the top of the 
  1967.       workarea. Pushbuttons allow you to select the alignment of the image with 
  1968.       any trailing text. 
  1969.  
  1970.  
  1971. ΓòÉΓòÉΓòÉ 7.7. How to link to other files? ΓòÉΓòÉΓòÉ
  1972.  
  1973.  To create a hypertext link to another file in the HTML library, open the WPS 
  1974. folder to display the file object. Hold down Ctrl-Shift and drag the file as if 
  1975. you were going to make a shadow of it on the desktop. Drop the icon on a 
  1976. Paragraph or Image object. 
  1977.  
  1978.  If you drop on an image, then there is no further work. Images can have only 
  1979. one hypertext link and the entire image is the link. If you drop on a 
  1980. paragraph, then the Hotword Selection window opens displaying the available 
  1981. text. Drag the mouse to "select" the word or phrase that will represent the 
  1982. link. Click the OK button. Hotwords are delimited in the text by an opening and 
  1983. closing triangle character. You may change the contents of the hotword area, 
  1984. but do not delete the funny triangle characters or SpHyDir will get confused. 
  1985.  
  1986.  SpHyDir has a Link Manager in the list of Windows to handle other types of 
  1987. links. When the Link Manager window is visible, the top list box displays the 
  1988. URLs of links from the currently selected Workarea document object. The lower 
  1989. list box can be used to select other links. There are two buttons on the 
  1990. bottom. Pressing the button with a Web Explorer icon displays all the items in 
  1991. the current Web Explorer hotlist. Pressing the Target button displays all the 
  1992. target labels in the current document tree. Select an element from the list, 
  1993. drag and drop it to a paragraph or image in the workarea. 
  1994.  
  1995.  The Web Explorer will also produce URL objects in the Workplace. Dropping a WE 
  1996. URL object onto a Workplace Object will also create a link to the referenced 
  1997. object. 
  1998.  
  1999.  SpHyDir provides XSpO programs to form links. An eXternal Sphydir Object is a 
  2000. Rexx program that can be dropped on SpHyDir windows. XSpO's provide a way for 
  2001. Rexx-literate users to customize or extend SpHyDir without mucking in the 
  2002. source. One XSpO can be dropped on the lower Link Manager list box and 
  2003. duplicates the function of the Web Explorer button. It can be used as a model 
  2004. for programs that extract hotlists from other sources. Another XSpO is dropped 
  2005. on a Paragraph or Image. It searches through the windows on the destop to find 
  2006. Web Explorer and extracts the URL of the current document that WE is 
  2007. displaying. This provides a shortcut compared with creating a WE URL object and 
  2008. then dropping it on the SpHyDir workarea. Another XSpO shows how to generate a 
  2009. "Mailto" link. 
  2010.  
  2011.  
  2012. ΓòÉΓòÉΓòÉ 7.8. How do I save the file and quit? ΓòÉΓòÉΓòÉ
  2013.  
  2014.  When the workarea has the input focus, press F2 to generate HTML and continue 
  2015. editing, F3 to quit without generating, and F4 to generate HTML and then quit. 
  2016. The status message at the bottom of the window will indicate that HTML is being 
  2017. generated and then has been written. If you press F2 and nothing happens, then 
  2018. click once on the workarea to make sure it has the focus. If you try to quit 
  2019. and have modified the file in the Workarea, a message will pop up asking 
  2020. whether you want to Generate or Discard the file. 
  2021.  
  2022.  
  2023. ΓòÉΓòÉΓòÉ 7.9. How do I move paragraphs around? ΓòÉΓòÉΓòÉ
  2024.  
  2025.  You can drag an individual paragraph around, but only within the visible 
  2026. window. To move more data, to move a greater distance, or to move between 
  2027. files, there is special support to mark a range of objects, copy them to a 
  2028. "clipboard" and paste them somewhere else. 
  2029.  
  2030.  SpHyDir wants to create the image of selecting a range of objects, moving them 
  2031. around, copying them to the clipboard, and pasting them back into the file. 
  2032. However, the native support for selection, movement, and the real OS/2 
  2033. clipboard are not able to handle this problem correctly. Reluctantly, SpHyDir 
  2034. has been forced to reinvent some of this infrastructure. 
  2035.  
  2036.  The user can select a range of objects to move within a document or to copy to 
  2037. another document. First select one object and press Alt-L as if you were 
  2038. establishing a "line mark" in the EPM or Kedit editors. Once you begin to mark 
  2039. a section of the document, you may extend the marked area forward or backward, 
  2040. but only within the current level of the document tree. The mark can be 
  2041. extended over but not into lists or subsections. Nor can the start or end of 
  2042. the mark be extended outside the section or list in which it is started. 
  2043.  
  2044.  Marking creates two new objects: Mark Start and Mark End. Initially these 
  2045. objects are placed around the currently selected object when Alt-L is pressed. 
  2046. The Mark objects can then be "slid" forward or backward along the line that 
  2047. represents the current level of the tree. They cannot be slid into a subsection 
  2048. or list (to a lower level) nor can they be slid outside the section or list in 
  2049. which they started. The Mark can also be automatically adjusted by selecting 
  2050. another object at the same level of the tree and pressing Alt-L again 
  2051. (expanding the scope of the Mark just as additional lines are added in the EPM 
  2052. editor when you move to another line and press Alt-L a second time). 
  2053.  
  2054.  Once a section has been marked, you can copy it to the Clipboard by pressing 
  2055. Ctrl-Ins (the standard OS/2 keyboard sequence for Copy). However, the OS/2 
  2056. Clipboard really doesn't know how to hold SpHyDir objects, so the same effect 
  2057. is achieved by opening a new Window and copying all of the objects between the 
  2058. two marks (including all the objects contained in subsections and lists) from 
  2059. the workarea window to a second container that SpHyDir calls "The Clipboard". 
  2060. In the current release, the Clipboard window becomes visible (for debugging) 
  2061. though it can be minimized or can be dragged over to the side of the desktop. 
  2062.  
  2063.  The objects in the Clipboard can then be moved to another part of the original 
  2064. document by selecting a destination object and pressing Shift-Ins (the OS/2 
  2065. standard for Paste). They can be copied to another file by dragging another HTM 
  2066. file to the workarea (replacing the original source document) and then pasting 
  2067. from the Clipboard to a second document. 
  2068.  
  2069.  However, Clipboard objects cannot be copied to another part of the same 
  2070. document. This fell out from the way the Clipboard got coded and, at the 
  2071. moment, it seems to be a useful feature. When the user marks objects and 
  2072. presses Ctrl-Ins, there were two programming choices. One choice copies all of 
  2073. the objects to the Clipboard. The alternative creates what is essentially a 
  2074. Shadow of the original record in the clipboard (what VX-Rexx calls a "shared 
  2075. record"). Like the Workplace shadow, the two objects are actually different 
  2076. views of the same data. If you were to edit the text of a paragraph after 
  2077. copying it to the SpHyDir Clipboard, the text of the Clipboard copy would also 
  2078. change. However, while a Workplace shadow cannot exist when the original is 
  2079. deleted, a VX-REXX shared record continues to exist until all of its related 
  2080. objects have been deleted. Thus the Clipboard copy of the data continues to 
  2081. exist after the original object in the workarea has been deleted or the entire 
  2082. document has been replaced. 
  2083.  
  2084.  A shared record can exist in two different containers, but there can be only 
  2085. one copy of the record per container. By choosing to use Shadows in the 
  2086. Clipboard instead of full copies, SpHyDir does not support duplicating large 
  2087. blocks of text within the same Hypertext document. 
  2088.  
  2089.  When you select another location and press Ctrl-Ins, the SpHyDir Paste tries 
  2090. to copy the shared record from the Clipboard back to the original document. 
  2091. However, since there is already a copy of the record in the workarea and no 
  2092. container can have two copies of the same record, the Paste operation actually 
  2093. moves the old record from its previous location to the new position. If you 
  2094. delete the document in the workarea and load a new document (even a new copy of 
  2095. the original document) then a new set of records are created. Now the Clipboard 
  2096. has the only copy of the old records and Paste copies the information into the 
  2097. new document. 
  2098.  
  2099.  I am a bit suspicious of any feature that takes this much time to explain. On 
  2100. the other hand, a hypertext document should be short and it doesn't make a lot 
  2101. of sense to duplicate large blocks of text within such a file. There is a 
  2102. strong sense that the way this Mark and Clipboard logic works is probably the 
  2103. Right Way to handle this particular problem with this particular set of data. 
  2104. Only by gaining experience with this technique will it become clear if this is 
  2105. really the best approach. 
  2106.  
  2107.  Note that the SpHyDir specialized Clipboard, Cut, and Paste apply only to the 
  2108. management of objects from the Workarea. Within the Text Edit window opened by 
  2109. double-clicking a paragraph or point, the behavior of text selection, Cut, 
  2110. Copy, and Paste is completely normal and operates through the normal OS/2 
  2111. clipboard. Text data can be exchanged between another OS/2 program and the Text 
  2112. Edit window through the ordinary cut and paste mechanisms. 
  2113.  
  2114.  
  2115. ΓòÉΓòÉΓòÉ 8. The Toolbar and Document Objects ΓòÉΓòÉΓòÉ
  2116.  
  2117.  At the top of the Workarea there are a collection of icons that represent the 
  2118. Toolbar (or Template) area. These items can be dragged into the document to 
  2119. create new elements. 
  2120.  
  2121.  
  2122. ΓòÉΓòÉΓòÉ 8.1. The Document Tool and Object ΓòÉΓòÉΓòÉ
  2123.  
  2124.  The Document Tool serves two functions. If it is dropped on the "whitespace" 
  2125. of the workarea, away from any existing document objects (or anywhere in an 
  2126. empty workarea), then this tool is treated as a request to start a new 
  2127. document. It replaces the more traditional New option on the File pulldown 
  2128. menu. 
  2129.  
  2130.  If there is an existing document in the Workarea, the user will be prompted 
  2131. whether it is alright to abandon that document. Pressing ESC returns to the 
  2132. previous document and cancels the request. 
  2133.  
  2134.  Otherwise, the Workarea is cleared and SpHyDir prompts for the name of the 
  2135. file. The name is relative to the start of the document library and it should 
  2136. be given with the "/" notation commonly used in Web documents. SpHyDir cannot 
  2137. force the user to act rationally, but it is generally a good idea to organize 
  2138. the local library with the same structure that documents have on the production 
  2139. server. Thus the document http://pclt.cis.yale.edu/pclt/sphydir/status.htm 
  2140. would have the name "pclt/sphydir/status.htm" on the editing machine, 
  2141. corresponding to the part of the URL that follows the server machine name. 
  2142.  
  2143.  The library on the editing machine may have some upper path components that 
  2144. are not visible. If HTMLLIB is set to "F:\HTTP" (or if there is no HTMLLIB 
  2145. variable and F:\HTTP is the current directory when SpHyDir starts) then this 
  2146. disk letter and upper directory will be inserted in front of the URL part to 
  2147. form the actual OS/2 file name. 
  2148.  
  2149.  After the file name has been supplied, the user is prompted for a Title. 
  2150. Whatever is entered becomes the initial caption of the Document object (used to 
  2151. set the <TITLE> tag in HTML) and of the first Section object (used to set the 
  2152. <H1> string). This seems to be redundant, but the two tags are used for 
  2153. different purposes in HTML. The <TITLE> describes the document (say in an index 
  2154. of the library). The <TITLE> text may not be displayed by some browsers, or it 
  2155. appears as the title bar of the window. The <H1> text appears in big letters. 
  2156.  
  2157.  SpHyDir doesn't go one step further and add an initial paragraph object. In 
  2158. some cases, the document might start with an IMG or other object instead. Drag 
  2159. the appropriate tool from the toolbar and drop it on the Section tool to start 
  2160. adding content. 
  2161.  
  2162.  Most of the Properties of the Document Object correspond to fields in the 
  2163. <HEAD> area of the HTML. This includes LINKs to other documents, and a BASE URL 
  2164. value. A few Properties are taken from HTML3/Netscape extensions to the <BODY> 
  2165. tag to assign a Background pattern and to control the color of text on top of 
  2166. that background. 
  2167.  
  2168.  If a GIF file is dropped on the Document Object of a file in the Workarea, 
  2169. that file name is set as the value of the Background property for the document. 
  2170.  
  2171.  If the Document tool is dropped on a previous document object, then it becomes 
  2172. a request to add a Subdocument link. Subdocument pointers are used to build a 
  2173. larger document out of many smaller Web files. A subdocument pointer to another 
  2174. file means that that file is a continuation of the current file. Any word or 
  2175. phrase can be hotlinked to another Web page. Ordinary hotlinks do not imply a 
  2176. relationship. Subdocument links indicate that the other file is a child 
  2177. belonging to the current Web page. 
  2178.  
  2179.  There are some rules to good document construction. SpHyDir chooses not to 
  2180. enforce them, but their proper use is highly recommended. Most importantly, a 
  2181. file should only be a subdocument of one other file. If two different parents 
  2182. try to claim the same file as a subdocument, things are going to get all messed 
  2183. up. 
  2184.  
  2185.  A Subdocument object can go anywhere, but best results will be obtained if all 
  2186. the Subdocument pointers are together at the end of a file. 
  2187.  
  2188.  Although it may be tempting to make everything a subdocument of the highest 
  2189. level index page, this produces a structure that is awkward to handle. The 
  2190. entire library should not be related pages. Restrict subdocument relationships 
  2191. to files that are really part of the same paper, article, subject, tutorial, or 
  2192. brochure. Use ordinary hyperlinks from the main page or library table of 
  2193. contents. 
  2194.  
  2195.  Drag the Document Tool over and drop it in the file as you would create a 
  2196. paragraph or point. The Subdocument definition is then completed by dragging 
  2197. the WPS icon for an HTM or HTML file over and dropping it on the newly created 
  2198. object. If the dropped file was previously processed by SpHyDir, the Title of 
  2199. that document can be extracted from the Extended Attributes of the file and 
  2200. will appear next to the Subdocument icon. 
  2201.  
  2202.  Within the current file, the Subdocument object behaves like a Paragraph whose 
  2203. entire contents is the TITLE of another HTML file and where that TITLE text is 
  2204. a hypertext link to the other file. 
  2205.  
  2206.  Every time SpHyDir loads a file with subdocument pointers, it checks each 
  2207. identified file to see what its current Title is. Title changes appear 
  2208. immediately in the caption of the Subdocument object and are written back when 
  2209. the parent document is regenerated. 
  2210.  
  2211.  The Subdocument structure is also stored as Extended Attributes of the files 
  2212. in the library. Each *.HTM or *.HTML file has pointers to the files that it 
  2213. claims as subdocuments and to its "parent" (a file that claims it as a 
  2214. subdocument). The order in which the Subdocument objects appear in the parent 
  2215. establishes a Next and Previous ordering to the sudocument HTML files, which 
  2216. SpHyDir maintains and can use to generate uniform Headers and Trailers. 
  2217.  
  2218.  
  2219. ΓòÉΓòÉΓòÉ 8.2. The Section Tool and Object ΓòÉΓòÉΓòÉ
  2220.  
  2221.  Every ordinary paper document is organized into Chapters, Sections, and 
  2222. Subsections. That, after all, is what an Outline is all about. HTML has 
  2223. provision for Headings, but it is not all that clear about what exactly a 
  2224. Heading introduces. 
  2225.  
  2226.  HTML 3.0 addresses this by introducing a DIV tag. The concept is that large 
  2227. documents would be broken up into segments delimited by a <DIV CLASS=CHAPTER> 
  2228. or <DIV CLASS=APPENDIX> tag. However, these tags are not currently used. 
  2229. SpHyDir forms sections based on the appearance of an H1..H6 tag. Eventually, 
  2230. SpHyDir may automate the transition from HTML 2 to 3 and generate the DIV tags 
  2231. automatically. 
  2232.  
  2233.  SpHyDir will recognize a DIV tag when it is encountered, but there is no 
  2234. strong body of use to know what to do with it. The author would appreciate 
  2235. E-mail if any important use of DIV is discovered on the Net. 
  2236.  
  2237.  For it to be successful, SpHyDir has to determine where the Section ends. 
  2238. There is no explicit HTML marking, but it can reasonably assumed that the 
  2239. Section extends until there is a new Heading tag at the same or a higher 
  2240. logical level than the tag that started the Section. Lower level Headings are 
  2241. assumed to start subections of the current Section object. 
  2242.  
  2243.  The Properties of a Section Object come from the attributes of the H1..H6 
  2244. headings tag in the HTML 3 proposed standard. This produces a small confusion. 
  2245. In all other document Objects that contain other objects, an attribute of the 
  2246. container applies to all the objects that it contains. However, attributes on a 
  2247. Section Object apply only to the Heading. For example, ALIGN=CENTER means that 
  2248. the Heading is centered and does not apply to the paragraphs in the Section. 
  2249.  
  2250.  
  2251. ΓòÉΓòÉΓòÉ 8.3. The Paragraph Tool and Object ΓòÉΓòÉΓòÉ
  2252.  
  2253.  The Paragraph Object contains text. In HTML, "text" is more broadly defined to 
  2254. contain ordinary characters, Entities, character emphasis tags (Bold, Italics, 
  2255. CITE, etc), hyperlink hotwords, line breaks, and embedded images. 
  2256.  
  2257.  SpHyDir is not currently prepared to break the paragraph down into any finer 
  2258. objects. So all this non-text "text" has to be encoded with special characters. 
  2259. The user can doubleclick a paragraph to display all the text in the Text Edit 
  2260. window. Special characters can be added to the document using the standard rule 
  2261. for special keyboard entry (hold down Alt, type a number in decimal notation on 
  2262. the numeric pad, and release the Alt key). 
  2263.  
  2264.  However, hotword links are only partially contained in the text. The rest of 
  2265. the hotword link is a URL that can be displayed in the Link Manager Window. 
  2266. Before deleting text containing a hotword, use Link Manager to delete the link 
  2267. and remove the inward pointing triangles. 
  2268.  
  2269.  Properties of the Paragraph Object are mostly derived from the attributes of 
  2270. the <P> tag in HTML 3. 
  2271.  
  2272.  
  2273. ΓòÉΓòÉΓòÉ 8.4. The Image Tool ΓòÉΓòÉΓòÉ
  2274.  
  2275.  The Image Tool represents a graphic insert. First, drag and drop the image 
  2276. tool to the location in the document where the image is logically positioned. 
  2277. Then finish the definition by dropping the WPS icon of a GIF file on top of the 
  2278. Image object. Currently SpHyDir requires the GIF data type (XBM and JPG may be 
  2279. added later). Since the IBM IPF system doesn't support GIF, generated IPF 
  2280. source uses the same file name and an extension of BMP. GIF files can be 
  2281. converted to BMP files using the GBM utilities or any of a number of other 
  2282. graphics programs. 
  2283.  
  2284.  HTML authors are reminded that there are still a number of disadvantaged users 
  2285. who try to surf the net using charcter mode Unix. To accomodate such people, an 
  2286. Image should have alternate text that describes the content or meaning of the 
  2287. image. This alternate text is entered as the value of the ALT Property. If an 
  2288. image has alternate text, it is displayed as the caption to the right of the 
  2289. icon for the object. Otherwise, the file name is the caption. 
  2290.  
  2291.  The Image Object was created by SpHyDir to provide an icon on which GIF files 
  2292. can be dropped and from which hyperlinks can be made. HTML doesn't really seem 
  2293. to regard Images as objects. Rather, HTML syntax seems to treat each image as 
  2294. an unusually large text character. 
  2295.  
  2296.  The SpHyDir Object will work if the image appears all by itself or at the 
  2297. beginning of a paragraph. If the image has to appear in the middle of a heading 
  2298. or paragraph text, then it cannot be promoted to full object status. SpHyDir 
  2299. calls such things embedded images. An embedded image is represented by a 
  2300. dingbat character corresponding to the value 0x08, followed by the name of the 
  2301. GIF file. Then optionally there is a blank and alternate text. The sequence 
  2302. ends with a second 0x08 dingbat. Embedded images have no properties, and the 
  2303. user cannot drop anything onto them. They can be part or all of a hotlink 
  2304. phrase. 
  2305.  
  2306.  When an image appears at the start of a paragraph, it could be rendered using 
  2307. the "inline image" syntax. However, SpHyDir extracts it from the paragraph an 
  2308. builds a separate object. The value of the ALIGN property for the Image Object 
  2309. determines how it will interact with the paragraph that follows it. ALIGN=NONE 
  2310. (a value made up by SpHyDir) displays the Image by itself. Other values of 
  2311. ALIGN position the following text to the right of the image, and in some cases 
  2312. the text flows around the image border. 
  2313.  
  2314.  HTML 3.0 introduces a FIG tag to extend the functions of the current IMG tag. 
  2315. Unfortunately, it is not widely supported and its use is currently not clear. A 
  2316. later version of SpHyDir may provide automatic migration of current IMG syntax 
  2317. to the preferred FIG syntax after it becomes a viable alternative. 
  2318.  
  2319.  
  2320. ΓòÉΓòÉΓòÉ 8.5. The Ordered List Tool ΓòÉΓòÉΓòÉ
  2321.  
  2322.  An Ordered List Tool contains a sequence of numbered points. Although points 
  2323. are normally simple paragraphs, HTML allows a point to contain almost anything: 
  2324. paragraphs, images, even check boxes or radio buttons. 
  2325.  
  2326.  SpHyDir 1 tried to combine the functions of Points and paragraphs. This worked 
  2327. well 99% of the time. It caused trouble when the list item started with 
  2328. anything that wasn't ordinary text. 
  2329.  
  2330.  SpHyDir II views lists the way that the HTML standard views them. A list 
  2331. contains points. The points contain paragraphs. The paragraphs contain text. 
  2332.  
  2333.  HTML 3.0 allows a list to begin with a header. This is represented by a 
  2334. <LH>text</LH> sequence before the first point. Following the recommendation of 
  2335. the standard, SpHyDir takes any free text that is found in old HTML documents 
  2336. outside the list points and turns it into a list heading so it is legal. 
  2337.  
  2338.  The properties of an ordered list are taken from HTML 3.0. The properties 
  2339. allow a second list to resume numbers where a previous list left off. Netscape 
  2340. has some nifty ideas to control format, whether items are listed as 1 2 3, A B 
  2341. C, a b c, or i ii iii. 
  2342.  
  2343.  
  2344. ΓòÉΓòÉΓòÉ 8.6. The Unordered List Tool ΓòÉΓòÉΓòÉ
  2345.  
  2346.  An unordered lists contains unnumbered points, generally delimited by a 
  2347. "bullet" character. Unordered lists follow the same rules as the previous 
  2348. discussion of Ordered Lists. 
  2349.  
  2350.  The properties of an Unordered list allow the bullet charcter to be replaced 
  2351. with another choice. The PLAIN attribute allows the bullet to be omitted 
  2352. entirely. SRC allows the bullet to be generated as a GIF image. 
  2353.  
  2354.  HTML has two obsolete list formats based on the <DIR> and <MENU> tag. SpHyDir 
  2355. will read such lists in, but will convert them to the preferred <UL COMPACT> 
  2356. tag. 
  2357.  
  2358.  
  2359. ΓòÉΓòÉΓòÉ 8.7. The Definition (Glossary) List Tool ΓòÉΓòÉΓòÉ
  2360.  
  2361.  A Definition List defines a set of terms. Each term is followed by an indented 
  2362. definition. In SpHyDir, the term is a Property of each point in the List. As 
  2363. with other lists, the Point then contains paragraphs that are the definition of 
  2364. the term. 
  2365.  
  2366.  With this structure, SpHyDir requires a propertly formed Definition list with 
  2367. alternating pairs of <DT> term <DD> definition. 
  2368.  
  2369.  
  2370. ΓòÉΓòÉΓòÉ 8.8. The Point Tool ΓòÉΓòÉΓòÉ
  2371.  
  2372.  The icon of a hand making a "point" represents the general list item. An 
  2373. Ordered, Unordered, or Definition List can contain only Points. Each point then 
  2374. contains paragraphs, images, and other document content objects. In an ordered 
  2375. or unordered list, the Properties of the Point object correspond to the 
  2376. attributes of the <LI> tag. In a definition list, the Point object also has a 
  2377. "Term" Property which is the text contained in the <DT> tag. The <DD> tag ends 
  2378. the term and begins the paragraphs which are contained within the Point. 
  2379.  
  2380.  
  2381. ΓòÉΓòÉΓòÉ 8.9. The Forms Tools ΓòÉΓòÉΓòÉ
  2382.  
  2383.  The Form Tool creates an interactive area in which the Web user can enter data 
  2384. to submit a request or query. A Form can include all of the previous document 
  2385. objects, and data fields from the bottom row of the toolbar. To process a form, 
  2386. the server must execute a program written by the form designer. This makes the 
  2387. use of Forms an advanced topic that will be described in a separate section. 
  2388.  
  2389.  
  2390. ΓòÉΓòÉΓòÉ 8.10. Missing Tools ΓòÉΓòÉΓòÉ
  2391.  
  2392.  Less frequently needed Objects (and tools that have no particularly good icon 
  2393. and would look ugly on the Toolbar) can be inserted by selecting an object in 
  2394. the Workarea, pressing the Second Mouse Button, and choosing Insert from the 
  2395. popup menu. The most frequently used Tools (Paragraph and Image for example) 
  2396. can also be inserted this way. However, there are a few objects that can only 
  2397. be inserted from the menu. 
  2398.  
  2399.  The Horizontal Rule Object draws a horizontal line across the screen. Its 
  2400. thickness can be controlled with the SIZE property (a Netscape extension 
  2401. supported by Web Explorer). 
  2402.  
  2403.  SpHyDir has a BR object. Normally a simple line break is honorary text and 
  2404. appears embedded inside paragraphs. The idea of a special break was introduced 
  2405. by Netscape, which needed it to clear dangling images. The <BR CLEAR=ALL> stops 
  2406. flowing text to the right or left of an image and starts at the first line 
  2407. clear of all images. The BR object is also useful in Forms to put a line break 
  2408. between fields, boxes, buttons, and other non-text objects. 
  2409.  
  2410.  
  2411. ΓòÉΓòÉΓòÉ 9. The Problem of Position ΓòÉΓòÉΓòÉ
  2412.  
  2413.  SpHyDir would be simple if the VX-Rexx and OS/2 programming interface allowed 
  2414. the user to drop tools and components in between two existing document 
  2415. elements. This would clearly indicate where the new element is to go. However, 
  2416. the environment requires the tools, files, and other objects to be dropped on 
  2417. top of existing components. This forces SpHyDir to invent some rules about 
  2418. positioning. 
  2419.  
  2420.  Sections and Lists contain things. In the Workplace, if you drop a file on the 
  2421. icon of a folder, the file goes into the folder. So the normal behavior is that 
  2422. if you drop anything (other than a Target) on a Section or a List, then the new 
  2423. element is added inside that Section or List in front of anything already 
  2424. there. 
  2425.  
  2426.  If you drop something on a Paragraph, Image, or Point then the new item goes 
  2427. after the thing you dropped it on. Thus to add a new Point to the end of an 
  2428. existing list, drop the Point tool on the last Point in the list. To add a new 
  2429. Point to the beginning of a list, drop the Point tool on the parent List 
  2430. object. 
  2431.  
  2432.  These rules seem to cover all but two cases. Lists can be nested inside other 
  2433. lists. When this occurs, there is no way to add a new outer point after the end 
  2434. of a nested inner list because every time you try to drop a point on the inner 
  2435. list icon the new point is positioned inside the inner list instead of after it 
  2436. in the outer list. Similarly, there is no way to add one section after another 
  2437. because whenever you drop something on a section it goes inside it and not 
  2438. behind it. So there is an extra rule that if you hold down Ctrl when dropping a 
  2439. Point on a List the Point goes after the list, and if you hold down Ctrl when 
  2440. dropping the Section tool on an existing Section, the new Section goes behind 
  2441. the current section. This is not entirely satisfactory. A section can go on for 
  2442. many screens, and it it somewhat unexpected to have to go many screens back to 
  2443. the start of a section in order to drop something on the section object and add 
  2444. it many screens down after the section end. I am waiting for a better idea to 
  2445. come to mind. 
  2446.  
  2447.  Originally, the idea would be that Ctrl-dropping a tool placed the tool after 
  2448. the thing on which you dropped it. That seemed like a good rule, but it doesn't 
  2449. work with Sections because you can't put a paragraph, image, or list after a 
  2450. Section. Sections don't end, you see, until a new Section begins (in HTML 
  2451. terms, a section ends when a new H1...H6 header is encountered). The only thing 
  2452. that you can put behind a section is another Section. Everything else that you 
  2453. try to put behind the section ends up inside it anyway. 
  2454.  
  2455.  
  2456. ΓòÉΓòÉΓòÉ 10. Managing Links ΓòÉΓòÉΓòÉ
  2457.  
  2458.  Most HTML editors expect the user to type in the document referenced (the URL) 
  2459. in order to create a hypertext link. Since it is easy to make a mistake, 
  2460. authors are urged to test their documents thoroughly. SpHyDir provides a 
  2461. simpler and more reliable method of constructing links. 
  2462.  
  2463.  
  2464. ΓòÉΓòÉΓòÉ 10.1. Forming Links from the Desktop ΓòÉΓòÉΓòÉ
  2465.  
  2466.  Links to other files in the same library can be constructed using standard 
  2467. Workplace Shell behavior. Hold down Cntrl and Shift and drag the icon of 
  2468. another file in the library to a paragraph or image object in the SpHyDir 
  2469. Workarea. If the link is made to a paragraph object, the Hotword Selection 
  2470. window opens. Use the mouse to select a word or phrase and press the OK button. 
  2471.  
  2472.  Links to remote documents should be managed with the aid of Web Explorer. The 
  2473. SpHyDir philosophy holds that before you generate a link to a document, you 
  2474. should be able to display it in the Browser. There are two fairly direct ways 
  2475. that WE references can be use to generate SpHyDir links. 
  2476.  
  2477.  The simplest option is to use the ability of the current Web Explorer program 
  2478. to generate URL objects. Such objects can be dropped on the desktop, but it is 
  2479. better if they are stored as disk files. They can then be dropped on SpHyDir to 
  2480. generate a link to the corresponding resource. 
  2481.  
  2482.  SpHyDir also provides an XSpO Rexx program named WE_URL.CMD. First use Web 
  2483. Explorer to view the desired network resource. Then drop the WE_URL icon on a 
  2484. paragraph or image in the SpHyDir Workarea. The WE_URL program locates the Web 
  2485. Explorer window on the desktop, extracts the current URL from it, and passes it 
  2486. on to form a link. 
  2487.  
  2488.  The XSpO library supplied with SpHyDir also has MAILTO.CMD, an example of how 
  2489. to form a link that uses the Mailto URL. 
  2490.  
  2491.  
  2492. ΓòÉΓòÉΓòÉ 10.2. Using the Link Manager Window ΓòÉΓòÉΓòÉ
  2493.  
  2494.  To display the Link Manager, select it from the Window pulldown menu on the 
  2495. Workarea window. The Link Manager presents two list box areas and a pair of 
  2496. buttons. 
  2497.  
  2498.  The top list box shows the URLs of any links from the current document object 
  2499. selected in the workarea. The number of URLs listed should correspond to the 
  2500. number of pairs of inward pointing triangle dingbat characters in the text of 
  2501. the paragraph. The order of the URLs in the box also corresponds to the order 
  2502. of the hotword phrases in the paragraph. An Image object would have only one 
  2503. link. 
  2504.  
  2505.  To delete a link, select the URL in the top list box and press the Ctrl-D key. 
  2506. The URL is removed from the list, and the triangle dingbat characters will also 
  2507. disappear in the text from around the previous hotword phrase. If a hotword 
  2508. phrase is to be deleted, it is important to remove the link first. SpHyDir has 
  2509. no way to connect hotwords to URLs except to pair them off in order when 
  2510. generating HTML. If a hotword is deleted with the editor, then the following 
  2511. hotword gets paired to the URL that of the deleted link, and the meanings of 
  2512. subsequent hotwords are similarly shifted. 
  2513.  
  2514.  The larger Link Manager list box proposes new links from a database. Two 
  2515. buttons are presented at the bottom to populate this list. The button with the 
  2516. Web Explorer icon fills the box with entries from the current Web Explorer 
  2517. hotlist. The Target button fills it with target labels from the current 
  2518. document. 
  2519.  
  2520.  A target is a lable assigned to a section or paragraph in the middle of the 
  2521. document. HTML 2.0 generates such a label with the <A NAME=xxx> tag. HTML 3.0 
  2522. also supports the ID attribute on most tags, as in <P ID=xxx>. SpHyDir supports 
  2523. both types of HTML, but its interface is modelled on HTML 3.0. 
  2524.  
  2525.  SpHyDir document objects have an ID Property. When it is set, ID appears in 
  2526. the Properties table for the current object. Any object can be labelled by 
  2527. adding the ID Property. Select the object, click with the Second Mouse button 
  2528. on the whitespace of the Properties table, and select ID from the list of 
  2529. properties. A dialog box appears in which a label value can be typed. 
  2530.  
  2531.  Programmers frequently assume that the labels must be short, or that they 
  2532. cannot contain spaces or special characters, or that they are all uppercase. 
  2533. All these things are wrong. The label can be any reasonable length, it can 
  2534. contain blanks, and is case-sensitive. The label "Case" will not be matched by 
  2535. a search for "case". At this time, SpHyDir cannot guarantee that this or any 
  2536. other property can safely have special characters such as '<', '>', '&', or 
  2537. doublequote. 
  2538.  
  2539.  If links are to be formed manually, then it is probably a good idea to keep 
  2540. the name short. Type one character wrong, even in the wrong case, and the 
  2541. search misses its target. However, if links are formed automatically by 
  2542. selecting a target from a list, then there is no chance of a mistyping. In this 
  2543. case, it makes sense to make the labels longer and more descriptive, so that 
  2544. they can be identified more easily in a larger database. 
  2545.  
  2546.  When the target button at the bottom of the Link Manager is pressed, SpHyDir 
  2547. first seaches the current file for all objects with an ID property. If this 
  2548. document is part of a larger document tree, it then goes up through the Parent 
  2549. Extended Attribute pointers to find the root document, and proceeds down 
  2550. through the tree locating all the other target labels. 
  2551.  
  2552.  At this point, it is not part of the SpHyDir plan to expand the scope of 
  2553. buttons in the Link Manager to other targets in the Library. Rather, XSpOs will 
  2554. be developed to populate the Link Manager list with specialized targets, such 
  2555. as glossary references. If anyone wishes to develop specialized XSpO routines, 
  2556. the names of all targets in an HTML file are stored by SpHyDir in the 
  2557. PCLT-SPHYDIR.TARGETS Extended Attribute. 
  2558.  
  2559.  
  2560. ΓòÉΓòÉΓòÉ 11. The Subdocument Tree ΓòÉΓòÉΓòÉ
  2561.  
  2562.  Most HTML editor tools operate on a single text file. However, good practice 
  2563. holds that hypertext documents should be divided into a large number of small 
  2564. files. Managing all these files and maintaining a consistent overall structure 
  2565. then becomes a serious problem. 
  2566.  
  2567.  
  2568. ΓòÉΓòÉΓòÉ 11.1. The Library ΓòÉΓòÉΓòÉ
  2569.  
  2570.  PC Lube and Tune has developed into a library structure that seems generally 
  2571. applicable. Because no one application can assume to own the entire server, the 
  2572. files fall under a common starting directory. During development, this is 
  2573. x:\PCLT on the author's machine. In distribution, the same structure becomes 
  2574. http://pclt.cis.yale.edu/pclt/ on the server. 
  2575.  
  2576.  SpHyDir gets the local library name from the HTMLLIB environment variable. In 
  2577. this case, "SET HTMLLIB=F:\PCLT" is put in CONFIG.SYS. All of the HTML and GIF 
  2578. files that SpHyDir processes have to fall on this disk under this directory. 
  2579. SpHyDir is then programmed to moderate between the native OS/2 file naming 
  2580. conventions (with "\") and the more general file naming conventions used in 
  2581. most hypertext links (with "/"). In concept, it should be possible to move the 
  2582. entire structure from OS/2 to a Unix server. 
  2583.  
  2584.  Although it is possible to dump all the files in one directory, the library 
  2585. becomes more managable if each major subject has its own directory. Any large 
  2586. collection of related files can be collected in the same subdirectory. 
  2587.  
  2588.  
  2589. ΓòÉΓòÉΓòÉ 11.2. Chapter and Verse ΓòÉΓòÉΓòÉ
  2590.  
  2591.  It is possible for a collection of random short documents to be collected 
  2592. together in some free-form association. No structure would be needed for such a 
  2593. grouping. However, most collections of hypertext files actually started as a 
  2594. larger paper document. The material was broken into smaller files because it is 
  2595. best if each file on the Web is only a few screens long. However, the original 
  2596. logical structure of chapters, sections, and subsections is still logically 
  2597. present. 
  2598.  
  2599.  To accomodate this, SpHyDir supports the concept of a Subdocument. A 
  2600. Subdocument is a special kind of "paragraph" object in a file. Any word in an 
  2601. ordinary paragraph or point can be a hypertext link to another file. However, 
  2602. such links do not establish a relationship between the file containing the link 
  2603. and the file to which the link points. 
  2604.  
  2605.  A Subdocument link, however, claims that the other file is logically a part of 
  2606. the file that references it. When one file claims another as a Subdocument, 
  2607. then the first file is said to be the "parent" of the claimed file. A thousand 
  2608. different files can have ordinary hypertext links to the same Web page, but 
  2609. only one file can claim to be its parent. (This is a restriction that the user 
  2610. should obey. SpHyDir is not currently in a position to enforce it). 
  2611.  
  2612.  Just as each library generally has a "front door" or "home page", so any 
  2613. collection of subdocument has a starting point. The "root" document is the one 
  2614. member of the group that has no parent. It points to subdocuments, and they in 
  2615. turn can point to other subdocuments. 
  2616.  
  2617.  
  2618. ΓòÉΓòÉΓòÉ 11.3. Objects and Attributes ΓòÉΓòÉΓòÉ
  2619.  
  2620.  Physically, a Subdocument Object produces a paragraph whose only content is 
  2621. the TITLE of the Subdocument. This TITLE is a hypertext link to the 
  2622. Subdocument. In addtion, however, the Subdocument object has a structural 
  2623. effect upon the parent, the named document, and other subdocuments that are 
  2624. also claimed by the same parent. 
  2625.  
  2626.  Subdocuments are normally a series of chapters or sections. If the text were 
  2627. printed out, they would be printed and read in order. The order in which the 
  2628. Subdocument objects appear in the parent produces a Next/Previous relationship 
  2629. between the subdocuments themselves. HTML 2.0 doesn't have a formal method of 
  2630. expressing this relationship. HTML 3.0 will have syntax for Next and Previous 
  2631. links. Until this becomes widely available, SpHyDir manages the relationships 
  2632. itself. 
  2633.  
  2634.  In OS/2 a file can have Extended Attributes. The normal attributes are things 
  2635. like Date and Size. Extended Attributes are maintained by the application that 
  2636. creates the file. SpHyDir creates Extended Attributes for the HTML files to 
  2637. manage the larger logical document structure within the subdocument tree. 
  2638.  
  2639.  One EA provides quick external access to the document TITLE without having to 
  2640. read through the HTML. Another lists all the Subdocuments that the current 
  2641. document claims. Another lists the parent, if any, of the current document. 
  2642. Another lists all the Header text and levels of all the Sections contained 
  2643. within the document. 
  2644.  
  2645.  To create a Subdocument link, first drag the "Book" tool (the first one in the 
  2646. Toolbar) and drop it anywhere a paragraph or list point can go. The definition 
  2647. is completed by dragging the Workplace icon of another HTML file from the 
  2648. library and dropping it on the newly created object. If the dragged file was 
  2649. previously generated by SpHyDir, then when it is dropped on the Subdocument 
  2650. object, SpHyDir will extract is TITLE (from the EA) and display it as the 
  2651. caption of the object. This title will appear in the final page on a line by 
  2652. itself hypertext linked to the referenced file. 
  2653.  
  2654.  When HTML is generated for the current file, the list of Subdocument objects 
  2655. in the order that they appear will be stored as an Extended Attribute of the 
  2656. current file, and an Extended Attribute will be created on each of the 
  2657. referenced files pointing back to the current file as the parent. 
  2658.  
  2659.  Subdocument objects are not a formal construct of HTML 2.0, but there is some 
  2660. fully documented syntax that comes very close. When the Subdocument object is 
  2661. converted to HTML, it is generated in one of two forms (a paragraph or a list 
  2662. item): 
  2663. <P><A HREF="xxx.htm" REL="Subdocument"> ...title...</A></P> 
  2664. or 
  2665. <LI><A HREF="xxx.htm" REL="Subdocument"> ...title...</A> 
  2666. If SpHyDir processes an existing HTML document with the REL="Subdocument" 
  2667. attribute it will try to convert it back to a subdocument object. 
  2668.  
  2669.  
  2670. ΓòÉΓòÉΓòÉ 11.4. Next and Previous ΓòÉΓòÉΓòÉ
  2671.  
  2672.  HEADER and TRAILER can contain variables which are replaced with current 
  2673. information. Variable names are enclosed in "[" and "]" characters. 
  2674. [Date] is replaced by the current date. 
  2675. [Doctitle] is replaced by the TITLE of the document. 
  2676. [Up] is replaced by the file that claims this as a subdocument. 
  2677. [Previous] and [Next] are replaced by the files that appear before and after 
  2678. this file in the Subdocument list of the Parent. 
  2679.  
  2680.  The [Up], [Next], and [Prevous] relationships don't always exist. For example, 
  2681. the document at the top of the tree has no Up. The first document listed as a 
  2682. Subdocument has no Previous, and the last document has no Next. To accomodate 
  2683. this, any line in HEADER or TRAILER that references a non-existant variable is 
  2684. entirely deleted. The idea is that you put on one line all the stuff that would 
  2685. relate to a relationship, and when it doesn't exist then the entire package is 
  2686. deleted. 
  2687.  
  2688.  An example HEADER might include the lines: 
  2689. <P> 
  2690. [<A HREF="[Up]">Up</A>] 
  2691. [<A HREF="[Previous]">Previous</A>] 
  2692. [<A HREF="[Next]">Next</A>] 
  2693. </P> 
  2694. <P><I> [Date] </I></P> 
  2695.  
  2696.  Every document gets a line containing the current date in italics. Above that 
  2697. line there may be 0-3 hyperlinks depending on the number of available 
  2698. relationships. If all three links are generated, then the line looks like: 
  2699. [Up] [Previous] [Next] 
  2700. with each word acting as a link. 
  2701.  
  2702.  
  2703. ΓòÉΓòÉΓòÉ 11.5. The Document Tree Window ΓòÉΓòÉΓòÉ
  2704.  
  2705.  The Window pulldown menu of the SpHyDir Workarea includes an option to display 
  2706. the Document Tree for whatever HTML file is currently in the Workarea. 
  2707.  
  2708.  To build this window, SpHyDir checks for the Parent of the current file, and 
  2709. then for the parent of the parent, until it finally reaches the Root document. 
  2710. It then proceeds down through the Extended Attributes of the Root and all the 
  2711. subdocuments and sub-subdocuments. For each file, the TOC Extended Attribute 
  2712. lists all of the Headers in that file. 
  2713.  
  2714.  The Document Tree window displays a complete cumulative Table of Contents for 
  2715. all of the files in the document tree structure. It is intended to eventually 
  2716. create a TOC file and simplify the creation of references from one part of the 
  2717. tree to a section in another file. 
  2718.  
  2719.  Currently, the major feature of this window is the ability, from the File 
  2720. pulldown menu, to trigger SpHyDir to regenerate HTML for all of the files in 
  2721. the tree. This is a convenient way to clean things up if the HEADER or TRAILER 
  2722. files have been changed or when the logical order of files has been rearranged. 
  2723.  
  2724.  
  2725. ΓòÉΓòÉΓòÉ 12. XSpO - External SpHyDir Rexx Code ΓòÉΓòÉΓòÉ
  2726.  
  2727.  It is nice to have code that understands Web Explorer, but other people use 
  2728. Netscape, Mosaic, or other browsers. SpHyDir can't handle every type of hotlist 
  2729. file. The solution to this and other problems is an External SpHyDir Object. 
  2730. These are called XSpO's (pronounced "expo") but given that they are written in 
  2731. Rexx, it is acceptable to roll an "R" in front of the name and call it a 
  2732. "Rexx-spo". 
  2733.  
  2734.  An XSpO is an external Rexx program that resides as a CMD file on disk. If you 
  2735. click on the file with the second mouse button, open its Settings, and change 
  2736. the icon, you can give it some meaninful icon. Then you put a shadow of the 
  2737. file in a desktop folder, probably along with your program object for SpHyDir. 
  2738.  
  2739.  An XSpO acts something like a Tool. You drag it from its workplace folder and 
  2740. drop it somewhere in the SpHyDir program. The nature of the XSpO decides where 
  2741. it can be dropped. Unlike the Tools, an XSpO could be dropped on an entry area 
  2742. or list. 
  2743.  
  2744.  The XSpO interface will be extended whenever an idea comes to mind. Currently, 
  2745. the two supported uses of an XSpO are to fill the New Links list box in the 
  2746. Link Manager window and to add a URL Link to an object in the work area. Sample 
  2747. XSpO files are supplied with SpHyDir for both purposes and will be discussed 
  2748. here. 
  2749.  
  2750.  SpHyDir assumes that it has an XSpO whenever the user drops a CMD file on an 
  2751. object. When the object accepts XSpO, it generates a Rexx Call to the file as 
  2752. an external procedure. Since the caller is running in the VX-Rexx environment, 
  2753. all of the VX-Rexx functions are available to the XSpO. However, it will be 
  2754. difficult to make use of them without 1) a copy of the VX-Rexx manual and 2) 
  2755. some hints from me about the environment. An XSpO that uses VX-Rexx function 
  2756. calls to manipulate objects is said to be "dirty." The internal implimentation 
  2757. of SpHyDir may change in the future, and such files may need to be changed. An 
  2758. object that supports XSpO will generally provide a convention using only 
  2759. arguments, the return value, and the stack. Details may differ from object to 
  2760. object. An XSpO that does not directly call VX-Rexx functions is said to be 
  2761. "clean." The terms are relative, and it may be convenient to use "quick and 
  2762. dirty" techniques from time to time. 
  2763.  
  2764.  When an XSpO is called, it is always passed as an argument the name of the 
  2765. object on which it was dropped. There is no good way (currently) for XSpO's to 
  2766. declare a type, so the XSpO itself has to make sure it has been dropped in the 
  2767. right place and return without doing anything if it is called by the wrong 
  2768. object. Objects that call XSpO's should ignore any null return. 
  2769.  
  2770.  When an XSpO is dropped on the New Links listbox of the Link Manager window, 
  2771. it is passed no arguments other than the "New_Links" object name. The XSpO puts 
  2772. new list entries on the Rexx stack. Each entry begins with a URL (no blanks are 
  2773. allowed by SpHyDir in a URL) and then a Title (blanks are OK in the tile). Each 
  2774. line in the Rexx queue is one list entry. Only the title will show up in the 
  2775. list box, the URL is kept as user data and is presented later on when the title 
  2776. is dragged to create a link. If the XSpO returns the word "CLEAR" from the 
  2777. function call, then the list box is cleared and the new list becomes its only 
  2778. contents. Otherwise, the new links are added in front of the existing links. 
  2779.  
  2780.  The following is the complete text of an XSpO that duplicates the existing Web 
  2781. Explorer Link Manager function. This file is distributed with SpHyDir and may 
  2782. be adapted to support other quicklist formats. 
  2783.  
  2784. /* XSpO version of Web Explorer Links */
  2785. arg object
  2786. if object<>"NEW_LINKS" then return
  2787.  
  2788. exploreini=Value("ETC",,"OS2ENVIRONMENT")"\EXPLORE.INI"
  2789. strm_status = Stream( exploreini, "Command", "Open Read" )
  2790. if strm_status="READY:" then
  2791.   do while lines(exploreini)>0
  2792.   line=linein(exploreini)
  2793.   if line="[quicklist]" then leave
  2794.   end
  2795.   do while lines(exploreini)>0
  2796.   line=linein(exploreini)
  2797.   parse var line "quicklist=" title
  2798.   if title="" then return
  2799.   url=linein(exploreini)
  2800.   queue url title
  2801.   end
  2802. return "CLEAR"
  2803.  
  2804.  The Workarea also supports XSpO's, but the only function currently supported 
  2805. is to add a Link to an object. Dropping this type of XSpO on a Workarea object 
  2806. is simpler than adding the link to the Link Manager list and then dragging the 
  2807. list item over and dropping it on the object. A supplied XSpO uses some rather 
  2808. "dirty" logic to find the current URL in Web Explorer (you have to enable the 
  2809. WE option that displays the URL in a box at the top of the window). Dropping 
  2810. this XSpO on a paragraph, point, or image puts a link to whatever page is 
  2811. currently being displayed in WE (without requiring that the page be added to 
  2812. the Quicklist). 
  2813.  
  2814. arg object
  2815.   if wordpos(object, "NEW_LINKS WORKAREA")=0 then return
  2816.  
  2817.   desktop = "?HWND1"
  2818.   app = VRGet( desktop, "FirstChild" )
  2819.     do while app<>""
  2820.     title=VRGet(app,"Caption")
  2821.     if substr(title,1,16 )="IBM WebExplorer " then
  2822.       do
  2823.       title=strip(substr(title,19),"B")
  2824.       kid= VRGet(app,"FirstChild")
  2825.       url=Searcher(kid)
  2826.       if url<>"" then queue url title
  2827.      if object="WORKAREA" then return "LINK"
  2828.       return "ADD"
  2829.       end
  2830.     app = VRGet( app, "Sibling" )
  2831.     end
  2832. return ""
  2833.  
  2834. Searcher: procedure
  2835.   parse arg w
  2836.   do while w <> ""
  2837.     if VRGet( w, "Visible" ) = 1 then do
  2838.       class = VRGet( w, "ClassName" )
  2839.       caption = VRGet( w, "Caption" )
  2840.       if class="WC_ENTRYFIELD" then return caption
  2841.       subkid = VRGet( w, "FirstChild" )
  2842.       url= searcher(subkid)
  2843.       if url<>"" then return url
  2844.       end
  2845.     w = VRGet( w, "Sibling" )
  2846.   end
  2847.  
  2848. return ""
  2849.  
  2850.  
  2851. ΓòÉΓòÉΓòÉ 13. Forms Support ΓòÉΓòÉΓòÉ
  2852.  
  2853.  Modern HTML and Web Browser programs allow the user to enter data and make 
  2854. selections with standard GUI Boxes, Buttons, and Lists. Collectively, these 
  2855. features are know as "forms" support. There are two steps. First, the author 
  2856. must design the data entry form using HTML language elements. Secondly, a 
  2857. program must be written in some supported language to process the data that the 
  2858. user enters. 
  2859.  
  2860.  HTML forms provide a subset of the standard GUI dialog features that will be 
  2861. familiar to users of Visual Basic or other visual programming languages. The 
  2862. user is presented with a set of single line and multiline text entry fields, 
  2863. checkboxes, radio buttons, selection lists, and push buttons. The user makes 
  2864. selections and enters data. Then a push button (or the Enter key) transmits 
  2865. data to the server. 
  2866.  
  2867.  
  2868. ΓòÉΓòÉΓòÉ 13.1. Forms Handling Programs ΓòÉΓòÉΓòÉ
  2869.  
  2870.  The data entered in a form has to be passed to locally written code that runs 
  2871. on the Web server machine. For a Unix machine, this program receives data 
  2872. through the "CGI" protocol. CGI specifies a particular way to pass information 
  2873. about the request, the remote machine, and the local server environment. Most 
  2874. CGI programs are written in either C or Perl. 
  2875.  
  2876.  However, SpHyDir runs in OS/2 and is written in Rexx. IBM has a very nice Web 
  2877. server package for this environment called GOSERVE. Each arriving request is 
  2878. passed to a locally customized Rexx filter program running as a subthread of 
  2879. the server. Whatever efficiency is lost using an interpreted language like Rexx 
  2880. is gained back by using threads instead of creating a new process for each 
  2881. request. Although GOSERVE provides all the necessary forms support, it doesn't 
  2882. use precisely the same conventions as the CGI interface. SpHyDir will talk more 
  2883. generically about a "forms processing program" while other sources would 
  2884. probably call the same thing a "CGI program" without assuming that there could 
  2885. be any other kind of server. 
  2886.  
  2887.  Each GUI object in the HTML form is associated with a variable name. The data 
  2888. and selections are transmitted as a sequence of "name = value" pairs, where 
  2889. name is the variable name associated with a field or button and value is the 
  2890. data typed or the alternative selected. This sequence of name and value pair 
  2891. must be processed by program that processes the request. 
  2892.  
  2893.  After the request is processed, the results are sent back to the remote user. 
  2894. Normally, the format of this result is another HTML file. Frequently, the 
  2895. response will also have Forms objects. The contents of the response file will 
  2896. include some insertions based on the results of the previous request. 
  2897.  
  2898.  Thus a comprehensive tool to simplify Form processing has to solve three 
  2899. problems: 
  2900.  
  2901.          1.
  2902.  
  2903.        It must provide the user with an easy way to specify the GUI objects 
  2904.       (entry fields, buttons, check boxes, and selection lists). SpHyDir does 
  2905.       this by providing Toolbar of GUI objects just as Visual Basic and VX-Rexx 
  2906.       solve the same problem with similar toolbars. 
  2907.  
  2908.          2.
  2909.  
  2910.        It must provide a simple way to decode the incoming "variable=value" 
  2911.       pairs. The Rexx language (along with some helper functions provided by 
  2912.       GOSERVE) makes this a trivial task, but it is not a very difficult 
  2913.       problem in any language. SpHyDir provides a Rexx "helper" routine named 
  2914.       SpHyDir_Decode in the SPHYHLPR.VRS file that provides this service. 
  2915.  
  2916.          3.
  2917.  
  2918.        It must provide a way to insert data into the reply sent back to the 
  2919.       user. 
  2920.  
  2921.        Some existing programs generate the entire response with program 
  2922.       statements: 
  2923.       SAMPprintf("<TITLE>Response to Your Request</TITLE>\n");/SAMP 
  2924.       This is tedious, difficult to read, and impossible to validate. 
  2925.  
  2926.        A second approach scans an HTML file and inserts data: 
  2927.       SAMP<TITLE> 
  2928.       %insert TITLETEXT 
  2929.       </TITLE>/SAMP 
  2930.       This is slow because it requires a syntax scan during every reply. 
  2931.  
  2932.        SpHyDir provides (IMHO) a better solution. The programmer uses SpHyDir 
  2933.       to create a ordinary HTML file with text and forms objects. As SpHyDir 
  2934.       generates the HTML, it separately tabulates the location of strings or 
  2935.       insertion points that correspond to the various forms variable names. If 
  2936.       the file is fetched as a *.HTM file, then everything goes out as it was 
  2937.       designed. However, if a forms processing program wants to send the file 
  2938.       back as a reply to a previous query, then it can call a helper routine 
  2939.       (SpHyDir_Reply in the supplied Rexx-GOSERVE example) that extracts from 
  2940.       the program the current value of all variables whose names correspond to 
  2941.       the variable names assigned to the forms objects in the HTML file. These 
  2942.       current values from the program are inserted into the file as it is sent 
  2943.       back to the user and populate the fields, boxes, buttons, and lists that 
  2944.       are available for the next reply. 
  2945.  
  2946.   Rexx is a particularly attractive language in which to do this kind of 
  2947.  programming because access to its variable names and symbol table is simple 
  2948.  and flexible. The combination of SpHyDir, Web Explorer, GOSERVE, and 
  2949.  Rexx-based Forms processing programs provides a simple but powerful Web 
  2950.  development environment. However, local requirements will soon make it 
  2951.  necessary to extend this development environment to real CGI programs running 
  2952.  on Windows NT or Unix servers. 
  2953.  
  2954.  
  2955. ΓòÉΓòÉΓòÉ 13.2. Forms are poorly Form-matted ΓòÉΓòÉΓòÉ
  2956.  
  2957.  The ambiguities of HTML that cause problems for SpHyDir in normal text are 
  2958. made worse when Forms are processed. Consider a simple example: 
  2959.  
  2960.  The top line is a simple entry area for typed characters. The second line 
  2961. presents three alternatives using the "radio button" metaphor (only one can be 
  2962. selected, and choosing one deselects the others). The last line is a check box 
  2963. that can be set or cleared by clicking it. 
  2964.  
  2965.  In visual programming languages, such as Visual Basic, each radio button or 
  2966. check box has a "caption" defining the text that follows the box or button and 
  2967. describes the option. In this example, the captions are "HTTP", "Gopher", 
  2968. "FTP", and "BINARY". Occasionally, but less frequently, a Text Entry object 
  2969. would also have a caption (in this case "Identify a Server Machine:"). In any 
  2970. case, the Caption is an attribute of the object and is part of the object 
  2971. definition. 
  2972.  
  2973.  However, in HTML a box or button object is just the box or button itself. Any 
  2974. caption text is just ordinary "paragraph" text. There is no limit on its size, 
  2975. contents, or structure. Just as SpHyDir had to invent a chapter and section 
  2976. structure by looking at Heading tags, it must also construct GUI programming 
  2977. objects by assuming that the captions are reasonable and obvious. 
  2978.  
  2979.  All GUI objects (entry areas, buttons, boxes, and selection lists) must be 
  2980. inside a FORM area. However, the form can also contain ordinary text, images, 
  2981. ordered and unordered lists, sections, and everything else that is valid in a 
  2982. document. Unlike a paper form, where the instructions are usually separate so 
  2983. that the input can be easily processed, an HTML form can have the input widely 
  2984. scattered through the text. When the form is submitted, only the values of the 
  2985. entry fields and the selections made by the user are transmitted, not the 
  2986. captions and text. 
  2987.  
  2988.  A user will become confused, however, if each Radio Button option is 
  2989. accompanied with three screens full of explanation. The relationship between 
  2990. the buttons would be lost. Therefore, it is probably best if each field or 
  2991. button has a short clean caption. Furthermore, based on a universal GUI 
  2992. practice, the caption of a data entry area would ususally come in front of the 
  2993. entry field (as the example "Identify a Server Machine:"), while the label of a 
  2994. check box or radio button comes right after it. 
  2995.  
  2996.  In normal text, most of the SpHyDir objects start a new line. This is not true 
  2997. of Form Objects. If a browser can fit the next button on the same line, it will 
  2998. do so. The only way to be sure that there is a line break is to create a 
  2999. paragraph (<P>) tag. 
  3000.  
  3001.  In normal text, every SpHyDir object is "paragraph sized" or larger. SpHyDir 
  3002. knows to create a line break when paragraphs, ordered lists, and headers are 
  3003. encountered. But several forms objects may have to go on the same line. One 
  3004. idea would be to create a higher "grouping" object to which they might all 
  3005. belong, but SpHyDir is based on the principle that format should follow from 
  3006. document structure, and it seems wrong to create artificial structure to 
  3007. duplicate a format feature. 
  3008.  
  3009.  It has always been possible to create an empty paragraph. Simply drag the 
  3010. Paragraph tool to the document to create a new paragraph, then type nothing in 
  3011. it. When the HTML is generated, this creates a line of the form: 
  3012. <P> </P> 
  3013. in the output. The problem is that SpHyDir ignores empty paragraphs when 
  3014. reading in normal text, so this structural element is lost when the document is 
  3015. re-edited. SpHyDir relaxes this rule, and will preserve empty paragraphs when 
  3016. they are encountered inside a Form structure. A form designer should drop an 
  3017. empty paragraph object between any two buttons, fields, or boxes that are 
  3018. supposed to appear on different lines. 
  3019.  
  3020.  
  3021. ΓòÉΓòÉΓòÉ 13.3. Form Tools ΓòÉΓòÉΓòÉ
  3022.  
  3023.  The Toolbar contains template objects for all the GUI elements that HTML 
  3024. supports. If this document is viewed using a Web Browser, examples of the Forms 
  3025. objects will appear in the document. They are not connected to any processing 
  3026. program at this time. Attempting to submit anything from these form objects 
  3027. will return an error message. Just go back to the document and continue. Forms 
  3028. examples will not appear in the INF version of this material, because forms are 
  3029. not supported in IPF. 
  3030.  
  3031.  
  3032. ΓòÉΓòÉΓòÉ 13.3.1. The Forms Tool ΓòÉΓòÉΓòÉ
  3033.  
  3034.  Interactive form elements are valid only within a section of a document maked 
  3035. as a Form. The Form Tool creates such a section. Drag the Form Tool over and 
  3036. drop it anywhere in a document except within another Form. This creates a new 
  3037. level in the document tree. All other form objects, and all ordinary document 
  3038. objects, are valid within a Form section. 
  3039.  
  3040.  Each form must be associated with the name of a program that the server will 
  3041. run to process the data from the form. When the form object is created or 
  3042. selected, an entry area becomes visible into which a program identifier can be 
  3043. typed. The exact format for program identifiers depends on the type of server 
  3044. being used. On a Unix server, this is usually the name of a program in the 
  3045. "cgi-bin" subdirectory, as in "/cgi-bin/program". On other systems, this may be 
  3046. any program name. 
  3047.  
  3048.  
  3049. ΓòÉΓòÉΓòÉ 13.3.2. The Single Line Text Entry Field ΓòÉΓòÉΓòÉ
  3050.  
  3051.  The Entry Field Tool creates a "single line" text entry area. This is the type 
  3052. of field that would be used to read simple data like a name, phone number, 
  3053. E-Mail address, or book title. 
  3054.  
  3055.  The caption for the Entry Field Object is treated like paragraph text. When 
  3056. the field is created, or when the object is double-clicked, the standard Text 
  3057. Edit window opens. Although the user can type an arbitrary amount of text into 
  3058. the window, the caption should generally be short. When the object is closed, 
  3059. it is the caption and not the default field contents that appears next to the 
  3060. Entry Field Object in the SpHyDir Workarea. 
  3061.  
  3062.  An Entry Field object has attributes. When the object is created or is 
  3063. selected by clicking with the first mouse button, a set of fields becomes 
  3064. visible in the upper right section of the Workarea. Yes, these are also "entry 
  3065. fields", but they are part of the VX-Rexx application and not the HTML Forms. 
  3066. Many of these attributes are common or similar across all the Forms objects. 
  3067. For each type of object, the appropriate set of fields becomes visible. 
  3068.  
  3069.  The first (top) attribute is a variable name. When the form is submitted, the 
  3070. text entered into the field will be transmitted as the value of a "name=value" 
  3071. sequence. For example, entering "Yale University" into a field with this 
  3072. definition would transmit the sequence: 
  3073. SAMPsampentry=Yale University/SAMP 
  3074. to the Web Server. This value, along with any other values from other fields in 
  3075. the form, will be passed to the program designated by the FORM object to handle 
  3076. the data. 
  3077.  
  3078.  In many cases, the Text Entry field will be initially empty and the user will 
  3079. be expected to type a value in. HTML allows an initial value to be transmitted 
  3080. from the server. This string will appear in the Text Entry field and will be 
  3081. transmitted back as its value if the user doesn't change it. A static default 
  3082. value can be entered in the second (long middle) field. 
  3083.  
  3084.  A default value can also be generated dynamically from a previous Web Server 
  3085. program that requested transmission of the current page. To allow this, SpHyDir 
  3086. creates a "symbol table" external but connected to the HTML source for the 
  3087. page. This table is attached as an Extended Attribute of the file in the OS/2 
  3088. or NT file system, and is stored less elegantly as a separate file in Unix. For 
  3089. this field, the table would contain a line of the form: 
  3090. ENTRY SAMPENTRY nnnn 18 
  3091. Where "ENTRY" is the type of forms object, "SAMPENTRY" is the name of the 
  3092. variable associated with the field, "nnnn" will be replaced with the byte 
  3093. offset in the field of the default value (in this example, the offset of the 
  3094. "S" in "Sample Entry Field"), and 18 is the length of the static default value. 
  3095.  
  3096.  An Entry field generates HTML text of the form: 
  3097. <INPUT TYPE="TEXT" NAME="SAMPENTRY" VALUE="Sample Entry Field" SIZE="30" 
  3098. MAXLENGTH="30"> 
  3099. If no static default text is provided, a VALUE="" is generated to simplify the 
  3100. insertion of a dynamic default text from the symbol table. SpHyDir helper 
  3101. routines simplify the insertion of dynamic default text from forms processing 
  3102. programs. 
  3103.  
  3104.  The last attributes of an Entry Field include a checkbox to declare that this 
  3105. is a Password field (so the data typed in should be masked out) and two length 
  3106. fields. The first length specifies the size of the box, the second field is the 
  3107. maximum amount of data that can be typed into the box. If the maximum amount is 
  3108. larger than the size of the box, or is omitted all together, then when the user 
  3109. gets to the end of the box the previous characters shift left to make room. 
  3110.  
  3111.  
  3112. ΓòÉΓòÉΓòÉ 13.3.3. The Multiline Entry Field ΓòÉΓòÉΓòÉ
  3113.  
  3114.  A Multiline Entry (MLE) Object generates an area with scroll bars into which 
  3115. the user can type an arbitrary amount of text. This is ususally used for 
  3116. freeform feedback (to send comments, suggestions, or complaints to the author). 
  3117. It can also be used to annotate information. 
  3118.  
  3119.  An MLE is a large object, so it has no formal caption. If you want to describe 
  3120. it, do so in the paragraph that preceeds or follows it. The contents of the MLE 
  3121. object, which can be edited by double clicking the object and opening the Text 
  3122. Edit window, is the static data that will appear as a default within the MLE 
  3123. window when it is displayed on the remote screen. 
  3124.  
  3125.  An MLE field in a Web Browser will not support font changes or hypertext 
  3126. links. SpHyDir may eventually get around to disabling these options in the Text 
  3127. Edit window. Meanwhile, when editing default text for an MLE, don't use 
  3128. italics, bold, or any of the other format tags. 
  3129.  
  3130.  An MLE is associated with a variable name. When the form is submitted, the new 
  3131. content of the MLE will be assigned as a value to that variable name. SpHyDir 
  3132. creates a entry in the Variables Extended Attribute with the type of "MLE", the 
  3133. name of the variable, the location of the start of the default text, and the 
  3134. length of the static default text. This can be used by the helper routine to 
  3135. insert an alternate string dynamically into the form as it is being 
  3136. transmitted. The content of such a string would be whatever HTML declares to be 
  3137. valid between the <TEXTAREA> and </TEXTAREA> tags. 
  3138.  
  3139.  An MLE also has a size specified as rows and columns. They appear in the two 
  3140. lower numeric boxes and can be changed to fit the application needs. 
  3141.  
  3142.  
  3143. ΓòÉΓòÉΓòÉ 13.3.4. The Checkbox Tool ΓòÉΓòÉΓòÉ
  3144.  
  3145.  The Checkbox Tool creates a standard GUI Checkbox object. A caption follows 
  3146. the Checkbox to describe the option. The caption is regarded as the "contents" 
  3147. of the object and may be edited by double-clicking the checkbox object to open 
  3148. the Text Edit window. Unlike the MLE, the checkbox caption is ordinary text and 
  3149. may contain emphasis (bold, italics) or hypertext links. 
  3150.  
  3151.  The Checkbox is associated with a variable name. When the checkbox is seleted, 
  3152. a "name=ON" pair is returned. A static default value can be set by clicking the 
  3153. "Checked" option when the checkbox object is currently selected. 
  3154.  
  3155.  A Checkbox has a variable name. It can also be statically assigned an initial 
  3156. value by checking the "Checked" checkbox for the Checkbox object. [This is 
  3157. about the fourth pass through this document, and it just gets worse as it gets 
  3158. more precise.] 
  3159.  
  3160.  There are different ways to express the value of a Checkbox variable. As a 
  3161. number it would be 0 or 1. In other contexts it might be "YES" and "NO" or 
  3162. "TRUE" and "FALSE". In HTML, the checkbox is turned on by adding the keyword 
  3163. "CHECKED" to the tag that defines it: 
  3164. SAMP<INPUT TYPE="CHECKBOX" NAME="NOMAYO" CHECKED>/SAMP 
  3165. However, when the user submits the form and the box is checked, the variable 
  3166. name is returned with the value "ON" as in: 
  3167. SAMPNOMAYO=ON/SAMP 
  3168. Clearly this is a muddy area and may be subject to further refinement. 
  3169.  
  3170.  When SpHyDir generates the Variables EA for this field, the entry will have 
  3171. the form: 
  3172. CHECKBOX NOMAYO nnnn 7 
  3173. Where the type is CHECKBOX, the variable name is NOMAYO, nnnn is the byte 
  3174. offset in the file of the blank following the variable name, and the length is 
  3175. either 0 or 7 since the word "CHECKED" has seven letters and is either present 
  3176. or omitted. 
  3177.  
  3178.  
  3179. ΓòÉΓòÉΓòÉ 13.3.5. The Radio Button Tool ΓòÉΓòÉΓòÉ
  3180.  
  3181.  The RadioButton Tool is used to specifiy one of a set of mutually exclusive 
  3182. alternatives. Only one can be selected, and selecting that option automatically 
  3183. turns off the other alternatives. 
  3184.  
  3185.  The Web server is: 
  3186.  
  3187.  The caption of the RadioButton, which can be edited by doubleclicking the 
  3188. object to open the Text Edit Window, is ordinary text and may have emphasis and 
  3189. hyperlinks. However, if the captions are large enough so that the alternatives 
  3190. cannot all fit on the same line, the user must provide additional HTML markup 
  3191. (such as the <HR> tag) to group related buttons together. 
  3192.  
  3193.  When a RadioButton Object is created or selected, three fields become visible 
  3194. at the top of the Workarea. The first field provides the variable name for this 
  3195. button (and implicitly all other buttons that are part of the same grouping). 
  3196. The second field contains a string that will be assigned to the variable when 
  3197. this particular button is selected. Under these fields, a Checkbox allows this 
  3198. particular button to be selected as the default for the group. To be 
  3199. meaningful, only one button in each group can be checked as the default. 
  3200.  
  3201.  In Visual Basic and VX-Rexx, radio buttons have to be collected in a Group Box 
  3202. to be related to each other. In HTML forms, radio buttons are related by having 
  3203. the same variable name. The value assigned to that variable name distinguishes 
  3204. one button from another. 
  3205.  
  3206.  Radio Buttons pose a problem for the symbol table in the Extended Attribute. 
  3207. Up to this point, every HTML object produced one entry with its own variable 
  3208. name, and there was one insertion point for the value of that variable. 
  3209. However, each Radio Button has a tag location, and to override a static default 
  3210. with dynamic information from a program, the "CHECKED" attribute in all of the 
  3211. tags has to be manipulated. So for every radio button, the Variables EA gets a 
  3212. separate entry: 
  3213. SAMPRADIOBUT SERVER=UNIX nnnn 0 
  3214. RADIOBUT SERVER=OS2 nnnn 0 
  3215. RADIOBUT SERVER=NT nnnn 0/SAMP 
  3216. The "nnnn" in each line is the offset in the file of the blank that follows the 
  3217. name and either preceeds ">" (if the length is 0) or "CHECKED>" (if the length 
  3218. is 7). An acceptable strategy is to process these entries in order, checking 
  3219. the current value of the program's "SERVER" variable against the possible 
  3220. matching strings "UNIX", "OS2", and "NT". If a match is made, then "CHECKED" is 
  3221. inserted into the HTML file, if not and the length is 7 then the old "CHECKED" 
  3222. string is removed. 
  3223.  
  3224.  
  3225. ΓòÉΓòÉΓòÉ 13.3.6. The Spin and Listbox Objects ΓòÉΓòÉΓòÉ
  3226.  
  3227.  A Spin field displays a sequence of alternatives within a single window. CUA 
  3228. rules suggest that the Spin choice is appropriate when the alternatives are 
  3229. ordered, but the Spin object also allows a small number of alternatives to be 
  3230. meaningfully displayed in a small space. In HTML terms, a Spin object 
  3231. corresponds to a SELECT tag with no SIZE parameter. 
  3232.  
  3233.  Get a dozen eggs: 
  3234.  
  3235.  An interesting feature here is that Web Explorer seems to mess up the order 
  3236. and selection rules. It defaults to the last alternative chosen, when the 
  3237. standard clearly says that the first is the default, and it seems to get 
  3238. "bigger" and "smaller" reversed. 
  3239.  
  3240.  A Listbox provides another way to display alternatives. It is probably more 
  3241. suitable if the number of options is large. This Object is also a SELECT list, 
  3242. but with the SIZE parameter specified. 
  3243.  
  3244.  For both selection objects, a static list of alternatives can be entered 
  3245. through the Text Edit window by doubleclicking the object. Each alternative is 
  3246. typed on a separate line. Press Enter between alternatives. Do not use 
  3247. character emphasis or try to assign links to the alternatives. 
  3248.  
  3249.  List alternatives can be assigned dynamically by creating an array of 
  3250. character strings. For example, in Rexx a set of alternatives might be 
  3251. specified by the sequence: 
  3252. account.0=3 
  3253. account.1="Checking" 
  3254. account.2="Savings" 
  3255. account.3="Money Market" 
  3256. If the user chose the second option, this would then feed back as the string 
  3257. "account=Savings" which the Rexx helper routines would use to assign the string 
  3258. "Savings" to the variable ACCOUNT in the next program. [A note to those who are 
  3259. not Rexx wizards, the scalar variable ACCOUNT is completely independent of the 
  3260. "stem" ACCOUNT. (with the trailing period). This strategy uses the stem to hold 
  3261. the list of alternatives, and uses the scalar to designate which alternative 
  3262. was selected.] 
  3263.  
  3264.  
  3265. ΓòÉΓòÉΓòÉ 13.3.7. Pushbuttons ΓòÉΓòÉΓòÉ
  3266.  
  3267.  After filling in the required fields, the user triggers an action on the 
  3268. server by pressing a Pushbutton. If no Pushbutton object appears in the form, 
  3269. pressing the Enter key may also transmit data. 
  3270.  
  3271.  A default Pushbutton with no options is labelled "SUBMIT". It will trigger 
  3272. transmission of the data, but will add nothing to the datastream itself. 
  3273. Multiple "SUBMIT" buttons would be indistinguishable from each other. 
  3274.  
  3275.  Each Pushbutton has attributes: 
  3276.  
  3277.  The left entry box is the name of a variable. The right box is both the value 
  3278. assigned to the variable when the button is pushed and also the label placed on 
  3279. the face of the button. 
  3280.  
  3281.  When an explicit variable name is assigned to a Pushbutton object, an entry is 
  3282. also made in the Variable Extended Attribute. It identifies a type of 
  3283. "PUSHBUT", the variable name, the offset of the static value string, and its 
  3284. length. If the helper functions are used, they will check for a variable of the 
  3285. same name in the calling program and will substitute its current value in the 
  3286. Pushbutton definition. This means that the caption of the Pushbutton can be 
  3287. dynamically changed by the calling program. 
  3288.  
  3289.  A special version of the Pushbutton control is established if the Hidden 
  3290. attribute is checked when the button object is selected. A Hidden field doesn't 
  3291. appear on the user's screen, but it is passed back as part of the data stream 
  3292. to the next program. This can be used to pass a handle, transaction ID, or 
  3293. other state information from one screen to the next. 
  3294.  
  3295.  
  3296. ΓòÉΓòÉΓòÉ 14. Bugs and Restrictions ΓòÉΓòÉΓòÉ
  3297.  
  3298.  VX-Rexx 2.1B has a bug when moving a tree of records in a container. Suppose, 
  3299. for example, you decide to move one section in front of another. You can click 
  3300. on the sections to collapse the tree so that just the two icons are showing. 
  3301. You can then drag the second icon in front of the first. However, when you 
  3302. re-expand the tree, you will see that elements two or three levels down in the 
  3303. tree have been incorrectly reorganized. For now, the safe way to move large 
  3304. sections of the document is to mark them with Alt-L and move them through the 
  3305. SpHyDir special "Clipboard" window. 
  3306.  
  3307.  Web Explorer creates unusual objects that cannot be directly dropped on the 
  3308. SpHyDir windows. To process a document, drag the document from the WE window to 
  3309. a folder in the HTML library on the current machine. SpHyDir can only process 
  3310. files that are in the library. Drop a URL object on the desktop or in a folder 
  3311. first, then use it to build a link. 
  3312.  
  3313.  
  3314. ΓòÉΓòÉΓòÉ 15. Supported and Unsupported HTML ΓòÉΓòÉΓòÉ
  3315.  
  3316.  SpHyDir II was restructured to simplify extensions. Most of the HTML 3.0 and 
  3317. Netscape tags and attributes are now supported, or will be shortly. 
  3318.  
  3319.  SpHyDir generates LINK tags for Subdocument relationships (Next, Previous, 
  3320. Up). It preserves, as properties of the Document Object, LINKs mentioned in the 
  3321. current HTML 3.0 draft (Home, TOC, Index, Glossary, Copyright, Help, and 
  3322. Bookmark). It plans to support Header and Trailer links for document specific 
  3323. boilerplate files. Other LINK tags are not preserved. 
  3324.  
  3325.  The SpHyDir objects have a place for every valid construction, but they may 
  3326. not support constructions that are invalid, even when frequenlty used. If there 
  3327. is a reasonable strategy, current incorrect markup may be "upgraded" to valid 
  3328. status. For example, lists may not contain any data outside the list items: 
  3329. <OL>Text here is illegal, but there is a lot of it in practice. 
  3330. <LI>This is an implied paragraph 
  3331. <LI><P>This is an explicit paragraph</P></LI> 
  3332. Text here is nominally illegal. 
  3333. </OL> 
  3334. SpHyDir will take one text string outside the points and "upgrade" it to the 
  3335. HTML 3.0 List Header <LH> contents. In other places, loose text may be upgraded 
  3336. to a <CAPTION> or <CREDIT>. However, when there is no place to put it, the text 
  3337. may get lost. 
  3338.  
  3339.  SpHyDir needs where possible to convert HTML constructs to the properties of 
  3340. an Object. A particular problem is created by hypertext labels generated by <A 
  3341. NAME=xxx>word</A>. Since SpHyDir cannot manage properties for individual words, 
  3342. it assigns the NAME to the ID property of the Paragraph, Section, or other 
  3343. object in which the labelled word appears. It is the intention of SpHyDir to 
  3344. migrate this to the preferred <P ID=xxx> syntax of HTML 3.0 as soon as that 
  3345. syntax is universally supported. For now, SpHyDir rewrites the HTML by applying 
  3346. the <A NAME=xxx> tag to the entire text content of the Paragraph or Header in 
  3347. which it previously appeared. SpHyDir does not support two <A NAME=xxx> labels 
  3348. within the same paragraph or header. 
  3349.  
  3350.  In many visual programming languages, buttons and boxes have a caption. This 
  3351. is not an HTML concept. SpHyDir follows the more common practice to simplify 
  3352. use. In HTML, a check box is just the box: 
  3353. <INPUT TYPE="CHECKBOX" NAME="BIN"> BINARY 
  3354. Syntatically, the last word "BINARY" is outsize the tag. It is just text. If 
  3355. SpHyDir didn't make any stuctural assumptions, it would just appear as ordinary 
  3356. paragraph text. However, SpHyDir depends on creating "objects" that are bigger 
  3357. than just a "[]" or "O". So the Entry field, Checkbox, and Radiobutton forms 
  3358. object include text that functions as the "caption" of the object. 
  3359.  
  3360.  
  3361. ΓòÉΓòÉΓòÉ 16. Character Sets ΓòÉΓòÉΓòÉ
  3362.  
  3363.  Character set issues are ususally overlooked in the US. However, a World Wide 
  3364. Web has to confront the problem of displaying information in languages other 
  3365. than English. This is a fairly difficult problem that must be approached 
  3366. carefully. 
  3367.  
  3368.  The most complete solution would be Unicode, a two-byte character set that 
  3369. includes every modern language in the world. This may prove important in the 
  3370. future, but its use today is premature. A more modest solution is to use the 
  3371. ISO "8859" family of one-byte character sets. In particular, the ISO 8859-1 
  3372. "Latin 1" character set supports all the Western European languages from 
  3373. Iceland, to the Nordic countries, to Italy. 
  3374.  
  3375.  There is little perspective in Connecticut about how people overseas actually 
  3376. configure their personal computers. The screen is a more powerful device and 
  3377. can support many different character sets. The keyboard is more constrained. 
  3378. Through the years there have been many different approaches to the keyboard 
  3379. entry of foreign language character sets. If SpHyDir is going to provide an 
  3380. easy to use editing environment, the data entry is an important part of the 
  3381. problem. 
  3382.  
  3383.  Without any user input, SpHyDir now caves in to the OS/2 System design. It 
  3384. embraces the IBM architecture of Code Pages. The assumption is that IBM sells 
  3385. hardware and software overseas and if it insists on pushing an architecture 
  3386. like Code Pages, then that must be how people are actually using the system. A 
  3387. few terms need to be defined: 
  3388.  
  3389.   character set 
  3390.  
  3391.             A character set is a collection of characters that completely 
  3392.            address a particular need. For example, the upper and lower case 
  3393.            alphabet is a character set that can be used to express all the 
  3394.            common names of people in the US (since names like "Sally2" and 
  3395.            "Bi$$" don't occur). The minimal useful computer character set are 
  3396.            the 94 characters in the ASCII set (although for many purposes you 
  3397.            can get along without ~ ` { } or ^. Extensions to this character set 
  3398.            exist to support particular foreign languages or special purposes 
  3399.            (math, APL). 
  3400.  
  3401.   font 
  3402.  
  3403.             A font is a set of instructions for drawing each character in a 
  3404.            character set on a screen or printer. The system normally uses a 
  3405.            small set of bitmap fonts to display characters of normal size. 
  3406.            Algorithmic fonts such as Microsoft's TrueType or Adobe's ATM fonts 
  3407.            can be displayed in any size. 
  3408.  
  3409.   code 
  3410.  
  3411.             A standard that assigns number values to every character in a 
  3412.            character set, allowing those characters to be stored in a computer 
  3413.            memory, on disk, or to be transmitted on a communications line. 
  3414.            ASCII and EBCDIC are examples of codes. A code always has some 
  3415.            control characters to represent the end of a line, a backspace, a 
  3416.            tab, and other functions. In ASCII, the control character values are 
  3417.            from 0 to 31 and in EBCDIC they are from 0 to 63. 
  3418.  
  3419.   code page 
  3420.  
  3421.             A Code Page is (essentially) a character code in which all the 
  3422.            control values have been removed and replaced with addtional 
  3423.            printable characters. Code Page is mostly an IBM term, though it has 
  3424.            rubbed off on Microsoft. It allows a display or printer to have some 
  3425.            additional special use characters that can be displayed in contexts 
  3426.            where the normal functions of control characters are not needed. 
  3427.  
  3428.   When IBM designed the PC in 1980 there were no general international 
  3429.  standards for character sets and code pages beyond the standard ASCII set. The 
  3430.  PC created a Code Page by filling in the remaining 256-94=162 code locations 
  3431.  with a haphazard collection of box drawing, international, and dingbat (club, 
  3432.  face, "small house") characters. Years later this was designated in IBM terms 
  3433.  as Code Page 437. 
  3434.  
  3435.   Later on during the 1980's, the Internation Standards Organization (ISO) 
  3436.  finally developed a set of one-byte character sets that extended the ASCII 
  3437.  standard to other character sets. 
  3438.  8859-1 covers Western Europe 
  3439.  8859-2 covers "Latin" Eastern Europe 
  3440.  8859-5 Cyrillic 
  3441.  8859-6 Arabic 
  3442.  8859-7 Greek 
  3443.  8859-8 Hebrew 
  3444.  8859-9 like 8859-1 but drop Iceland and add Turkey 
  3445.  
  3446.   The HTML 2.0 standard makes 8859-1 the default encoding for HTML documents. 
  3447.  However, the HTTP and MIME standards allow a document to be encoded in any of 
  3448.  the ISO 8859 family of code sets. It would be a mistake for SpHyDir to drop 
  3449.  its USA-centered perspective only to adopt a slightly broader 8859-1 Western 
  3450.  European perspective. 
  3451.  
  3452.   The "Latin 1" character set on which the 8859-1 code is based includes some 
  3453.  characters which were not part of the IBM PC Code Page 437. Most of the 
  3454.  vendors (Microsoft with Windows and NT, Adobe with PostScript and ATM, DEC) 
  3455.  simply adopted 8859-1 as their standard code. IBM decided that it was too 
  3456.  important to leave the basic box-drawing characters in their current location. 
  3457.  Instead, they created Code Page 850, which includes all the Latin 1 characters 
  3458.  but does not assign them to their 8859-1 code values. 
  3459.  
  3460.   The OS/2 Presentation Manager has a dummy Code Page 1004 that reflects the 
  3461.  ISO 8859-1 character values. However, this is not recognized as a "real" Code 
  3462.  Page number by most of the commands and OS/2 services that deal with such 
  3463.  things. 
  3464.  
  3465.   Before beating up on IBM, it should be noted that the ISO 8859-1 standard may 
  3466.  not be quite as useful as it first appears. While it is fairly simple to 
  3467.  display 256 different characters (or more) on a computer screen or printer, it 
  3468.  is very difficult to squeeze all those characters on the keyboard. Any 
  3469.  one-byte code page will have too many characters for easy keyboard input, but 
  3470.  not enough characters to handle the total information system requirement. 
  3471.  
  3472.   Long before modern computers and laser printers made a complete 8-bit code 
  3473.  set possible, foreign countries had adopted variations on the old 7-bit 
  3474.  "ASCII" character set. The idea was to give up a character you don't need for 
  3475.  one that is more important in your country. The characters ` ~ ! @ # $ % ^ { } 
  3476.  [ ] \ | < > could be replaced with ╨ó or ╤ê. These substitutions created other 
  3477.  Code Pages in which the foreign use characters have been placed in the 
  3478.  familiar ASCII location, and the ASCII charcters that they displaced have been 
  3479.  put somewhere else. 
  3480.  
  3481.   There is also the problem that in any large publishing project, the character 
  3482.  sets quickly expand beyond any 256 character subset. Beyond French and 
  3483.  Spanish, there are Hebrew, Arabic, Cyrillic, Greek, and then the problem of 
  3484.  mathematical symbols, special punctuation, and the stupid box drawing 
  3485.  characters that caused all the trouble in the first place. Some of this you 
  3486.  can handle with GIF files, but the rest pose a problem. 
  3487.  
  3488.   HTML and current World Wide Web practice address this issue with Entities. 
  3489.  The characters that are not part of the standard ASCII set are referenced by 
  3490.  name. An Entity reference to a character begins with "&", then contains the 
  3491.  character name, and ends with ";". The special character used in HTML syntax 
  3492.  are converted to Entities, with < > and & referenced as < > and & 
  3493.  respectively. The ╨ó symbol is denoted Æ (short for "A-E ligature"). 
  3494.  
  3495.   Going back to the earlier analysis, the Entity name allows HTML to refer to a 
  3496.  character in a character set without becoming dependent on any particular code 
  3497.  mapping. While a code mapping would limit you to 256 characters, the range of 
  3498.  possible names is unlimited. Entities also allow you to accomodate Code Pages 
  3499.  that either reflect historical accident (the original PC Code Page 437) or 
  3500.  National Use subsets. 
  3501.  
  3502.   The CODPAGE statement in the OS/2 CONFIG.SYS dataset specifies first the 
  3503.  default Code Page number, and then an alternate value. IBM normally makes 437 
  3504.  the default to support obsolete DOS utilities. In modern use, particularly 
  3505.  when someone edits HTML files, it makes more sense to at least make 850 the 
  3506.  default: 
  3507.  CODEPAGE=850,437 
  3508.  For more information, look up CODEPAGE in the Command Reference file in the 
  3509.  Information folder. 
  3510.  
  3511.   SpHyDir does not change the current Code Page. The whole idea behind the 
  3512.  current SpHyDir strategy is that whatever Code Page the user has currently 
  3513.  selected must be familiar. The user must already know how to deal with it and 
  3514.  how to comfortably enter data in the local language. So SpHyDir converts HTML 
  3515.  use to the Code Page environment rather than trying to change OS/2 to some 
  3516.  other character set. 
  3517.  
  3518.   The number of the current code page is used as a file extension. SpHyDir 
  3519.  searches the root directory of the HTML library (determined from the HTMLLIB 
  3520.  environment variable or the current directory when SpHyDir starts up). It 
  3521.  looks for three files: ENTITES.xxx, CHARIN.xxx, and CHAROUT.xxx where xxx is 
  3522.  the Code Page number. SpHyDir is distributed with *.850 versions of these 
  3523.  three files for the recommended Code Page 850. 
  3524.  
  3525.   The ENTITIES file is an ordindary text file with entries to map the Entity 
  3526.  names to values in the current code page. For example, the ENTITIES.850 begins 
  3527.  with the lines: 
  3528.  CODE 
  3529.  b5 Aacute Á Capital A, acute accent 
  3530.  b7 Agrave À Capital A, grave accent 
  3531.  b6 Acirc Â Capital A, circumflex accent 
  3532.  /CODE 
  3533.  Only the first two items are significant. On the first line, "b5" is the hex 
  3534.  representation of the value assigned to the character in the 850 code page and 
  3535.  "Aacute" is the name of the entity (with the leading "&" and trailing ";" 
  3536.  stripped off). The rest of the line is commentary. 
  3537.  
  3538.   SpHyDir has a builtin knowlege of the < > and & Entity names. These 
  3539.  are also the only Entities that can be mapped to a code value below 80 hex. 
  3540.  All the other Entity names that SpHyDir will process specially come from the 
  3541.  ENTITIES.xxx file. However, if SpHyDir encounters an Entity name that is not 
  3542.  defined in the file, it simply converts the "&" to a Smiley Face dingbat 
  3543.  character and retains it in its Entity form in the Workarea and Text Edit 
  3544.  windows. Later on the Similey Face is turned back to "&" when the HTML is 
  3545.  generated. 
  3546.  
  3547.   The CHARIN.xxx and CHAROUT.xxx files provide translate tables to handle files 
  3548.  encoded in the ISO 8859-1 character set. The CHARIN table translates 
  3549.  characters from the HTML file with code values from A0 to FF hex to the 
  3550.  corresponding codes in the current Code Page. The CHAROUT file provides a 
  3551.  table to translate Code Page characters with a hex value of 80 to FF to the 
  3552.  external ISO 8859-1 set. 
  3553.  
  3554.   SpHyDir provides CHARIN.850 and CHAROUT.850. Since the 850 Code Page contains 
  3555.  the Entire Latin 1 character set, this appears to be a fairly reasonable 
  3556.  arrangement. The user is free to create a CHARIN.437 to support the older PC 
  3557.  character set, but since it does not contain all the characters in the Latin 1 
  3558.  alphabet some characters may be lost on input. Also, the CHAROUT table cannot 
  3559.  meaningfully translate PC dingbat characters ( like the box drawing character) 
  3560.  that are not part of the 8859-1 set. 
  3561.  
  3562.   Assuming that the user adopts this suggestion to make 850 the default Code 
  3563.  Page: 
  3564.  
  3565.     
  3566.  
  3567.        If a CHARIN.850 file has been copied to the root directory of the HTML 
  3568.       library, then immediately after reading in an HTML file somewhere in that 
  3569.       library, SpHyDir uses the table in that file to translate any ISO 8859-1 
  3570.       extended code values to their corresponding Code Page values. Note that 
  3571.       this simply shuffles one set of code above hex 80 to another set of codes 
  3572.       also above hex 80. Since all the HTML markup and entity names use 
  3573.       standard ASCII characters below hex 80, the initial translation will not 
  3574.       effect any of the subsequent syntax analysis. 
  3575.  
  3576.     
  3577.  
  3578.        If there is no CHARIN table, then any code value in the HTML file will 
  3579.       be read into SpHyDir untranslated. It will display with whatever 
  3580.       character the current Code Page assigns to that code value. However, 
  3581.       without a CHAROUT table it will also be written back to HTML with its 
  3582.       original code value. SpHyDir will not provide any help displaying or 
  3583.       editing such characters, but it will not damage them if the user leaves 
  3584.       them undisturbed. 
  3585.  
  3586.     
  3587.  
  3588.        When processing text, SpHyDir identifies an Entity from the leading "&". 
  3589.       It will handle the <, >, and & Entities automatically. Without an 
  3590.       ENTITIES.850 file in the root directory of the HTML library, those are 
  3591.       the only Entities that it knows about. With an ENTITIES file, it will 
  3592.       look up any other Entity names that the file defines and replace the 
  3593.       Entity reference with the code value in the current Code Page for the 
  3594.       corresponding character. The character will then display normally in the 
  3595.       Workplace document tree and in the Text Edit Window. 
  3596.  
  3597.     
  3598.  
  3599.        Any Entity name that is not matched against the file remains an Entity. 
  3600.       Since SpHyDir wants the "&" character to edit normally, and since a lot 
  3601.       of dingbat characters are available, the "&" introducer is replaced by 
  3602.       the Smiley Face character whose code value (in all Code Pages) is 01. 
  3603.  
  3604.     
  3605.  
  3606.        When it goes to generate HTML, SpHyDir converts the Smiley Face dingbat 
  3607.       back to an "&". Thus anything that displays as a SmileyFace Entity in the 
  3608.       Text Edit window will become a regular HTML Entity in the final file. It 
  3609.       will not be translated to anything else. 
  3610.  
  3611.     
  3612.  
  3613.        Any text in a Paragraph or Header that contains extended code values 
  3614.       (above hex 80) will be checked against the table build from the 
  3615.       ENTITIES.xxx table. If a match is found, the character is replaced with 
  3616.       an Entity reference to the character name. 
  3617.  
  3618.     
  3619.  
  3620.        Any extended code values that do not match Entity names will be 
  3621.       translated by the CHAROUT.xxx table should it exist. These characters 
  3622.       will remain as single byte codes. However, if they are proper Latin 1 
  3623.       characters then they should be assigned their 8859-1 values and should 
  3624.       display properly with a browser. 
  3625.  
  3626.     
  3627.  
  3628.        If there is no CHAROUT table, any character in SpHyDir memory will be 
  3629.       written to the HTML file without translation. If this happens to be a 
  3630.       valid 8859-1 character, then it will display on most browsers. 
  3631.  
  3632.   Although 850 is the recommended International Code Page, many users may 
  3633.  prefer other OS/2 Code Pages tailored to a particular country. It is trivial 
  3634.  to generate another ENTITIES.xxx table file. Generating the CHARIN and CHAROUT 
  3635.  tables are a bit more difficult, but the existing tables were generated with a 
  3636.  C program and, given a bit more time, it may be possible for SpHyDir to 
  3637.  provide these tables for other defined numbers: 
  3638.  852 Latin 2 (Czechoslovakia, Hungary, Poland) 
  3639.  857 Turkish 
  3640.  860 Portuguese 
  3641.  861 Iceland 
  3642.  863 Canada (French-speaking) 
  3643.  865 Nordic 
  3644.  This will remain an exercise unless some real user out on the Web reports that 
  3645.  they use one of these Code Pages and would like them to be supported. 
  3646.  
  3647.   It is not clear if more is needed to support the right-to-left characters. 
  3648.  For that matter, it is not clear if there is any Web Support for: 
  3649.  862 Hebrew-speaking 
  3650.  864 Arabic-speaking 
  3651.  Again, input from users would be helpful. 
  3652.  
  3653.   I have not studied the scope of the National Use Code Pages. They may not 
  3654.  include all of the Latin 1 characters. Lacking official Entity names, and any 
  3655.  usable Web standards, and any support from Browsers such as Netscape, it seems 
  3656.  premature for PCLT to try to solve this problem all by itself. This is, 
  3657.  however, an area where Entity notation has a substantial advantage over 
  3658.  CHARIN/CHAROUT single character translation. A user with an Icelandic keyboard 
  3659.  can still generate the occasional Turkish character as a named Entity even if 
  3660.  that character cannot be natively displayed in the Text Edit Window. This is 
  3661.  the reasoning behind the SpHyDir bias to generate output as Entity notation 
  3662.  instead of as single byte 8859-1 encoding. 
  3663.  
  3664.   If this isn't exactly what you want, please E-mail Howard.Gilbert@yale.edu 
  3665.  with additional suggestions.