Aaron,

speaking for myself, it's more the aggressive tone of your replies that's getting in the way.

I agree that SAX and DOM are stinking piles of crap and completely unsuited to round-tripping preserving human formatting.

However I still think StAX has the potential to be made to do what's needed.

BTW I will put my time where my mouth is.



Sent from my iPod

On 5 Aug 2008, at 20:31, Aaron Digulla <[EMAIL PROTECTED]> wrote:

Jochen Wiedmann schrieb:

particular mode, one could supply and accept additional events. In the case of white space around attributes, you could offer an extension of the Attribute interface that informs about whitespace to the left and
to the right.
That's great. Can I also add new getters to the Attribute interface? ;)

Aaron, I know you since the early Amiga days quite well and have a
very high opinion of you. So believe me: Such nonsense is way beyond
your abilities. Or do I really need to point out how you can extemd an
API, exposing additional powers, without loosing upwards
compatibility, by extending interfaces or adding methods to
implementations?

My point is that you can't extend an API which is part of a standard.
Either the standard already contains means to save the information I
need to add or there is no way to keep it.

What drives me so mad is that no one here on the list takes the five
minutes to even try to understand what I'm talking about.

Okay. Look at the last example in the tutorial (http://code.google.com/p/decentxml/wiki/Tutorial ).
If StAX can pass this test case, I'm willing to have a look.

I know how difficult it can be to keep XML syntax from a lot of
experience. Typical areas of trouble are internal DTD (which we
hopefully no longer need to bother with, thanks heaven) and (as you
have pointed out) white space within opening and closing tags. But
that example is almost trivial. I think you are underestimating the
power of SAX, StAX, and friends quite a lot.

Despite the example being so trivial, I haven't seen a single XML parser
who can do this:

- Create a document
- Add a single root element
- Add two attributes
- Insert a newline between two attributes
- Write the document to a file

You can't do it. The XML standard allows it as input but there is no API to do that for the output. The space between attributes is a limbo. Same
goes for comments before the root element in DOM. SAX can't do it, DOM
certainly can't do it and StAX can't do it either.

I challenge you to prove me wrong. Send me a piece of code which I can
compile against any existing XML parser to prove me wrong (and it must
be a parser. System.out or FileWriter isn't a parser; of course you can
do that manually).

Regards,

--
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://darkviews.blogspot.com/          http://www.pdark.de/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to