Subject: Re: API to formatters and grove engines From: Jean-Xavier Lotthé <mg068-3@xxxxxxxxxxxxxxx> Date: Sat, 28 Jun 1997 16:19:06 +0000 |
Paul Prescod wrote: >> How do you, list members, embed DSSSL into your aplications then ? > >I don't, yet. The DSSSL specification seems to be designed to process >full documents, not nodes. That is what Jade does, i.e. process full documents from the command line. Not only does it parse the entire file preceding the element I need, it does it every time I run it. All would be well if I just wanted to access an element once. Consider now: - I want to have two different outputs of a specific element (RTF and a special text format for the sentence to be simultaneously read by a synthesised voice). - this element is located at the bottom of a 10MB file. Running Jade twice from the command line means parsing the document twice and is time consuming. When the document was first parsed, I had "parent pointers" hanging around. I would like to be able to make use of them for the second output, and thus avoid spending time on an unuseful redundant parsing. Using the GroveBuilder OLE interface allow to keep track of those "parent pointers". The document is parsed once; after that you may access any document's element *very* quickly. You may navigate in your document and walk through the grove tree as in a fast dream. What happens when you want to format (RTF and special text) the node you now have located ? Would you pass the node GI as a variable in a "driver" .dsl file as you mentioned earlier ? Fine, but you would still have to run Jade twice, thus parsing the document twice more. >Why don't you just walk the grove tree from Visual Basic code >and spit out the strings you want to spit out? Very good question. There are many answers to it. - I could do it if I only had one element to spit out. That is what I'm already doing when I append my abstract titles in Windows dropdown lists. In this particular case, I don't care about formatting. Furthermore, I know the structure of the document at the title's level, so I don't care about query functionality either. In this understanding I'm using my SGML document as a pure database. So far, so good. However, once I've selected an abstract in my document, I then need the full power of DSSSL. There I care about formatting. Moreover, not knowing the precise content of the abstract, I do need the query functionalities to look for subtrees, etc. This is not an isolated element anymore, this is a node. And VB is not as good as DSSSL in dealing with nodes. - I could write some VB code to format the strings I spit out. I once thought about it, but I think it's not a good idea. It would first mean I would write yet another RTF backend and I'm very reluctant to it. It is true I will have to do it for my special text format and that's already enough. Another reason is based on pure intuition: given the recent Web Accessibility Initiative from the W3C as well as the Note on Aural Cascading Style Sheet, odds are good that there may be in the future an addition to the DSSSL standard to implement spoken renderings as proposed by T.V. Raman. In this acceptance, my work is only temporary until this addition exists. In those days, it will be easier to adapt a DSSSL code to this addition than to rewrite what I would have done with VB code. - I use VB to design the GUI and the interactive tree navigation. The VB code will then be (more or less) compiled and inaccessible for modification. Using independant uncompiled dsl files for output formatting makes a sense to me. It adds flexibility, modularity, maintainability. Most of all, users may develop their own standard DSSSL librairies (for large prints or faster speech). VB is only there to provide GUI and allow user interaction, no less but no more. Running Jade from the command line is adequate for one shot formatting of large documents but it lacks interactivity as for now. > Is DSSSL code much more powerful for >what you are trying to do than VB code? Oh yes ! ;)) Much more powerful. Very much faster to implement too. And there's no need to compile it. Furthermore, VB and DSSSL have one thing in common that makes them very easy to use: they both are "event triggered". When VB reacts to a click on a button, DSSSL reacts to an element occurence. Hence the adequacy of VB for the GUI design and the adequacy of DSSSL for the document management. There is yet another reason why I like DSSSL: it is *very* powerful when it comes to dealing with nodes, children, siblings and the like. Your mail had me thinking a lot during the night. I kept asking myself: "Do I really know what I'm doing ? Am I not going into something overcomplicated ? Am I asking for too much ? Do I really know what I'm using DSSSL for ? Will I finally fall asleep tonight ?". Then I found James' mail early in the morning. And I felt relieved. >Jade doesn't have an interface to format a subtree of a document, but it's >something that I think would be useful (particularily in conjunction with >an implementation of the grove interface for a database), and I don't think >it would be very hard to add. You both made my day: - I figured out why I use DSSSL and convinced myself I was not entirely wrong in wanting to do it this way. - I hold out hope that I'll be able to do it in a near future (thanks again James ;) I'm now a happy man and can enjoy this sunny saturday afternoon in Paris !! Regards, Xavier DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: API to formatters and grove eng, James Clark | Thread | Re: API to formatters and grove eng, James Clark |
Re: [Fwd: Uses of DSSSL], Taco Hoekwater | Date | "Multi-line header" - how?, Glenn R. Kronschnabl |
Month |