
Lee wrote:
As threatened, I have started preparing a CSS file that will allow TEI files, at least PG-TEI files, to be displayed natively in a web browser....
Great work!
The principal work in creating the style sheet was in determining which TEI tags suggested a block presentation, which tags suggested an inline presentation, and which tags are primarily "metadataish" and which should not be displayed at all (but which are useful, if not essential, for creating catalogs). Most of the tags fell easily into one of these three categories (ignoring, for the moment, tables) ...
Have you looked at how to handle the contents of the inline TEI <note> tag? http://www.tei-c.org/P4X/CO.html#IDX-22 Here's some of what this section says: "A note is any additional comment found in a text, marked in some way as being out of the main textual stream. All notes should be marked using the same tag, <note>, whether they appear as block notes in the main text area, at the foot of the page, at the end of the chapter or volume, in the margin, or in some other place. "Notes may be in a different hand or typeface, may be authorial or editorial, and may have been added later. Attributes may be used to specify these and other characteristics of notes, as detailed below. "Where possible, the body of a note should be inserted in the text at the point at which its identifier or mark first appears. This may not be possible for example with marginal notes, which may not be anchored to an exact location..." So, to directly render (with CSS) TEI documents containing inline <note> content, it's best the note be removed from the mainflow and floated in its own box (such as to one side). A year ago I experimented with this, and got it to work for Opera and Firefox (but not IE6 which does not support the required CSS), and was even able to insert a note reference number. Something to explore. Unfortunately, I recently looked for the test files and somehow lost them. <arghh/> For the planned OpenReader, I want to look at how to implement this in a generic sense (such as adding a custom CSS 'display' property value) so OpenReader User Agents can treat the contents of inline annotative content in any markup vocabulary in one or more ways (e.g., render it in a popup, move it to a special notes page, etc.) Interestingly, XHTML 2.0 is planning an attribute which can be used to make an inline object an annotative "note", but whether user agents will implement it in a proper manner is still unclear. XHTML 2.0 is not being very "pushy" about this attribute -- the specese in the draft is pretty weak (need to write Steven Pemberton on this.)
The biggest obstacle remains how to make the images appear; I haven't yet found anything in the CSS spec that will permit this.
Not sure if you've looked at the Fahrner Image Replacement method. http://www.stopdesign.com/articles/replace_text/ Essentially, a tag can be given a background image using CSS: background-image:url(imagename.png); then you set the *contents* of that tag to be display:none (you have to have an inner tag to set to display:none -- you can't set to display:none the tag which will contain the background image!) I believe it is possible to make this method generic, so CSS will read the image name string from an attribute (this *can* be done if things are structured right), then substitute the string back into the CSS property to specify the background image. It may be necessary to specially tailor the TEI markup to make sure one has an outer and an inner tag -- the outer will be assigned the background image, and the inner will be set to display:none. The cool thing about the FIR method is that in the absence of CSS, it is possible to get something to render, such as the text describing the image, which is what you already do in your test TEI of Alice in Wonderland. Of course, the ultimate method for embedding images and objects, and to enable hypertext linking in any XML document is XLink, but XLink support in the major browsers is limited to Mozilla and Firefox and to hypertext linking only (not image/object inclusion.) Here's a little test I whipped up a while back on hypertext linking in browsers using XLink (which should also be of interest for direct rendering of TEI): http://www.windspun.com/demoxml/demolink.xml As noted above, the hypertext link will work only for Mozilla and Firefox browsers -- the link is not activated in IE6 and Opera 7/8. (Note that CSS does not contain a 'display' value to assign HTML "anchor" properties to any tag, and upon thinking about it, it is obvious that trying doing so will get messy very fast -- e.g., how does one recognize and assign the URI link in an arbitrary XML document?) This also explains why there's no generic support in CSS 'display' for image and object inclusion -- again it is messy to think how to do this using a set of CSS 'display' properties. XLink is definitely the long-term, vocabulary independent solution anyway. Jon