At 9:07 PM -0800 3/4/04, Clay Leeds wrote:
On Mar 4, 2004, at 6:53 PM, Elliotte Rusty Harold wrote:
At 10:43 AM +1000 3/5/04, Peter B. West wrote:

I think this might be because the HEAD developers were moving to a JAXP implementation, and SAXParserFactory is still in the 1.4 javax.xml.parsers package, which, AIUI, is what one is supposed to use for JAXP-compatible applications. I don't know much about JAXP, so this could be wrong.

It's a common misconception, but it is very much a misconception. I don't know how this meme got started, but it is annoyingly persistent; and it causes people all sorts of trouble. SAXParserFactory should not be used in 2004. It does not replace XMLReaderFactory. In fact, the opposite is true. XMLReaderFactory replaces SAXParserFactory. The only reason SAXParserFactory exists is to support SAX 1.0. It is underspecified and has completely wrong defaults for handling namespaces or SAX 2.


Honestly Sun should never have released it in the first place. By the time they released JAXP 1.0, SAX 2.0 was in late beta, just weeks from release, and was obviously going to render JAXP 1.0 obsolete; but Sun went ahead anyway, and thoroughly confused the market. Not invented here syndrome, I think. They simply were not willing to accept a process they didn't control. Four years later the rest of us are still paying the price for their hubris. :-(
--
Elliotte Rusty Harold

Two questions regarding this (forgive my naivete!):
- does a switch from SAXParserFactory to XMLReaderFactory have any bearing on the discussion about whether FOP should change its minimum JRE from 1.3/1.2 to 1.4?

None. XMLReaderFactory works with any compliant SAX 2 parser.


- if XMLReaderFactory works under JDK 1.3 and/or 1.2, what kinds of benefits might fop-0.20.5 see from a switch to XMLReaderFactory?

Cleaner simpler code that's less likely to get hosed by different implementations interpreting a spec in very different ways. Plus you'll be ready for the eventual deprecation of SAXParserFactory in JAXP 1.4. And you'll be able to work with SAX parsers that don't support JAXP. Not sure how much of an issue that is any more in practice, but it was a very real issue in the recent past.
--


  Elliotte Rusty Harold
  [EMAIL PROTECTED]
  Effective XML (Addison-Wesley, 2003)
  http://www.cafeconleche.org/books/effectivexml
  http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA

Reply via email to