- From: David Megginson <dmeggins@aix1.uottawa.ca>
- Date: Wed, 24 Jan 1996 20:50:35 -0500
- To: "Benjamin C. W. Sittler" <bsittler@mailhost.nmt.edu>
- Cc: www-style@w3.org
Benjamin C. W. Sittler writes: > P.S. How do browser authors feel about handling full parse trees? > What's the average performance penalty for actually parsing the > document using a true SGML parser? Any ideas on how to handle > parsing before a document is completely loaded? (Should heuristics > based on existing HTML practice be used, or is it simply too > unknowable?) Actually, there should be very little performance hit, if any -- an SGML parser does not have to validate the document which it is parsing, and building a parse tree of what the browser thinks is the document's structure should be trivial. It should also be possible to display the document as the parse tree is being constructed, unless something in the stylesheet (whatever its format) requires a forward reference. As soon as an element begins you already know all of its ancestors, how deeply it is nested, and all of its left siblings. If a forward reference is required (ie. you are looking for the second-last <h2> in the document), then the parser can build the tree up ahead only as far as necessary, or it could go back and adjust the styles after the parse is complete. David -- David Megginson Department of English, University of Ottawa, dmeggins@aix1.uottawa.ca Ottawa, Ontario, CANADA K1N 6N5 ak117@freenet.carleton.ca Phone: (613) 562-5800 ext.1203 WWW: http://www.uottawa.ca/~dmeggins FAX: (613) 562-5990
Received on Wednesday, 24 January 1996 20:50:21 UTC