"Graeme St.Clair" <[EMAIL PROTECTED]> wrote on 11/15/2006 10:36:49 PM:
> Thanks for all input on this one. > > The Big Hint was from Eric, being the use of > "http://apache.org/xml/features/scanner/notify-char-refs". What he didn't > (explicitly!) say is that it was also necessary to add the first of the two > lines > > xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", new > mus2HTMLHandler()); > xmlReader.setContentHandler(new mus2HTMLHandler()); > > where xmlReader is an instance of XMLReader, and mus2HTMHandler is now > defined as > > class mus2HTMLHandler extends DefaultHandler implements ContentHandler, > LexicalHandler { etc etc > > This hint I got from the xerces 2.8.1 samples/sax/DocumentTracer. Doubtless > I really only need one instance of mus2HTMHandler, but I'll clean that up in > the morning! > > It turned out that <?xml ... encoding="..."?> doesn't have any bearing on > this at all, tho it certainly does when the emitted HTML hits a browser > ;-). I now find that #269 is duly delivered to setEntity just as I want; > I'm sure I'll be able to pass that through to the final HTML construction, > which doesn't come till endDocument, as I do a sort first (surprise, > surprise). Readers may also be interested to know that using the feature > "http://apache.org/xml/features/scanner/notify-builtin-refs" causes all the > various &, &apos and so on to be delivered similarly, tho I'm not using > this. In a SAX context the "http://apache.org/xml/features/scanner/notify-builtin-refs" feature is on by default. > The above works on Java 1.5, but not on Java 1.4 (Eric's feature > unsupported). I still have to try 1.6. Not surprising. Sun's Java 1.4 included Crimson. The "http://apache.org/xml/*" features and properties only apply to Xerces. > Tx & rgds to all, Graeme. Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
