maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Digulla <digu...@hepe.com>
Subject Changes necessary in StAX to get it on par with DecentXML
Date Wed, 06 Aug 2008 07:48:11 GMT
Hello,

That didn't work well. Okay, since you don't believe me, here is an  
(incomplete) list of changes I would need in StAX to be able to use it  
for my work instead of having to write my own XML parser. Note: If you  
feel like asking "who would ever need that?" while reading that list,  
then my answer is that I didn't want this mail to become 100KB long,  
so I won't tell you all the reasonings which finally distilled into  
the list below. I'm working with XML for 10 years, now, I have used  
almost every XML tool out there and none of them could cover all the  
ground I need to plow.

- Remove final from class XmlReader
- The interface Attribute needs a new method which returns the raw  
value read by the parser (i.e. without &quot; expanded)
- The interface Attribute needs a new method to specify the quote  
which was read/should be used during writing
- The reader API must allow a way to return entity references  
unexpanded plus a way to expand the references during parsing and later
- The StartElement must be extended to allow to specify the order in  
which attributes and name space declarations where in the input
- A way to find out if the namespace was given by prefixing the  
element name or by using an xmlns attribute.
- There must be a special text element which can be used everywhere  
where Attribute is used.
- The writer is probably powerful enough; I'd just use writeRaw() in a  
lot of places (which kind of defeats the purpose but it would work).

Since the client API should ignore anything it doesn't understand, it  
might be possible to implement this without breaking client code but  
I'm only 80% sure of that at this time.

That would get me about 30% to where I am now with DecentXML, because  
DecentXML doesn't only read XML, it also creates a DOM-like structure  
for me, which I can navigate and modify. As far as I can see, stax  
doesn't have any support for collecting the data in a smart data  
structure.

These are the reasons why I don't think that StAX would be the right  
tool for my task, why I think that no amount of work spent on it would  
ever make it the right tool. Even if I spent the time, the result  
would be as non-standard as DecentXML and DecentXML already does what  
I need after three days of work.

I have poured the wisdom of 10 years working with various XML parsers  
and tool and that is why I'm so confident that no other XML tool can  
do what it can.

I'm not 100% sure whether StAX could be modified to allow to  
modify/filter POM files without too much disruption, because POM uses  
only a small subset of XML. But then, Maven POMs are only 1% of my  
daily work and I need a tool that can solve the other 99% as well.

A lot of people find that XML can do whatever they need but when I  
asked them, after a bit of poking, the real answer is that they  
actually needed something else but gave up on it, because they  
eventually realized that no tool on the market gave them the necessary  
flexibility to do it. So again, the available tools have limited what  
they can do instead of the other way around. That is the issue  
DecentXML tries to solve.

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://www.pdark.de/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message