[jdom-interest] StAX support

Rolf Lear jdom at tuis.net
Mon Nov 14 11:56:43 PST 2011


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
<cowtowncoder at yahoo.com> 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 <elharo at ibiblio.org>
> To: Rolf <jdom at tuis.net>
> Cc: jdom <jdom-interest at jdom.org>
> 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.


More information about the jdom-interest mailing list