[cxml-devel] Ho do I write the following on a sink?

Marco Antoniotti marcoxa at cs.nyu.edu
Mon May 30 17:45:36 UTC 2011


On May 27, 2011, at 18:43 , David Lichteblau wrote:

> Quoting Marco Antoniotti (marcoxa at cs.nyu.edu):
>> Guys!  Throw me a bone here!!!!!
>> 
>> I don't want to roll out my own XHTML generator!
>> 
>> So, the culprit is SAX:CHARACTERS CXML::SINK , which calls CXML::UNPARSE-INDENTED-TEXT, which calls CXML::SINK-WRITE-EXCAPABLE-ROD.  This last function seems wrong as it hardcodes behavior.  The problem is that nowhere in the chain there is an obvious place where to put entity handling.  Or should CXML::SINK-WRITE-EXCAPABLE-ROD be rewritten?  If that is the case, where should entities be found?  In the sink, in a stash somewhere else?  Or maybe TRT is to build a special XHTML sink?
>> 
>> Any ideas?
> [...]
>> On May 16, 2011, at 10:58 , Marco Antoniotti wrote:
>> 
>>> 
>>> On May 16, 2011, at 09:39 , Marco Antoniotti wrote:
>>> 
>>>> ...  Since I am using CXM to do the reading, it would be natural not to depend on YAL (Yet Another Library) to do the reading. 
>>> 
>>> I meant "writing" :}
> 
> cxml:unescaped is the "official" solution to implement this.
> Please use that.

That is not a solution.  I do not want to write (:p "And now" (cxml:unescaped "Λ") "!")
(which, besides, does not work).

> As for xhtmlgen, which you seem to be depending on: That's not an
> official cxml api.  It is sample code based on htmlgen by Franz.  I've
> never been a fan of htmlgen, but others like it, and I developed
> xhtmlgen for bknr, which needed it.
> 
> It's basically still sample code.  Copy&paste material.
> 
> If you like it, just put it into your own project, and hack it as
> desired to add any features you want changed.
> 
> Don't try to dig into any internals within cxml's package.  Just look at
> xhtmlgen, if that is what you want to use.

Well, I wouldn't want to do anything with the internals of *any* package :)

The problem is that even looking ad XHTML-GENERATOR there are several problems in figuring out how to rewrite it using the SAX handlers.  It appears to me that the only way of doing this properly is to subclass the sink class by introducing a XHTML-SINK as a hook for specialized SAX methods.  Would this be the way to go?

Cheers

--
Marco Antoniotti


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cxml-devel/attachments/20110530/db29943a/attachment.html>


More information about the cxml-devel mailing list