Re: StAX support
Rolf Lear <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <[email protected]> |
hi Tatu In my mind I think it would be reasonable to support StAX source/sink in JDOM with the following conditions: Input: - JDOM will ignore DTD events unless explicitly configured to receive them. If they are expected, they must be a full DTD "<!DOCTYPE root .... >" not just an 'internal subset' or other invalid value. (this eliminates woodstox as a 'supported' parser I think as it only provides the internal subset), and the internal Java6 implementation creates a partial/truncated doctype "<!DOCTYPE emt " unless there's an internal subset, at which point it produces everything... ) - JDOM will treat SPACE and CHARACTERS events identically - the XML*Reader must be configured to provide CDATA events, otherwise JDOM will never know. - JDOM can process JDOM fragments from partially processed XML*Readers as long as they are on a logical event (i.e. excluding END_ELEMENT, END_DOCUMENT, and the likes). Output: - JDOM can output all of it's content types, but special handling for EntityRef is required (not sure of all the details yet). - DocType content will be output as a single String "<!DOCTYPE element SYSTEM .... [ ... ] >" - JDOM content can be output as fragments to partially-written XML*Writers on the condition that the writer is at an appropriate state before the JDOM write happens. I think the behaviour of the various StAX parsers/libraries is consistent enough to provide a reasonable base for the above restrictions.... Any 'expert' observations/criticisms/suggestions? Rolf On Mon, 14 Nov 2011 11:09:12 -0800 (PST), Tatu Saloranta <[email protected]> wrote: > Just because you do not see value does not mean there is no value. > > Number one reason for adding support is interoperability, meaning that > there is often need to convert between streaming/incremental APIs and tree > model. > > -+ Tatu +- > > > > ________________________________ > From: Elliotte Rusty Harold <[email protected]> > To: Rolf <[email protected]> > Cc: jdom <[email protected]> > Sent: Monday, November 14, 2011 5:02 AM > Subject: Re: [jdom-interest] StAX support > > I agree with Michael. There's no gain in supporting StAX. I would > invest time or resources into it. _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]