Re: StAX support

Tatu Saloranta <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
Hmmh. I thought I had contributed Stax builders way back when... what happened to those pieces?

For what it's worth, code is/was available at:

http://woodstox.codehaus.org/StaxMisc

and I thought ended up on jdom sandbox/contrib section.

-+ Tatu +-



________________________________
From: Rolf <[email protected]>
To: jdom <[email protected]>
Sent: Sunday, November 13, 2011 6:03 PM
Subject: [jdom-interest] StAX support

Hi All.

I have been trying to put StAX support in to JDOM for a little while now, and I have just pushed through the code to github that contains the majority of the anticipated API on the JDOM side for handling the StAX parsing/processing of XML.

I have been using as references the StAX specification, the JDOM 'way' of doing things, and the rest of the web.

Some observations I have:
1. StAX is currently the fastest way (slightly) to parse XML on my computer.
2. The StAX specification is perhaps the very worst specification I have ever seen for functionality currently in the Java language/API. I hope that other concepts in the JCP process have better results.
3. XML Validation with StAX is 'hard'.
4. DOCTYPE handling in StAX is unpredictable.
5. after having been around for almost as long as JDOM, the StAX concept is still 'dynamic' and changing.

Essentially, I have had a long hard look at it, and I think there were a number of oversights in the process.... it's a good concept that has had a poor implementation.

On the other hand, I have put a fair amount of thought in to it, and gone a long way to making it work well in JDOM (within the limitations of StAX), and there may be some use in it.

My thinking is that I will leave the code in there for the moment, but it is incomplete, and I really need to work on something else in the meantime.

It is still a 50/50 as to whether it should be in there, or be stripped out again.

What I would really like is to get in touch with a StAX 'expert' and run some of my concerns past them.

Is there someone on this list with some StAX insight?
Is there a forum anyone knows of that's dedicated to the StAX implementation in Java?

Anyway, I would appreciate it if some people with StAX experience played with the code:

String filename = "myfile.xml";
StreamSource source = new StreamSource(new File(filename));
XMLInputFactory inputfac = XMLInputFactory.newInstance();
inputfac.setProperty(
    "http://java.sun.com/xml/stream/properties/report-cdata-event",
    Boolean.TRUE);
XMLStreamReader reader = inputfac.createXMLStreamReader(source);

StAXStreamBuilder stxb = new StAXStreamBuilder();
Document staxbuild = stxb.build(reader);


Rolf
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.